-- costos jam/2019
This commit is contained in:
@@ -8,8 +8,8 @@ Imports Extensiones
|
|||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
|
|
||||||
Partial Class Inventarios_EntregaAlmacen
|
Partial Class Inventarios_EntregaAlmacen
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
|
|
||||||
#Region "PROPIEDADES"
|
#Region "PROPIEDADES"
|
||||||
Private Property CveVentaAD As Integer
|
Private Property CveVentaAD As Integer
|
||||||
Get
|
Get
|
||||||
@@ -243,10 +243,10 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
Set(value As Boolean)
|
Set(value As Boolean)
|
||||||
ViewState("EsDevolucionDirecta") = value
|
ViewState("EsDevolucionDirecta") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
|
|
||||||
@@ -254,9 +254,9 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
CargaParametrosAD()
|
CargaParametrosAD()
|
||||||
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then DdlAlmacen.AutoPostBack = True
|
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then DdlAlmacen.AutoPostBack = True
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
#Region " INICIALIZA VALORES "
|
#Region " INICIALIZA VALORES "
|
||||||
Private Sub InicializaValores()
|
Private Sub InicializaValores()
|
||||||
TipoEstatus = -1
|
TipoEstatus = -1
|
||||||
@@ -324,11 +324,11 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
|
|
||||||
LimpiaCampos()
|
LimpiaCampos()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region " CARGA PARAMETROS - EXCLUSIVO USO AD "
|
#Region " CARGA PARAMETROS - EXCLUSIVO USO AD "
|
||||||
Private Sub CargaParametrosAD()
|
Private Sub CargaParametrosAD()
|
||||||
|
|
||||||
@@ -346,9 +346,9 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
BtnGuardar.Visible = False
|
BtnGuardar.Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " CARGA PENDIENTES POR SURTIR "
|
#Region " CARGA PENDIENTES POR SURTIR "
|
||||||
Protected Sub DdlCliente_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlCliente_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
CargaFolios()
|
CargaFolios()
|
||||||
@@ -466,11 +466,11 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
End Select
|
End Select
|
||||||
UpPendientes.Update()
|
UpPendientes.Update()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region " CARGA VENTA POR SURTIR "
|
#Region " CARGA VENTA POR SURTIR "
|
||||||
Protected Sub BtnSurtir_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnSurtir_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
@@ -923,14 +923,14 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
End If
|
End If
|
||||||
objInv.Dispose()
|
objInv.Dispose()
|
||||||
GvDocs.DataBind()
|
GvDocs.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region " AGREGAR "
|
#Region " AGREGAR "
|
||||||
|
|
||||||
Protected Sub BtnSerie_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnSerie_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
Dim Argumentos = CType(sender, Button).CommandArgument.Split("°"c)
|
Dim Argumentos = CType(sender, Button).CommandArgument.Split("°"c)
|
||||||
@@ -957,10 +957,10 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
UpLoteBatch.Update()
|
UpLoteBatch.Update()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region " AGREGA POR SERIE/LOTE "
|
#Region " AGREGA POR SERIE/LOTE "
|
||||||
|
|
||||||
Private Sub CreaDtDetalle()
|
Private Sub CreaDtDetalle()
|
||||||
If DtDatosDetalle Is Nothing Then
|
If DtDatosDetalle Is Nothing Then
|
||||||
DtDatosDetalle = New DataTable
|
DtDatosDetalle = New DataTable
|
||||||
@@ -1165,11 +1165,11 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
DtDatosDetalle.AcceptChanges()
|
DtDatosDetalle.AcceptChanges()
|
||||||
CargaSerie()
|
CargaSerie()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " AGREGA CON LOTE BATCH "
|
#Region " AGREGA CON LOTE BATCH "
|
||||||
|
|
||||||
Private Sub CreaDtDetalleLote()
|
Private Sub CreaDtDetalleLote()
|
||||||
If DtDatosDetalleLote Is Nothing Then
|
If DtDatosDetalleLote Is Nothing Then
|
||||||
DtDatosDetalleLote = New DataTable
|
DtDatosDetalleLote = New DataTable
|
||||||
@@ -1357,9 +1357,9 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
End Try
|
End Try
|
||||||
DtDatosDetalleLote.AcceptChanges()
|
DtDatosDetalleLote.AcceptChanges()
|
||||||
CargaLote()
|
CargaLote()
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " AGREGA CON TXT | CODIGO - SERIE "
|
#Region " AGREGA CON TXT | CODIGO - SERIE "
|
||||||
Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
@@ -1493,12 +1493,12 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
TxtCantidadEspecialDiv.Text = "1"
|
TxtCantidadEspecialDiv.Text = "1"
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region " GUARDAR "
|
#Region " GUARDAR "
|
||||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
@@ -1917,7 +1917,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(CveAlmacenExA, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(CveAlmacenExA, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
||||||
Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida,
|
Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida,
|
||||||
Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RE/G4")
|
Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RE/GSC22")
|
||||||
FolioEntrada = ObjInventario.Folio
|
FolioEntrada = ObjInventario.Folio
|
||||||
|
|
||||||
If Not CveMovimientoEntradaApartado > 0 Then
|
If Not CveMovimientoEntradaApartado > 0 Then
|
||||||
@@ -2214,7 +2214,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
Dim CveMovimientoDevolucionSinCosto = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero(), 41, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
Dim CveMovimientoDevolucionSinCosto = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero(), 41, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
|
||||||
Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida,
|
Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida,
|
||||||
Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RE/G4")
|
Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RE/GSC4")
|
||||||
Dim FolioDevSinCosto = ObjInventario.Folio
|
Dim FolioDevSinCosto = ObjInventario.Folio
|
||||||
|
|
||||||
If Not CveMovimientoDevolucionSinCosto > 0 Then
|
If Not CveMovimientoDevolucionSinCosto > 0 Then
|
||||||
@@ -3229,160 +3229,160 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
TimmerRefresh.Enabled = True
|
TimmerRefresh.Enabled = True
|
||||||
UpGenerales.Update()
|
UpGenerales.Update()
|
||||||
CargaGvDatos()
|
CargaGvDatos()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " TRASPASO - TRANSITORIO "
|
#Region " TRASPASO - TRANSITORIO "
|
||||||
Protected Sub ChkTransitorio_CheckedChanged(sender As Object, e As EventArgs)
|
Protected Sub ChkTransitorio_CheckedChanged(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
TxtResponsable.Text = ""
|
TxtResponsable.Text = ""
|
||||||
DivTransitorio2.Visible = ChkTransitorio.Checked
|
DivTransitorio2.Visible = ChkTransitorio.Checked
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "SECCION ALMACEN"
|
#Region "SECCION ALMACEN"
|
||||||
'Private Sub CreaDtSeccionAlmacen()
|
'Private Sub CreaDtSeccionAlmacen()
|
||||||
' DtSeccionAlmacen = New DataTable
|
' DtSeccionAlmacen = New DataTable
|
||||||
' DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
|
' DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
|
||||||
' DtSeccionAlmacen.Columns.Add("IndexSeccionAlmacen", GetType(Integer))
|
' DtSeccionAlmacen.Columns.Add("IndexSeccionAlmacen", GetType(Integer))
|
||||||
' DtSeccionAlmacen.Columns.Add("CveSeccionAlmacen", GetType(Integer))
|
' DtSeccionAlmacen.Columns.Add("CveSeccionAlmacen", GetType(Integer))
|
||||||
' DtSeccionAlmacen.Columns.Add("CvePS", GetType(Integer))
|
' DtSeccionAlmacen.Columns.Add("CvePS", GetType(Integer))
|
||||||
' DtSeccionAlmacen.Columns.Add("SeccionAlmacen", GetType(String))
|
' DtSeccionAlmacen.Columns.Add("SeccionAlmacen", GetType(String))
|
||||||
' DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
|
' DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
|
||||||
'End Sub
|
'End Sub
|
||||||
'Private Sub CargaDdlAlmacen()
|
'Private Sub CargaDdlAlmacen()
|
||||||
' DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
|
' DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
|
||||||
' DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
' DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
' DdlSeccionAlmacen.DataBind()
|
' DdlSeccionAlmacen.DataBind()
|
||||||
'End Sub
|
'End Sub
|
||||||
'Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
'Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
||||||
' Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
' Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||||
|
|
||||||
' If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
|
' If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
|
||||||
' Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen.", TipoMensaje.MsgAdvertencia)
|
' Alert("Tiene que tener seleccionado un almacen para registrar seccion almacen.", TipoMensaje.MsgAdvertencia)
|
||||||
' Exit Sub
|
' Exit Sub
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' CantidadTotal = gvRow.FCTextBox("TbCantidadF").Text.ToDecimal
|
' CantidadTotal = gvRow.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||||
' IndexSeccionAlmacen = gvRow.RowIndex
|
' IndexSeccionAlmacen = gvRow.RowIndex
|
||||||
' CvePS = gvRow.DataKey("CvePS").ToEntero
|
' CvePS = gvRow.DataKey("CvePS").ToEntero
|
||||||
' CargaSeccionAlmacen()
|
' CargaSeccionAlmacen()
|
||||||
' RegistraScript("$('#DModalSeccionAlmacen').modal()")
|
' RegistraScript("$('#DModalSeccionAlmacen').modal()")
|
||||||
'End Sub
|
'End Sub
|
||||||
|
|
||||||
'Private Sub CargaSeccionAlmacen()
|
'Private Sub CargaSeccionAlmacen()
|
||||||
' Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}").SUMD("CantidadSeccionAlmacen")
|
' Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}").SUMD("CantidadSeccionAlmacen")
|
||||||
' GvSeccion.DataSource = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}")
|
' GvSeccion.DataSource = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}")
|
||||||
' GvSeccion.DataBind()
|
' GvSeccion.DataBind()
|
||||||
|
|
||||||
' TxtCantidadSeccion.Text = ""
|
' TxtCantidadSeccion.Text = ""
|
||||||
' DdlSeccionAlmacen.SelectedIndex = 0
|
' DdlSeccionAlmacen.SelectedIndex = 0
|
||||||
' Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
|
' Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
|
||||||
' If CantidadRestante = 0 Then
|
' If CantidadRestante = 0 Then
|
||||||
' RVTxtCantidad.MaximumValue = "1"
|
' RVTxtCantidad.MaximumValue = "1"
|
||||||
' TxtCantidadSeccion.Enabled = False
|
' TxtCantidadSeccion.Enabled = False
|
||||||
' Else
|
' Else
|
||||||
' RVTxtCantidad.MaximumValue = CantidadRestante.ToString
|
' RVTxtCantidad.MaximumValue = CantidadRestante.ToString
|
||||||
' TxtCantidadSeccion.Enabled = True
|
' TxtCantidadSeccion.Enabled = True
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' If CantidadTotalSeccion > 0 Then
|
' If CantidadTotalSeccion > 0 Then
|
||||||
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").Enabled = False
|
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").Enabled = False
|
||||||
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").ToolTip = "Cuenta con sección almacen"
|
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").ToolTip = "Cuenta con sección almacen"
|
||||||
|
|
||||||
' Else
|
' Else
|
||||||
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").Enabled = True
|
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").Enabled = True
|
||||||
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").ToolTip = ""
|
' GvDatos.Rows(IndexSeccionAlmacen).FCTextBox("TbCantidadF").ToolTip = ""
|
||||||
|
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' If DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen") > 0 Then
|
' If DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen") > 0 Then
|
||||||
' DdlAlmacen.Enabled = False
|
' DdlAlmacen.Enabled = False
|
||||||
' DdlAlmacen.ToolTip = "Cuenta con sección almacen"
|
' DdlAlmacen.ToolTip = "Cuenta con sección almacen"
|
||||||
' Else
|
' Else
|
||||||
' DdlAlmacen.Enabled = True
|
' DdlAlmacen.Enabled = True
|
||||||
' DdlAlmacen.ToolTip = ""
|
' DdlAlmacen.ToolTip = ""
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' UpModalSeccionAlmacen.Update()
|
' UpModalSeccionAlmacen.Update()
|
||||||
' UpDatos.Update()
|
' UpDatos.Update()
|
||||||
' UpGenerales.Update()
|
' UpGenerales.Update()
|
||||||
'End Sub
|
'End Sub
|
||||||
|
|
||||||
'Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
'Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
' Dim ObjInv As New ClsInventarios
|
' Dim ObjInv As New ClsInventarios
|
||||||
' Dim CantidadDisponible As Decimal = 0
|
' Dim CantidadDisponible As Decimal = 0
|
||||||
' If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlSeccionAlmacen.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero,
|
' If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlSeccionAlmacen.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero,
|
||||||
' CvePS, UsuarioActual.CveEmpresa) Then
|
' CvePS, UsuarioActual.CveEmpresa) Then
|
||||||
' If ObjInv.DtResultados.Rows.Count > 0 Then
|
' If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||||
' CantidadDisponible = ObjInv.DtResultados.Rows(0)("CantidadRestante").ToString.ToDecimal
|
' CantidadDisponible = ObjInv.DtResultados.Rows(0)("CantidadRestante").ToString.ToDecimal
|
||||||
' End If
|
' End If
|
||||||
' End If
|
' End If
|
||||||
' ObjInv.Dispose()
|
' ObjInv.Dispose()
|
||||||
|
|
||||||
' CantidadDisponible -= DtSeccionAlmacen.FiltraParametros($"CvePS = {CvePS} AND CveSeccionAlmacen = {DdlSeccionAlmacen.SelectedValue}").SUMD("CantidadSeccionAlmacen")
|
' CantidadDisponible -= DtSeccionAlmacen.FiltraParametros($"CvePS = {CvePS} AND CveSeccionAlmacen = {DdlSeccionAlmacen.SelectedValue}").SUMD("CantidadSeccionAlmacen")
|
||||||
|
|
||||||
' If TxtCantidadSeccion.Text.ToDecimal > CantidadDisponible Then
|
' If TxtCantidadSeccion.Text.ToDecimal > CantidadDisponible Then
|
||||||
' Alert($"No tiene cantidad de producto suficiente en esta seccion de almacen, su cantidad restante es: <b>{CantidadDisponible}</b>", TipoMensaje.MsgAdvertencia)
|
' Alert($"No tiene cantidad de producto suficiente en esta seccion de almacen, su cantidad restante es: <b>{CantidadDisponible}</b>", TipoMensaje.MsgAdvertencia)
|
||||||
' Exit Sub
|
' Exit Sub
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' Dim Row As DataRow = Nothing
|
' Dim Row As DataRow = Nothing
|
||||||
' DtSeccionAlmacen.AcceptChanges()
|
' DtSeccionAlmacen.AcceptChanges()
|
||||||
' Row = DtSeccionAlmacen.NewRow
|
' Row = DtSeccionAlmacen.NewRow
|
||||||
' Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
|
' Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
|
||||||
' Row("IndexSeccionAlmacen") = IndexSeccionAlmacen
|
' Row("IndexSeccionAlmacen") = IndexSeccionAlmacen
|
||||||
' Row("CveSeccionAlmacen") = DdlSeccionAlmacen.SelectedValue.ToEntero
|
' Row("CveSeccionAlmacen") = DdlSeccionAlmacen.SelectedValue.ToEntero
|
||||||
' Row("SeccionAlmacen") = DdlSeccionAlmacen.SelectedItem.Text
|
' Row("SeccionAlmacen") = DdlSeccionAlmacen.SelectedItem.Text
|
||||||
' Row("CvePS") = CvePS
|
' Row("CvePS") = CvePS
|
||||||
' Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
|
' Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
|
||||||
' DtSeccionAlmacen.Rows.Add(Row)
|
' DtSeccionAlmacen.Rows.Add(Row)
|
||||||
' DtSeccionAlmacen.AcceptChanges()
|
' DtSeccionAlmacen.AcceptChanges()
|
||||||
' CargaSeccionAlmacen()
|
' CargaSeccionAlmacen()
|
||||||
'End Sub
|
'End Sub
|
||||||
|
|
||||||
'Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
|
'Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
|
||||||
' Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
' Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||||
' Dim Index As Integer = 0
|
' Dim Index As Integer = 0
|
||||||
' For Each Dr As DataRow In DtSeccionAlmacen.Rows
|
' For Each Dr As DataRow In DtSeccionAlmacen.Rows
|
||||||
' If Dr("Consec").ToString.ToEntero = gvRow.DataKey("Consec").ToEntero() Then
|
' If Dr("Consec").ToString.ToEntero = gvRow.DataKey("Consec").ToEntero() Then
|
||||||
' Exit For
|
' Exit For
|
||||||
' End If
|
' End If
|
||||||
' Index += 1
|
' Index += 1
|
||||||
' Next
|
' Next
|
||||||
' DtSeccionAlmacen.Rows.RemoveAt(Index)
|
' DtSeccionAlmacen.Rows.RemoveAt(Index)
|
||||||
' DtSeccionAlmacen.AcceptChanges()
|
' DtSeccionAlmacen.AcceptChanges()
|
||||||
' CargaSeccionAlmacen()
|
' CargaSeccionAlmacen()
|
||||||
'End Sub
|
'End Sub
|
||||||
|
|
||||||
'Protected Sub LnkVerSecciones_Click(sender As Object, e As EventArgs)
|
'Protected Sub LnkVerSecciones_Click(sender As Object, e As EventArgs)
|
||||||
' If Not CveVentaSurtir > 0 Then
|
' If Not CveVentaSurtir > 0 Then
|
||||||
' Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia)
|
' Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia)
|
||||||
' Exit Sub
|
' Exit Sub
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
|
' If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
|
||||||
' Alert("Tiene que seleccionar el almacen", TipoMensaje.MsgAdvertencia)
|
' Alert("Tiene que seleccionar el almacen", TipoMensaje.MsgAdvertencia)
|
||||||
' Exit Sub
|
' Exit Sub
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' Dim ObjInv As New ClsInventarios
|
' Dim ObjInv As New ClsInventarios
|
||||||
' If ObjInv.GetExistenciaSeccionAlmacen(CveVentaSurtir, DdlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
' If ObjInv.GetExistenciaSeccionAlmacen(CveVentaSurtir, DdlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||||
' GvVerSeccionesAlmacen.DataSource = ObjInv.DtResultados
|
' GvVerSeccionesAlmacen.DataSource = ObjInv.DtResultados
|
||||||
' End If
|
' End If
|
||||||
' ObjInv.Dispose()
|
' ObjInv.Dispose()
|
||||||
' GvVerSeccionesAlmacen.DataBind()
|
' GvVerSeccionesAlmacen.DataBind()
|
||||||
' UpVerSeccionesAlmacen.Update()
|
' UpVerSeccionesAlmacen.Update()
|
||||||
' RegistraScript("$('#ModalVerSeccionesAlmacen').modal()")
|
' RegistraScript("$('#ModalVerSeccionesAlmacen').modal()")
|
||||||
'End Sub
|
'End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "DIVIDIR"
|
#Region "DIVIDIR"
|
||||||
|
|
||||||
Protected Sub Dividir(sender As Object, e As EventArgs)
|
Protected Sub Dividir(sender As Object, e As EventArgs)
|
||||||
Dim index2 As Integer = 0
|
Dim index2 As Integer = 0
|
||||||
|
|
||||||
@@ -3463,11 +3463,11 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
index2 += 1
|
index2 += 1
|
||||||
Next
|
Next
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " GUIAS - SABE QUE ES PORQUE NO VEO QUE SE UTILIZE EN ALGUNA PARTE - EN MIRAS DE ELIMINAR - IPP 24 AGOSTO 2017 "
|
#Region " GUIAS - SABE QUE ES PORQUE NO VEO QUE SE UTILIZE EN ALGUNA PARTE - EN MIRAS DE ELIMINAR - IPP 24 AGOSTO 2017 "
|
||||||
Private Sub BtnNumeroGuia_Click(sender As Object, e As EventArgs) Handles BtnNumeroGuia.Click
|
Private Sub BtnNumeroGuia_Click(sender As Object, e As EventArgs) Handles BtnNumeroGuia.Click
|
||||||
Dim Objeto As New ClsInventarios
|
Dim Objeto As New ClsInventarios
|
||||||
@@ -3501,11 +3501,11 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "SUGERENCIAS"
|
#Region "SUGERENCIAS"
|
||||||
|
|
||||||
Protected Sub BtnVerSugerencias_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnVerSugerencias_Click(sender As Object, e As EventArgs)
|
||||||
If Not CveVentaSurtir > 0 Then
|
If Not CveVentaSurtir > 0 Then
|
||||||
Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia)
|
Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia)
|
||||||
@@ -3605,12 +3605,12 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||||
|
|
||||||
ImprimirPDF("Empresas/Grales/Formatos/RepEntregaAlmacenSugerencia.rdlc", DtDatosSugerencias, params, "Equipo GPS")
|
ImprimirPDF("Empresas/Grales/Formatos/RepEntregaAlmacenSugerencia.rdlc", DtDatosSugerencias, params, "Equipo GPS")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "TipoEntrega"
|
#Region "TipoEntrega"
|
||||||
|
|
||||||
Protected Sub EntregaRadioGroup_Click(sender As Object, e As EventArgs)
|
Protected Sub EntregaRadioGroup_Click(sender As Object, e As EventArgs)
|
||||||
If RbEntregaExterna.Checked Then
|
If RbEntregaExterna.Checked Then
|
||||||
RegistraScript("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx',800,547,'N')")
|
RegistraScript("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx',800,547,'N')")
|
||||||
@@ -3630,8 +3630,8 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
TxtNoCajas.Text = ""
|
TxtNoCajas.Text = ""
|
||||||
TxtObservacionesPaqInterna.Text = ""
|
TxtObservacionesPaqInterna.Text = ""
|
||||||
UpPaqInterna.Update()
|
UpPaqInterna.Update()
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -850,7 +850,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
TipoCambio = ObjCompras.DtResultados.Rows(0)("TipoCambio").ToString.ToDecimal
|
TipoCambio = ObjCompras.DtResultados.Rows(0)("TipoCambio").ToString.ToDecimal
|
||||||
TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("EstatusAlmacen").ToString.ToEntero = 1, 2, 1)
|
TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("EstatusAlmacen").ToString.ToEntero = 1, 2, 1)
|
||||||
TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("TipoDocto").ToString.Contiene("NC", "DEV"), 3, TipoMovimiento)
|
TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("TipoDocto").ToString.Contiene("NC", "DEV"), 3, TipoMovimiento)
|
||||||
TotalCompraOC = ObjCompras.DtResultados.Rows(0)("SubTotal").ToString.ToDecimal
|
TotalCompraOC = ObjCompras.DtResultados.Rows(0)("SubTotal").ToString.ToDecimal - ObjCompras.DtResultados.Rows(0)("Descuentos").ToString.ToDecimal
|
||||||
CveTipoCompra = ObjCompras.DtResultados.Rows(0)("CveTipoCompra").ToString.ToEntero
|
CveTipoCompra = ObjCompras.DtResultados.Rows(0)("CveTipoCompra").ToString.ToEntero
|
||||||
|
|
||||||
If TipoMovimiento = 3 Then
|
If TipoMovimiento = 3 Then
|
||||||
@@ -1259,6 +1259,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero
|
e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero
|
||||||
e.Row.FCTextBox("TbCantidadF").Enabled = False
|
e.Row.FCTextBox("TbCantidadF").Enabled = False
|
||||||
End If
|
End If
|
||||||
|
If UsuarioActual.CveRol = 1 Then 'carga la cantidad con el rol AD
|
||||||
|
e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CBool(e.Row.DBCampo("AplicaSeccion")) Then
|
If CBool(e.Row.DBCampo("AplicaSeccion")) Then
|
||||||
@@ -2155,6 +2158,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Private Sub GuardaCompraOC()
|
Private Sub GuardaCompraOC()
|
||||||
|
|
||||||
Dim CveMovimiento As Integer
|
Dim CveMovimiento As Integer
|
||||||
|
Dim CveMovimientoOriginal As Integer
|
||||||
' Dim CveMovimientoS
|
' Dim CveMovimientoS
|
||||||
|
|
||||||
Dim InvFolio As String = ""
|
Dim InvFolio As String = ""
|
||||||
@@ -2203,6 +2207,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio),
|
CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio),
|
||||||
MovimientoFijo:=If(TipoMovimiento = 2, True, False), Remision:=TxtRemision.Text, Modulo:="RA/G1")
|
MovimientoFijo:=If(TipoMovimiento = 2, True, False), Remision:=TxtRemision.Text, Modulo:="RA/G1")
|
||||||
If CveMovimiento > 0 Then
|
If CveMovimiento > 0 Then
|
||||||
|
CveMovimientoOriginal = CveMovimiento
|
||||||
InvFolio = ObjInventario.Folio.ToString
|
InvFolio = ObjInventario.Folio.ToString
|
||||||
Dim DtDetalle As New DataTable
|
Dim DtDetalle As New DataTable
|
||||||
Dim DtDetalleLote As New DataTable
|
Dim DtDetalleLote As New DataTable
|
||||||
@@ -2283,7 +2288,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
''VALIDACIÓN DE IMPORTES INGRESADOS VS LA COMPRA U OC
|
''VALIDACIÓN DE IMPORTES INGRESADOS VS LA COMPRA U OC
|
||||||
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
If Not ErrorMovInv AndAlso RecibidaCompleta AndAlso ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
If Not ErrorMovInv AndAlso RecibidaCompleta AndAlso ObjInventario.GetMovimientosDetalle(CveMovimientoOriginal, UsuarioActual.CveEmpresa) Then
|
||||||
Dim dtt As DataTable = ObjInventario.DtResultados
|
Dim dtt As DataTable = ObjInventario.DtResultados
|
||||||
Dim tTotalInsertado As Decimal = dtt.SUMD("TotalOriginal")
|
Dim tTotalInsertado As Decimal = dtt.SUMD("TotalOriginal")
|
||||||
If CveTipoCompra = 8 Then 'entrada almacen con costo indirecto cargado en la misma compra
|
If CveTipoCompra = 8 Then 'entrada almacen con costo indirecto cargado en la misma compra
|
||||||
@@ -2297,6 +2302,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim ImporteIngresoAdicional As Decimal = 0
|
||||||
|
|
||||||
'SI RECEPCION VALIDA [ENTREGADIRECTA, APARTADOS, AC]
|
'SI RECEPCION VALIDA [ENTREGADIRECTA, APARTADOS, AC]
|
||||||
If TipoMovimiento = 1 Then
|
If TipoMovimiento = 1 Then
|
||||||
'ENTREGA DIRECTA
|
'ENTREGA DIRECTA
|
||||||
@@ -2410,45 +2417,11 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||||
|
|
||||||
Dim DtPSVirtual As New DataTable("DtTamanios")
|
Dim DtPSVirtual As New DataTable("DtTamanios")
|
||||||
DtPSVirtual.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
|
|
||||||
DtPSVirtual.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
|
|
||||||
DtPSVirtual.Columns.Add(New DataColumn("PU", GetType(Decimal)))
|
|
||||||
DtPSVirtual.Columns.Add(New DataColumn("CveUM", GetType(Integer)))
|
|
||||||
|
|
||||||
Dim DtComprasDetalle As DataTable = Nothing
|
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||||
Dim DtTamanios As DataTable = Nothing
|
DtPSVirtual = ObjInventario.DtResultados
|
||||||
|
|
||||||
If ObjCompras.GetCompraDetalle(CveCompraSurtir) Then
|
|
||||||
DtComprasDetalle = ObjCompras.DtResultados.Copy()
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
|
|
||||||
DtTamanios = ObjAcum.DtResultados.Copy()
|
|
||||||
End If
|
|
||||||
|
|
||||||
For Each GvRow As GridViewRow In GvInv.Rows
|
|
||||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
|
||||||
|
|
||||||
For Each Tam As DataRow In DtTamanios.Rows
|
|
||||||
If Tam("CveTamaño").ToString() = GvRow.DataKey("CveTamaño") Then
|
|
||||||
Dim CvePSCargo = Tam("CvePSCargo").ToString().ToEntero()
|
|
||||||
Dim RowCompraDetalle = DtComprasDetalle.FiltroPrimero($"CvePS = {CvePSCargo}")
|
|
||||||
|
|
||||||
If RowCompraDetalle IsNot Nothing Then
|
|
||||||
Dim Row As DataRow = DtPSVirtual.NewRow()
|
|
||||||
Row("CvePS") = CvePSCargo
|
|
||||||
Row("Cantidad") = GvRow.FCTextBox("TbCantidadF").Text.ToDecimal()
|
|
||||||
Row("PU") = RowCompraDetalle("PU").ToString().ToDecimal()
|
|
||||||
Row("CveUM") = GvRow.DataKey("CveUM").ToEntero()
|
|
||||||
DtPSVirtual.Rows.Add(Row)
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then
|
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then
|
||||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero()
|
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero()
|
||||||
|
|
||||||
@@ -2461,8 +2434,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||||
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
|
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||||
Dim PU As Decimal = RowUsado("PU").ToString().ToDecimal()
|
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
|
||||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||||
@@ -2470,6 +2443,12 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
|
||||||
|
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -2549,8 +2528,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'VIRTUAL
|
'VIRTUAL
|
||||||
If CveTipoCompra = 9 And UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
If CveTipoCompra = 9 And UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||||
|
|
||||||
@@ -2618,6 +2595,27 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
''VALIDACIÓN DE IMPORTES INGRESADOS VS LA COMPRA U OC
|
||||||
|
'If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
|
If Not ErrorMovInv AndAlso RecibidaCompleta Then
|
||||||
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoOriginal, UsuarioActual.CveEmpresa) Then
|
||||||
|
Dim dtt As DataTable = ObjInventario.DtResultados
|
||||||
|
Dim tTotalInsertado As Decimal = dtt.SUMD("TotalOriginal") + ImporteIngresoAdicional
|
||||||
|
If CveTipoCompra = 8 Then 'entrada almacen con costo indirecto cargado en la misma compra
|
||||||
|
tTotalInsertado = dtt.SUMD("Total") ' está incluido el costo indirecto en la factura
|
||||||
|
End If
|
||||||
|
If Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) <> Math.Round(tTotalInsertado, 2) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
Alert("La Entrada no coincide con el valor del documento." & Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) & " -" & tTotalInsertado.RoundSQL.ToString, TipoMensaje.MsgError)
|
||||||
|
GuardaLog("La Entrada no coincide con el valor del documento." & Math.Round(TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1), 2) & " -" & tTotalInsertado.RoundSQL.ToString)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
' End If
|
||||||
|
|
||||||
'ACTUALIZA ESTATUS ALMACEN
|
'ACTUALIZA ESTATUS ALMACEN
|
||||||
If TipoMovimiento = 2 Then
|
If TipoMovimiento = 2 Then
|
||||||
If Not ObjCompras.UpdateEstatusAlmacen(CveCompraSurtir, 0) Then
|
If Not ObjCompras.UpdateEstatusAlmacen(CveCompraSurtir, 0) Then
|
||||||
@@ -2631,212 +2629,212 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'PREPOLIZA - SOLO CUANDO SEA RECEPCIÓN
|
'PREPOLIZA - SOLO CUANDO SEA RECEPCIÓN
|
||||||
If TipoMovimiento = 1 AndAlso ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
If TipoMovimiento = 1 AndAlso Not ErrorMovInv Then
|
||||||
Dim DtCostos As DataTable = Nothing
|
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||||
Dim ValorInventario As Decimal = 0
|
|
||||||
DtCostos = ObjInventario.DtResultados
|
|
||||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
|
|
||||||
Dim TotalCostoExtranjero As Decimal = DtCostos.SUM("TotalExtranjero").ToDecimal
|
|
||||||
|
|
||||||
'VARIABLES
|
Dim DtCostos As DataTable = Nothing
|
||||||
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
|
Dim ValorInventario As Decimal = 0
|
||||||
Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
|
DtCostos = ObjInventario.DtResultados
|
||||||
Dim IdCtaContableRecepcion = -1
|
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
|
||||||
Dim IdCtaContableRecepcionME = -1
|
Dim TotalCostoExtranjero As Decimal = DtCostos.SUM("TotalExtranjero").ToDecimal
|
||||||
Dim IdCtaContableRecepcionComplementaria = -1
|
|
||||||
Dim Fecha As Date = Now
|
|
||||||
Dim CveProveedor As Integer = -1
|
|
||||||
Dim ProveedorNombre As String = ""
|
|
||||||
Dim SerieFolio As String = ""
|
|
||||||
Dim CveConceptoContableCosto = -1
|
|
||||||
Dim CveConceptoContableCostoME = -1
|
|
||||||
Dim CveConceptoContableCostoComplementaria = -1
|
|
||||||
Dim UsaComplementariaFleteImportaciones As Boolean = False
|
|
||||||
If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = False
|
|
||||||
|
|
||||||
If DtCostos.Rows.Count > 0 Then
|
'VARIABLES
|
||||||
If CveCompraSurtir > 0 Then
|
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
|
||||||
If ObjCompras.GetCompras(CveCompraSurtir, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then
|
Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
|
||||||
'Fecha = ObjCompras.DtResultados(0)("Fecha").ToString.ToDate
|
Dim IdCtaContableRecepcion = -1
|
||||||
Fecha = TxtFecha.Text.ToDate
|
Dim IdCtaContableRecepcionME = -1
|
||||||
CveProveedor = ObjCompras.DtResultados(0)("CveProveedor").ToString.ToEntero
|
Dim IdCtaContableRecepcionComplementaria = -1
|
||||||
ProveedorNombre = ObjCompras.DtResultados(0)("RazonSocial").ToString
|
Dim Fecha As Date = Now
|
||||||
SerieFolio = $"Compra: {ObjCompras.DtResultados(0)("SerieFolio").ToString}"
|
Dim CveProveedor As Integer = -1
|
||||||
CveConceptoContableCosto = 205
|
Dim ProveedorNombre As String = ""
|
||||||
CveConceptoContableCostoME = 230
|
Dim SerieFolio As String = ""
|
||||||
CveConceptoContableCostoComplementaria = 231
|
Dim CveConceptoContableCosto = -1
|
||||||
|
Dim CveConceptoContableCostoME = -1
|
||||||
|
Dim CveConceptoContableCostoComplementaria = -1
|
||||||
|
Dim UsaComplementariaFleteImportaciones As Boolean = False
|
||||||
|
If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = False
|
||||||
|
|
||||||
If ObjConta.GetRetCuenta(205, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
If DtCostos.Rows.Count > 0 Then
|
||||||
IdCtaContableRecepcion = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
If CveCompraSurtir > 0 Then
|
||||||
|
If ObjCompras.GetCompras(CveCompraSurtir, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then
|
||||||
|
'Fecha = ObjCompras.DtResultados(0)("Fecha").ToString.ToDate
|
||||||
|
Fecha = TxtFecha.Text.ToDate
|
||||||
|
CveProveedor = ObjCompras.DtResultados(0)("CveProveedor").ToString.ToEntero
|
||||||
|
ProveedorNombre = ObjCompras.DtResultados(0)("RazonSocial").ToString
|
||||||
|
SerieFolio = $"Compra: {ObjCompras.DtResultados(0)("SerieFolio").ToString}"
|
||||||
|
CveConceptoContableCosto = 205
|
||||||
|
CveConceptoContableCostoME = 230
|
||||||
|
CveConceptoContableCostoComplementaria = 231
|
||||||
|
|
||||||
|
If ObjConta.GetRetCuenta(205, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||||
|
IdCtaContableRecepcion = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(230, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||||
|
IdCtaContableRecepcionME = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(231, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||||
|
IdCtaContableRecepcionComplementaria = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
|
ElseIf CveOCSurtir > 0 Then
|
||||||
|
If ObjOC.GetOC(CveOCSurtir, UsuarioActual.CveEmpresa) Then
|
||||||
|
'Fecha = ObjOC.DtResultados(0)("Fecha").ToString.ToDate
|
||||||
|
Fecha = TxtFecha.Text.ToDate
|
||||||
|
CveProveedor = ObjOC.DtResultados(0)("CveProveedor").ToString.ToEntero
|
||||||
|
ProveedorNombre = ObjOC.DtResultados(0)("RazonSocial").ToString
|
||||||
|
SerieFolio = String.Format("{0} OC# {1} - Almacén# {2}", ProveedorNombre, ObjOC.DtResultados(0)("Folio"), ObjInventario.Folio)
|
||||||
|
CveConceptoContableCosto = 176
|
||||||
|
CveConceptoContableCostoME = 228
|
||||||
|
CveConceptoContableCostoComplementaria = 229
|
||||||
|
|
||||||
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(230, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = True
|
||||||
IdCtaContableRecepcionME = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
|
||||||
|
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(176, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||||
|
IdCtaContableRecepcion = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(228, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||||
|
IdCtaContableRecepcionME = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(229, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||||
|
IdCtaContableRecepcionComplementaria = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(231, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
|
||||||
IdCtaContableRecepcionComplementaria = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
End If
|
||||||
ElseIf CveOCSurtir > 0 Then
|
|
||||||
If ObjOC.GetOC(CveOCSurtir, UsuarioActual.CveEmpresa) Then
|
|
||||||
'Fecha = ObjOC.DtResultados(0)("Fecha").ToString.ToDate
|
|
||||||
Fecha = TxtFecha.Text.ToDate
|
|
||||||
CveProveedor = ObjOC.DtResultados(0)("CveProveedor").ToString.ToEntero
|
|
||||||
ProveedorNombre = ObjOC.DtResultados(0)("RazonSocial").ToString
|
|
||||||
SerieFolio = String.Format("{0} OC# {1} - Almacén# {2}", ProveedorNombre, ObjOC.DtResultados(0)("Folio"), ObjInventario.Folio)
|
|
||||||
CveConceptoContableCosto = 176
|
|
||||||
CveConceptoContableCostoME = 228
|
|
||||||
CveConceptoContableCostoComplementaria = 229
|
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = True
|
If Not ErrorMovInv Then
|
||||||
|
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero
|
||||||
|
CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen", 74, TotalCosto, TotalCosto, 1, Fecha, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
If CvePrePoliza > 0 Then
|
||||||
|
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveSubProyecto:=CveSubProyecto, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=CveCuentaAlmacen) Then
|
||||||
|
|
||||||
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(176, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
'AGREGA POR CONCEPTO POR CVEOCDETALLE
|
||||||
IdCtaContableRecepcion = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
If CveOCSurtir > 0 Then
|
||||||
End If
|
Dim TotalCostoDetalle As Decimal = 0
|
||||||
|
Dim TotalCostoAcumulado As Decimal = 0
|
||||||
|
Dim cont As Integer = 1
|
||||||
|
For Each Dr As DataRow In DtCostos.Rows
|
||||||
|
TotalCostoDetalle = (Dr("Total").ToString.ToDecimal)
|
||||||
|
TotalCostoExtranjero = Dr("TotalExtranjero").ToString.ToDecimal
|
||||||
|
TotalCostoAcumulado += Math.Round(TotalCostoDetalle, 2)
|
||||||
|
|
||||||
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(228, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
'si es el último movimiento verifica los importes que sean igual
|
||||||
IdCtaContableRecepcionME = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
If cont = DtCostos.Rows.Count AndAlso (Math.Round(TotalCosto, 2) <> Math.Round(TotalCostoAcumulado, 2)) Then
|
||||||
End If
|
TotalCostoDetalle = TotalCostoDetalle + (Math.Round(TotalCosto, 2) - Math.Round(TotalCostoAcumulado, 2))
|
||||||
|
TotalCostoExtranjero = TotalCostoExtranjero + (Math.Round(TotalCosto, 2) - Math.Round(TotalCostoAcumulado, 2))
|
||||||
|
End If
|
||||||
|
|
||||||
If UsaComplementariaFleteImportaciones AndAlso ObjConta.GetRetCuenta(229, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
If CveMoneda <> 1 AndAlso UsaComplementariaFleteImportaciones Then
|
||||||
IdCtaContableRecepcionComplementaria = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero
|
'COMPLEMENTARIA
|
||||||
End If
|
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoME, SerieFolio, Fecha, IdCtaContableRecepcionME, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveSubProyecto:=CveSubProyecto, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||||
Else
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoDetalle - TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoComplementaria, SerieFolio, Fecha, IdCtaContableRecepcionComplementaria, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveSubProyecto:=CveSubProyecto, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoDetalle - TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
If Not ErrorMovInv Then
|
|
||||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero
|
|
||||||
CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen", 74, TotalCosto, TotalCosto, 1, Fecha, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
||||||
If CvePrePoliza > 0 Then
|
|
||||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveSubProyecto:=CveSubProyecto, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=CveCuentaAlmacen) Then
|
|
||||||
|
|
||||||
'AGREGA POR CONCEPTO POR CVEOCDETALLE
|
|
||||||
If CveOCSurtir > 0 Then
|
|
||||||
Dim TotalCostoDetalle As Decimal = 0
|
|
||||||
Dim TotalCostoAcumulado As Decimal = 0
|
|
||||||
Dim cont As Integer = 1
|
|
||||||
For Each Dr As DataRow In DtCostos.Rows
|
|
||||||
TotalCostoDetalle = (Dr("Total").ToString.ToDecimal)
|
|
||||||
TotalCostoExtranjero = Dr("TotalExtranjero").ToString.ToDecimal
|
|
||||||
TotalCostoAcumulado += Math.Round(TotalCostoDetalle, 2)
|
|
||||||
|
|
||||||
'si es el último movimiento verifica los importes que sean igual
|
|
||||||
If cont = DtCostos.Rows.Count AndAlso (Math.Round(TotalCosto, 2) <> Math.Round(TotalCostoAcumulado, 2)) Then
|
|
||||||
TotalCostoDetalle = TotalCostoDetalle + (Math.Round(TotalCosto, 2) - Math.Round(TotalCostoAcumulado, 2))
|
|
||||||
TotalCostoExtranjero = TotalCostoExtranjero + (Math.Round(TotalCosto, 2) - Math.Round(TotalCostoAcumulado, 2))
|
|
||||||
End If
|
|
||||||
|
|
||||||
If CveMoneda <> 1 AndAlso UsaComplementariaFleteImportaciones Then
|
|
||||||
'COMPLEMENTARIA
|
|
||||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoME, SerieFolio, Fecha, IdCtaContableRecepcionME, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveSubProyecto:=CveSubProyecto, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoDetalle - TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoComplementaria, SerieFolio, Fecha, IdCtaContableRecepcionComplementaria, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveSubProyecto:=CveSubProyecto, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoDetalle - TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
ErrorMovInv = True
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoDetalle, SerieFolio, CveConceptoContableCosto, SerieFolio, Fecha, IdCtaContableRecepcion, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveSubProyecto:=CveSubProyecto, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoDetalle, CveCuenta:=-1, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||||
Exit For
|
ErrorMovInv = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Else
|
cont = cont + 1
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoDetalle, SerieFolio, CveConceptoContableCosto, SerieFolio, Fecha, IdCtaContableRecepcion, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveSubProyecto:=CveSubProyecto, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoDetalle, CveCuenta:=-1, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
|
||||||
ErrorMovInv = True
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
cont = cont + 1
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
Else
|
|
||||||
TotalCosto = DtCostos.SUMD("Total").RoundSQL
|
|
||||||
TotalCostoExtranjero = DtCostos.SUMD("TotalExtranjero")
|
|
||||||
|
|
||||||
If CveMoneda <> 1 AndAlso UsaComplementariaFleteImportaciones Then
|
|
||||||
'COMPLEMENTARIA
|
|
||||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoME, SerieFolio, Fecha, IdCtaContableRecepcionME, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal) Then
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto - TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoComplementaria, SerieFolio, Fecha, IdCtaContableRecepcionComplementaria, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto - TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal) Then
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
|
||||||
Else
|
Else
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto, SerieFolio, CveConceptoContableCosto, SerieFolio, Fecha, IdCtaContableRecepcion, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=-1) Then
|
TotalCosto = DtCostos.SUMD("Total").RoundSQL
|
||||||
ErrorMovInv = True
|
TotalCostoExtranjero = DtCostos.SUMD("TotalExtranjero")
|
||||||
|
|
||||||
|
If CveMoneda <> 1 AndAlso UsaComplementariaFleteImportaciones Then
|
||||||
|
'COMPLEMENTARIA
|
||||||
|
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoME, SerieFolio, Fecha, IdCtaContableRecepcionME, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal) Then
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto - TotalCostoExtranjero, SerieFolio, CveConceptoContableCostoComplementaria, SerieFolio, Fecha, IdCtaContableRecepcionComplementaria, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto - TotalCostoExtranjero, ImporteME:=TotalCostoExtranjero, TipoCambio:=TipoCambio.ToDecimal) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto, SerieFolio, CveConceptoContableCosto, SerieFolio, Fecha, IdCtaContableRecepcion, -1, CveCompra:=CveCompraSurtir, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=-1) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
|
||||||
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
|
||||||
MensajeError = "El Movimiento presenta una diferencia en el registro."
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'CONTABILIZAR - UNIFICAR Y SIMPLIFICAR CON PP DE LA COMPRA
|
|
||||||
If Not ErrorMovInv Then
|
|
||||||
|
|
||||||
If CvePrePolizaCompra > 0 Then
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then
|
|
||||||
If Not ObjConta.PrePolizaUnificacion(CvePrePoliza, CvePrePolizaCompra) Then
|
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
MensajeError = "Error al unificar los conceptos contables"
|
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
|
|
||||||
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
|
||||||
ErrorMovInv = True
|
|
||||||
MensajeError = "Error al simplificar los conceptos contables"
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
|
||||||
If ObjContaContPAQ Is Nothing Then
|
|
||||||
ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa)
|
|
||||||
ObjContaContPAQ.IniciaTransacSQL()
|
|
||||||
End If
|
|
||||||
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then
|
|
||||||
MensajeContabilidad = $"<br>Movimiento contabilizado en el folio: <b><a class='Texto' href = '/Contabilidad/RegPoliza.aspx?IdPoliza={ObjConta.ContaIdPoliza}'>{ObjConta.ContaFolio}</a></b><br>"
|
|
||||||
Else
|
Else
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
MensajeError = "Error al contabilizar los conceptos contables"
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
||||||
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
|
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||||
|
MensajeError = "El Movimiento presenta una diferencia en el registro."
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
'CONTABILIZAR - UNIFICAR Y SIMPLIFICAR CON PP DE LA COMPRA
|
||||||
|
If Not ErrorMovInv Then
|
||||||
|
|
||||||
|
If CvePrePolizaCompra > 0 Then
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(219) = "1" Then
|
||||||
|
If Not ObjConta.PrePolizaUnificacion(CvePrePoliza, CvePrePolizaCompra) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
MensajeError = "Error al unificar los conceptos contables"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
|
||||||
|
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
MensajeError = "Error al simplificar los conceptos contables"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||||
|
If ObjContaContPAQ Is Nothing Then
|
||||||
|
ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
|
ObjContaContPAQ.IniciaTransacSQL()
|
||||||
|
End If
|
||||||
|
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then
|
||||||
|
MensajeContabilidad = $"<br>Movimiento contabilizado en el folio: <b><a class='Texto' href = '/Contabilidad/RegPoliza.aspx?IdPoliza={ObjConta.ContaIdPoliza}'>{ObjConta.ContaFolio}</a></b><br>"
|
||||||
|
Else
|
||||||
|
ErrorMovInv = True
|
||||||
|
MensajeError = "Error al contabilizar los conceptos contables"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
ErrorMovInv = True
|
||||||
|
MensajeError = "Error al obtener movimientos"
|
||||||
End If
|
End If
|
||||||
Else
|
|
||||||
ErrorMovInv = True
|
|
||||||
MensajeError = "Error al obtener movimientos"
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'PREPOLIZA - NC
|
'PREPOLIZA - NC
|
||||||
If TipoMovimiento = 3 Then
|
If TipoMovimiento = 3 AndAlso Not ErrorMovInv Then
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim DtCostos As DataTable = Nothing
|
Dim DtCostos As DataTable = Nothing
|
||||||
DtCostos = ObjInventario.DtResultados
|
DtCostos = ObjInventario.DtResultados
|
||||||
Dim TotalCosto As Decimal = DtCostos.SUM("Total").ToDecimal
|
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
|
||||||
|
|
||||||
Dim TotalNC As Decimal = 0
|
Dim TotalNC As Decimal = 0
|
||||||
Dim CveClasificacionDifCostoNC = -1
|
Dim CveClasificacionDifCostoNC = -1
|
||||||
@@ -2850,11 +2848,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim IdCtaContableClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero
|
Dim IdCtaContableClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero
|
||||||
Dim CveCuentaClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero
|
Dim CveCuentaClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero
|
||||||
|
|
||||||
TotalCosto = Math.Round(TotalCosto, 2)
|
TotalNC = TotalNC.RoundSQL
|
||||||
TotalNC = Math.Round(TotalNC, 2)
|
|
||||||
Dim DifCostoNC = Math.Round(TotalCosto - TotalNC, 2)
|
Dim DifCostoNC = Math.Round(TotalCosto - TotalNC, 2)
|
||||||
|
|
||||||
|
|
||||||
'VARIABLES
|
'VARIABLES
|
||||||
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
|
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
|
||||||
Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
|
Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero
|
||||||
|
|||||||
@@ -653,13 +653,33 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim DrAlmO, DrAlmD As DataRow
|
||||||
|
Dim CveSucursalOrigen, CveSucursalDestino As Integer
|
||||||
|
Dim TipoAlmacenOrigen, TipoAlmacenDestino As Integer
|
||||||
|
Dim CveSubProyectoOrigen, CveSubProyectoDestino As Integer
|
||||||
|
Dim IdCtaContableOrigen, IdCtaContableDestino As Integer
|
||||||
|
|
||||||
|
DrAlmO = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero).FiltroPrimero("")
|
||||||
|
DrAlmD = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenDestino.SelectedValue.ToEntero).FiltroPrimero("")
|
||||||
|
|
||||||
|
If DrAlmO IsNot Nothing AndAlso DrAlmD IsNot Nothing Then
|
||||||
|
CveSucursalOrigen = DrAlmO("CveSubProyecto").ToString.ToEntero
|
||||||
|
TipoAlmacenOrigen = DrAlmO("CveTipoAlmacen").ToString.ToEntero
|
||||||
|
CveSubProyectoOrigen = DrAlmO("CveSubProyecto").ToString.ToEntero
|
||||||
|
IdCtaContableOrigen = DrAlmO("IdCtaContable").ToString.ToEntero
|
||||||
|
|
||||||
|
CveSucursalDestino = DrAlmD("CveSubProyecto").ToString.ToEntero
|
||||||
|
TipoAlmacenDestino = DrAlmD("CveTipoAlmacen").ToString.ToEntero
|
||||||
|
CveSubProyectoDestino = DrAlmD("CveSubProyecto").ToString.ToEntero
|
||||||
|
IdCtaContableDestino = DrAlmO("IdCtaContable").ToString.ToEntero
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
'VALIDA ALMACEN DISTINTA SUCURSAL DEBE SER TRANSITORIO
|
'VALIDA ALMACEN DISTINTA SUCURSAL DEBE SER TRANSITORIO
|
||||||
If Not UsuarioActual.CveEmpresa.Contiene(7, 140) Then '[IPP] EMPRESA VIGILANCIA NO OCUPA TRANSITORIOS - TIENEN MIL SUCURSALES Xd
|
If Not UsuarioActual.CveEmpresa.Contiene(7, 140) Then '[IPP] EMPRESA VIGILANCIA NO OCUPA TRANSITORIOS - TIENEN MIL SUCURSALES Xd
|
||||||
If Not ChkTransitorio.Checked Then
|
If Not ChkTransitorio.Checked Then
|
||||||
Dim CveSucursalOrigen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue.ToEntero}")
|
|
||||||
Dim CveSucursalDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}")
|
|
||||||
|
|
||||||
If Not GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").Contiene("21", "26") Then 'NO SE VALIDA CUANDO EL TIPO DE ALMACEN DESTINO ES DE DEVOLUCION
|
If Not TipoAlmacenDestino.Contiene(21, 26) Then 'NO SE VALIDA CUANDO EL TIPO DE ALMACEN DESTINO ES DE DEVOLUCION
|
||||||
If CveSucursalOrigen <> CveSucursalDestino Then
|
If CveSucursalOrigen <> CveSucursalDestino Then
|
||||||
Alert("Por ser un traspaso entre sucursales es necesario indicar que el traspaso es transitorio.", TipoMensaje.MsgAdvertencia)
|
Alert("Por ser un traspaso entre sucursales es necesario indicar que el traspaso es transitorio.", TipoMensaje.MsgAdvertencia)
|
||||||
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'');", "SonidoError")
|
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'');", "SonidoError")
|
||||||
@@ -757,9 +777,6 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
|
|
||||||
Dim TotalCantidad As Decimal = DtMovimientos.SUMD("Cantidad")
|
Dim TotalCantidad As Decimal = DtMovimientos.SUMD("Cantidad")
|
||||||
|
|
||||||
Dim TipoAlmacenOrigen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue.ToEntero}").ToEntero
|
|
||||||
Dim TipoAlmacenDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").ToEntero
|
|
||||||
|
|
||||||
''[IPP-1Noviembre2018] SE COMENTA PORQUE NO TIENE NI PIES NI CABEZA. LE FALTA DESARROLLO
|
''[IPP-1Noviembre2018] SE COMENTA PORQUE NO TIENE NI PIES NI CABEZA. LE FALTA DESARROLLO
|
||||||
'If (TipoAlmacenOrigen = 14 Or TipoAlmacenDestino = 14) And TipoAlmacenOrigen <> TipoAlmacenDestino Then
|
'If (TipoAlmacenOrigen = 14 Or TipoAlmacenDestino = 14) And TipoAlmacenOrigen <> TipoAlmacenDestino Then
|
||||||
' ObjInventario.Dispose()
|
' ObjInventario.Dispose()
|
||||||
@@ -813,9 +830,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
'VIRTUAL SALIDA
|
'VIRTUAL SALIDA
|
||||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||||
|
|
||||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenOrigen.SelectedValue}").ToEntero()
|
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenOrigen.SelectedValue}").ToEntero()
|
||||||
|
|
||||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
|
||||||
|
|
||||||
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtual, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V", CveMovimientoRelacionado:=CveMovimientoSalida)
|
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtual, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V", CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||||
FolioVirtualSalida = ObjInventario.Folio
|
FolioVirtualSalida = ObjInventario.Folio
|
||||||
@@ -845,7 +862,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
Dim TipoMovimientoEntrada = 27
|
Dim TipoMovimientoEntrada = 27
|
||||||
AlmacenEntrada = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
|
AlmacenEntrada = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
|
||||||
|
|
||||||
Dim TipoAlmacenEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {AlmacenEntrada}").ToEntero()
|
'Dim TipoAlmacenEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {AlmacenEntrada}").ToEntero()
|
||||||
|
|
||||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
|
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
|
||||||
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
|
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
|
||||||
@@ -858,7 +875,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||||
Dim Cont As Integer = 0
|
Dim Cont As Integer = 0
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
Dim CostoEntrada As Decimal = If(TipoAlmacenEntrada = 26, 0, Dr("PU").ToString.ToDecimal())
|
Dim CostoEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, Dr("PU").ToString.ToDecimal())
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=-1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=-1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||||
@@ -870,9 +887,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
End If
|
End If
|
||||||
'VIRTUAL ENTRADA
|
'VIRTUAL ENTRADA
|
||||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenDestino.SelectedValue}").ToEntero()
|
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenDestino.SelectedValue}").ToEntero()
|
||||||
|
|
||||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyectoDestino }").ToEntero()
|
||||||
|
|
||||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/S3")
|
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/S3")
|
||||||
FolioVirtualEntrada = ObjInventario.Folio
|
FolioVirtualEntrada = ObjInventario.Folio
|
||||||
@@ -904,17 +921,33 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
|
|
||||||
Dim resultado As DataTable = ObjInventario.DtResultados
|
Dim resultado As DataTable = ObjInventario.DtResultados
|
||||||
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
||||||
Dim IdCtaContableSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue.ToEntero)).ToEntero
|
'Dim IdCtaContableSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue.ToEntero)).ToEntero
|
||||||
Dim IdCtaContableEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenDestino.SelectedValue.ToEntero)).ToEntero
|
'Dim IdCtaContableEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenDestino.SelectedValue.ToEntero)).ToEntero
|
||||||
Dim Contabilizable As Boolean = True
|
Dim Contabilizable As Boolean = True
|
||||||
|
|
||||||
If IdCtaContableSalida = IdCtaContableEntrada Then Contabilizable = False
|
If IdCtaContableOrigen = IdCtaContableDestino And TipoAlmacenDestino <> 26 Then Contabilizable = False
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableSalida, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableEntrada, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
'si el tipo de almacen de entrada es Almacen sin costo, se registra al costo, la salida.
|
||||||
|
If TipoAlmacenOrigen <> 26 AndAlso TipoAlmacenDestino = 26 Then
|
||||||
|
|
||||||
|
Dim tCveClasificacion As Integer = DtMovimientos.MAX("CveClasificacion").ToEntero
|
||||||
|
Dim dr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=tCveClasificacion).FiltroPrimero("")
|
||||||
|
Dim IdCuentaCostos As Integer = -1
|
||||||
|
If dr IsNot Nothing Then
|
||||||
|
IdCuentaCostos = dr("IdCuentaCostos").ToString.ToEntero
|
||||||
|
End If
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importe, TxtObservaciones.Text, 69, TxtObservaciones.Text, Fecha, IdCuentaCostos, -1, CveClasificacion:=tCveClasificacion, CveSubProyecto:=CveSubProyectoOrigen, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=-importe) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
Contabilizable = False
|
||||||
|
importe = 0
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableDestino, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -1083,6 +1116,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
Mensaje.AppendFormat("<br/> Folio: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioMov, CveMovimiento)
|
Mensaje.AppendFormat("<br/> Folio: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioMov, CveMovimiento)
|
||||||
|
|
||||||
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
|
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
|
||||||
|
Mensaje.Clear()
|
||||||
|
|
||||||
LimpiaMovimiento()
|
LimpiaMovimiento()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user