option explicit
This commit is contained in:
@@ -740,7 +740,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim ObjInventarios As New ClsInventarios
|
Dim ObjInventarios As New ClsInventarios
|
||||||
If ddlProveedor.SelectedValue.ToEntero > 0 Then
|
If ddlProveedor.SelectedValue.ToEntero > 0 Then
|
||||||
If ObjInventarios.ComprasPendientesAlmacenGet(ddlProveedor.SelectedValue.ToEntero, MinFecha.ToShortDateString.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
If ObjInventarios.ComprasPendientesAlmacenGet(ddlProveedor.SelectedValue.ToEntero, MinFecha.ToShortDateString.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||||
Dim FiltroTemporal = " AND TipoDocto IN ('Fac','NC','DEV')"
|
Dim FiltroTemporal As String = " AND TipoDocto IN ('Fac','NC','DEV')"
|
||||||
DdlFolio.DataSource = ObjInventarios.DtResultados.FiltraParametros($"CantOC >= 0 {FiltroTemporal}")
|
DdlFolio.DataSource = ObjInventarios.DtResultados.FiltraParametros($"CantOC >= 0 {FiltroTemporal}")
|
||||||
Else
|
Else
|
||||||
Alert("Ocurrió un error al obtener las Compras pendientes de recibir del proveedor. Por favor vuelva a intentar", TipoMensaje.MsgError)
|
Alert("Ocurrió un error al obtener las Compras pendientes de recibir del proveedor. Por favor vuelva a intentar", TipoMensaje.MsgError)
|
||||||
@@ -1033,8 +1033,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
If ObjInventario.RecepcionAlmacenGet(pCveCompra, BuscaEntregaDirecta, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
If ObjInventario.RecepcionAlmacenGet(pCveCompra, BuscaEntregaDirecta, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||||
Dim DtRecepcion As DataTable = ObjInventario.DtResultados.Copy()
|
Dim DtRecepcion As DataTable = ObjInventario.DtResultados.Copy()
|
||||||
DtInv = DtRecepcion
|
DtInv = DtRecepcion
|
||||||
Dim NumUsados = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = True").ToEntero()
|
Dim NumUsados As Integer = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = True").ToEntero()
|
||||||
Dim NumProductos = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = False").ToEntero()
|
Dim NumProductos As Integer = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = False").ToEntero()
|
||||||
Dim CveSubProyecto As Integer
|
Dim CveSubProyecto As Integer
|
||||||
|
|
||||||
ArchivoBitacora = String.Format("{0}Temp\RecepcionDT_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, pCveCompra)
|
ArchivoBitacora = String.Format("{0}Temp\RecepcionDT_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, pCveCompra)
|
||||||
@@ -1405,9 +1405,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
GvInv.Columns(3).Visible = False
|
GvInv.Columns(3).Visible = False
|
||||||
GvInv.Columns(9).Visible = TmDT.SUM("CostoIndirecto") > 0
|
GvInv.Columns(9).Visible = TmDT.SUM("CostoIndirecto") > 0
|
||||||
|
|
||||||
Dim VariableCampo = If(TipoMovimiento.Contiene(1, 3), "CantidadF", "CantidadS")
|
Dim VariableCampo As String = If(TipoMovimiento.Contiene(1, 3), "CantidadF", "CantidadS")
|
||||||
|
Dim Index As Integer = 1
|
||||||
Dim Index = 1
|
|
||||||
For Each Dr As DataRow In TmDT.Rows
|
For Each Dr As DataRow In TmDT.Rows
|
||||||
Dr("PUExtranjero") = Dr("PU")
|
Dr("PUExtranjero") = Dr("PU")
|
||||||
Dr("CostoIndirectoExtranjero") = Dr("CostoIndirecto")
|
Dr("CostoIndirectoExtranjero") = Dr("CostoIndirecto")
|
||||||
@@ -2063,8 +2062,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Row = DtDatosLoteDetalle.NewRow
|
Dim Row As DataRow = DtDatosLoteDetalle.NewRow
|
||||||
Dim CantidadLote = TxtCantidadLote.Text.ToDecimal
|
Dim CantidadLote As Decimal = TxtCantidadLote.Text.ToDecimal
|
||||||
|
|
||||||
Dim MensajeSinExistencias As New StringBuilder
|
Dim MensajeSinExistencias As New StringBuilder
|
||||||
Dim ObjInventarios As New ClsInventarios
|
Dim ObjInventarios As New ClsInventarios
|
||||||
@@ -2180,14 +2179,14 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
'VALIDA SI HUBO CAMBIOS EN LOS DETALLES COMPRA
|
'VALIDA SI HUBO CAMBIOS EN LOS DETALLES COMPRA
|
||||||
If CveCompraSurtir > 0 Then
|
If CveCompraSurtir > 0 Then
|
||||||
Dim VariableCampo = If(TipoMovimiento.Contiene(1, 3), "CantidadF", "CantidadS")
|
Dim VariableCampo As String = If(TipoMovimiento.Contiene(1, 3), "CantidadF", "CantidadS")
|
||||||
Dim ObjComprasDif As New ClsInventarios
|
Dim ObjComprasDif As New ClsInventarios
|
||||||
Dim DtDatosCompra As New DataTable
|
Dim DtDatosCompra As New DataTable
|
||||||
If ObjComprasDif.RecepcionAlmacenGet(CveCompraSurtir, BuscaEntregaDirecta, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
|
If ObjComprasDif.RecepcionAlmacenGet(CveCompraSurtir, BuscaEntregaDirecta, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
|
||||||
DtDatosCompra = ObjComprasDif.DtResultados
|
DtDatosCompra = ObjComprasDif.DtResultados
|
||||||
End If
|
End If
|
||||||
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
Dim CantidadGV As Decimal = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
||||||
Dim CantConsulta = DtDatosCompra.SUM(VariableCampo)
|
Dim CantConsulta As Decimal = DtDatosCompra.SUMD(VariableCampo)
|
||||||
If Math.Abs(CantidadGV - CantConsulta) > 0.01 Then
|
If Math.Abs(CantidadGV - CantConsulta) > 0.01 Then
|
||||||
CargaCompra(CveCompraSurtir, -1)
|
CargaCompra(CveCompraSurtir, -1)
|
||||||
CargaPendientes()
|
CargaPendientes()
|
||||||
@@ -2200,14 +2199,14 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
'VALIDA SI HUBO CAMBIOS EN LOS DETALLES OC
|
'VALIDA SI HUBO CAMBIOS EN LOS DETALLES OC
|
||||||
If CveOCSurtir > 0 Then
|
If CveOCSurtir > 0 Then
|
||||||
Dim VariableCampo = If(TipoMovimiento = 1, "CantidadF", "CantidadS")
|
Dim VariableCampo As String = If(TipoMovimiento = 1, "CantidadF", "CantidadS")
|
||||||
Dim ObjComprasDif As New ClsInventarios
|
Dim ObjComprasDif As New ClsInventarios
|
||||||
Dim DtDatosOC As New DataTable
|
Dim DtDatosOC As New DataTable
|
||||||
If ObjComprasDif.RecepcionAlmacenOCGet(CveOCSurtir, UsuarioActual.CveEmpresa) Then
|
If ObjComprasDif.RecepcionAlmacenOCGet(CveOCSurtir, UsuarioActual.CveEmpresa) Then
|
||||||
DtDatosOC = ObjComprasDif.DtResultados.FiltraParametros("CantidadCompra = 0")
|
DtDatosOC = ObjComprasDif.DtResultados.FiltraParametros("CantidadCompra = 0")
|
||||||
End If
|
End If
|
||||||
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
Dim CantidadGV As Decimal = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
||||||
Dim CantConsulta = DtDatosOC.SUM(VariableCampo)
|
Dim CantConsulta As Decimal = DtDatosOC.SUMD(VariableCampo)
|
||||||
If Math.Abs(CantidadGV - CantConsulta) > 0.1 Then
|
If Math.Abs(CantidadGV - CantConsulta) > 0.1 Then
|
||||||
CargaOCPorSurtir(CveOCSurtir)
|
CargaOCPorSurtir(CveOCSurtir)
|
||||||
Alert("Ha sido cambiada la información de existencias de la orden de compra actual, se han recargado la información.", TipoMensaje.MsgAdvertencia)
|
Alert("Ha sido cambiada la información de existencias de la orden de compra actual, se han recargado la información.", TipoMensaje.MsgAdvertencia)
|
||||||
@@ -2219,14 +2218,14 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
'VALIDA SI HUBO CAMBIOS EN LOS DETALLES IMPORTACION
|
'VALIDA SI HUBO CAMBIOS EN LOS DETALLES IMPORTACION
|
||||||
If CveImportacionSurtir > 0 Then
|
If CveImportacionSurtir > 0 Then
|
||||||
Dim VariableCampo = If(TipoMovimiento = 1, "CantidadF", "CantidadS")
|
Dim VariableCampo As String = If(TipoMovimiento = 1, "CantidadF", "CantidadS")
|
||||||
Dim ObjComprasDif As New ClsInventarios
|
Dim ObjComprasDif As New ClsInventarios
|
||||||
Dim DtDatosImportacion As New DataTable
|
Dim DtDatosImportacion As New DataTable
|
||||||
If ObjComprasDif.RecepcionAlmacenImportacionGet(CveImportacionSurtir, CveImportacionCompra, CveImportacionProveedor, UsuarioActual.CveEmpresa) Then
|
If ObjComprasDif.RecepcionAlmacenImportacionGet(CveImportacionSurtir, CveImportacionCompra, CveImportacionProveedor, UsuarioActual.CveEmpresa) Then
|
||||||
DtDatosImportacion = ObjComprasDif.DtResultados
|
DtDatosImportacion = ObjComprasDif.DtResultados
|
||||||
End If
|
End If
|
||||||
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
Dim CantidadGV As Decimal = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
||||||
Dim CantConsulta = DtDatosImportacion.SUM(VariableCampo)
|
Dim CantConsulta As Decimal = DtDatosImportacion.SUMD(VariableCampo)
|
||||||
If CantidadGV <> CantConsulta Then
|
If CantidadGV <> CantConsulta Then
|
||||||
CargaImportacionSurtir(CveImportacionSurtir)
|
CargaImportacionSurtir(CveImportacionSurtir)
|
||||||
Alert("Ha sido cambiada la información de existencias de la importación actual, se han recargado la información.", TipoMensaje.MsgAdvertencia)
|
Alert("Ha sido cambiada la información de existencias de la importación actual, se han recargado la información.", TipoMensaje.MsgAdvertencia)
|
||||||
@@ -2238,14 +2237,14 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
'VALIDA SI HUBO CAMBIOS EN LOS DETALLES FLETES
|
'VALIDA SI HUBO CAMBIOS EN LOS DETALLES FLETES
|
||||||
If CveFleteSurtir > 0 Then
|
If CveFleteSurtir > 0 Then
|
||||||
Dim VariableCampo = If(TipoMovimiento = 1, "CantidadF", "CantidadS")
|
Dim VariableCampo As String = If(TipoMovimiento = 1, "CantidadF", "CantidadS")
|
||||||
Dim ObjComprasDif As New ClsInventarios
|
Dim ObjComprasDif As New ClsInventarios
|
||||||
Dim DtDatosImportacion As New DataTable
|
Dim DtDatosImportacion As New DataTable
|
||||||
If ObjComprasDif.RecepcionAlmacenFleteGet(CveFleteSurtir, CveFleteOrdenCompra, CveFleteCompra, UsuarioActual.CveEmpresa) Then
|
If ObjComprasDif.RecepcionAlmacenFleteGet(CveFleteSurtir, CveFleteOrdenCompra, CveFleteCompra, UsuarioActual.CveEmpresa) Then
|
||||||
DtDatosImportacion = ObjComprasDif.DtResultados
|
DtDatosImportacion = ObjComprasDif.DtResultados
|
||||||
End If
|
End If
|
||||||
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
Dim CantidadGV As Decimal = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
||||||
Dim CantConsulta = DtDatosImportacion.SUM(VariableCampo)
|
Dim CantConsulta As Decimal = DtDatosImportacion.SUMD(VariableCampo)
|
||||||
If CantidadGV <> CantConsulta Then
|
If CantidadGV <> CantConsulta Then
|
||||||
CargaFleteSurtir(CveFleteSurtir)
|
CargaFleteSurtir(CveFleteSurtir)
|
||||||
Alert(String.Format("Ha sido cambiada la informacion de existencias costo indirecto actual, se han recargado la información.[{0}-{1}]", CantidadGV, CantConsulta), TipoMensaje.MsgAdvertencia)
|
Alert(String.Format("Ha sido cambiada la informacion de existencias costo indirecto actual, se han recargado la información.[{0}-{1}]", CantidadGV, CantConsulta), TipoMensaje.MsgAdvertencia)
|
||||||
@@ -2258,7 +2257,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
Dim ValidaSeccion As Boolean = False : Dim ValidaCaducidad As Boolean = False : Dim ValidaLote As Boolean = False
|
Dim ValidaSeccion As Boolean = False : Dim ValidaCaducidad As Boolean = False : Dim ValidaLote As Boolean = False
|
||||||
'PASA DATOS DEL GV A DATATABLE PARA MANEJOR CON FOR EACH
|
'PASA DATOS DEL GV A DATATABLE PARA MANEJOR CON FOR EACH
|
||||||
Dim Index = 0
|
Dim Index As Integer = 0
|
||||||
For Each gvr As GridViewRow In GvInv.Rows
|
For Each gvr As GridViewRow In GvInv.Rows
|
||||||
If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
||||||
DtInv.Rows(Index)("CantidadSurtidaPantalla") = gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
DtInv.Rows(Index)("CantidadSurtidaPantalla") = gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||||
@@ -2307,7 +2306,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim MensajeExistencias As New StringBuilder
|
Dim MensajeExistencias As New StringBuilder
|
||||||
Dim ObjInventarios As New ClsInventarios
|
Dim ObjInventarios As New ClsInventarios
|
||||||
For Each gvr As GridViewRow In GvInv.Rows
|
For Each gvr As GridViewRow In GvInv.Rows
|
||||||
Dim ExistenciaActual = DtInv.SUM("CantidadSurtidaPantalla", $"CvePS = {gvr.DataKey("CvePS").ToEntero} AND CveUM = {gvr.DataKey("CveUM").ToEntero} ")
|
Dim ExistenciaActual As Decimal = DtInv.SUMD("CantidadSurtidaPantalla", $"CvePS = {gvr.DataKey("CvePS").ToEntero} AND CveUM = {gvr.DataKey("CveUM").ToEntero} ")
|
||||||
|
|
||||||
If TipoMovimiento = 2 Then
|
If TipoMovimiento = 2 Then
|
||||||
'If gvr.DataKey("CantidadC").ToString.ToDecimal <> ExistenciaActual Then
|
'If gvr.DataKey("CantidadC").ToString.ToDecimal <> ExistenciaActual Then
|
||||||
@@ -2321,7 +2320,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Existencia = ObjInventarios.GetExistenciasPS(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=(TxtFecha.Text & " " & Now.ToShortTimeString).ToDateTime.ToString("yyyy/MM/dd HH:mm"))
|
Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=(TxtFecha.Text & " " & Now.ToShortTimeString).ToDateTime.ToString("yyyy/MM/dd HH:mm"))
|
||||||
If Existencia < ExistenciaActual Then
|
If Existencia < ExistenciaActual Then
|
||||||
MensajeExistencias.Append($"Producto: <b>{GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=gvr.DataKey("CvePS").ToString.ToEntero).FiltroPrimeroValor("PSCodigo")}</b>.</br>")
|
MensajeExistencias.Append($"Producto: <b>{GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=gvr.DataKey("CvePS").ToString.ToEntero).FiltroPrimeroValor("PSCodigo")}</b>.</br>")
|
||||||
Continue For
|
Continue For
|
||||||
@@ -2358,7 +2357,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function GeneraPrePolizaSalidaEntregaDirecta(CveMovimiento As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, ByRef ObjContaContPAQ As ClsContPAQi, EsContabilizable As Boolean) As Boolean
|
Private Function GeneraPrePolizaSalidaEntregaDirecta(CveMovimiento As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, EsContabilizable As Boolean) As Boolean
|
||||||
Dim Retorno As Boolean = True
|
Dim Retorno As Boolean = True
|
||||||
Try
|
Try
|
||||||
Dim DtCostos As DataTable = Nothing
|
Dim DtCostos As DataTable = Nothing
|
||||||
@@ -2382,8 +2381,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
If tmpCostos.Rows.Count > 0 Then
|
If tmpCostos.Rows.Count > 0 Then
|
||||||
Dim Concepto As String = ConceptoPoliza
|
Dim Concepto As String = ConceptoPoliza
|
||||||
Dim CvePrePoliza = ObjConta.AddPrePolizas("RecepAlm", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("RecepAlm", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
|
Dim tCveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
|
||||||
Dim tCveConcepto As Integer = 69
|
Dim tCveConcepto As Integer = 69
|
||||||
For Each RowInv As DataRow In tmpCostos.Rows
|
For Each RowInv As DataRow In tmpCostos.Rows
|
||||||
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL
|
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL
|
||||||
@@ -2397,7 +2396,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Retorno = False
|
Retorno = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 6) Then
|
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=6) Then
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||||
Retorno = False
|
Retorno = False
|
||||||
@@ -2413,12 +2412,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||||
If ObjContaContPAQ Is Nothing Then
|
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||||
ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa)
|
|
||||||
ObjContaContPAQ.IniciaTransacSQL()
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then
|
|
||||||
Retorno = False
|
Retorno = False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -2439,7 +2433,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Private Function GeneraPrePolizaMovimientoAlmacen(CveMovimientoEntrada As Integer, CveMovimientoSalida As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, ByRef ObjContaContPAQ As ClsContPAQi, EsContabilizable As Boolean) As Boolean
|
Private Function GeneraPrePolizaMovimientoAlmacen(CveMovimientoEntrada As Integer, CveMovimientoSalida As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, EsContabilizable As Boolean) As Boolean
|
||||||
Dim Retorno As Boolean = True
|
Dim Retorno As Boolean = True
|
||||||
Try
|
Try
|
||||||
Dim DtCostos As DataTable = Nothing
|
Dim DtCostos As DataTable = Nothing
|
||||||
@@ -2462,8 +2456,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim ConceptoPoliza As String = String.Format("{0}-{1}", "Salida de Almacen", SerieFolio)
|
Dim ConceptoPoliza As String = String.Format("{0}-{1}", "Salida de Almacen", SerieFolio)
|
||||||
If tmpCostos.Rows.Count > 0 Then
|
If tmpCostos.Rows.Count > 0 Then
|
||||||
Dim Concepto As String = ConceptoPoliza
|
Dim Concepto As String = ConceptoPoliza
|
||||||
Dim CvePrePoliza = ObjConta.AddPrePolizas("RA-01", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("RA-01", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
|
Dim tCveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, ValorInventario, 68, Concepto, Concepto, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoEntrada, CveSubProyecto:=tCveSubProyecto, Contabilizable:=EsContabilizable) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, ValorInventario, 68, Concepto, Concepto, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoEntrada, CveSubProyecto:=tCveSubProyecto, Contabilizable:=EsContabilizable) Then
|
||||||
Retorno = False
|
Retorno = False
|
||||||
@@ -2473,7 +2467,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Retorno = False
|
Retorno = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 6) Then
|
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=6) Then
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||||
Retorno = False
|
Retorno = False
|
||||||
@@ -2489,12 +2483,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||||
If ObjContaContPAQ Is Nothing Then
|
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||||
ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa)
|
|
||||||
ObjContaContPAQ.IniciaTransacSQL()
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then
|
|
||||||
Retorno = False
|
Retorno = False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -2518,14 +2507,11 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
Dim CveMovimiento As Integer
|
Dim CveMovimiento As Integer
|
||||||
Dim CveMovimientoOriginal As Integer
|
Dim CveMovimientoOriginal As Integer
|
||||||
|
|
||||||
'Dim CveMovimientoS
|
|
||||||
|
|
||||||
Dim InvFolio As String = ""
|
Dim InvFolio As String = ""
|
||||||
Dim FechaMovto As Date = TxtFecha.Text.ToDate
|
Dim FechaMovto As Date = TxtFecha.Text.ToDate
|
||||||
|
|
||||||
Dim ErrorMovInv As Boolean
|
Dim ErrorMovInv As Boolean
|
||||||
Dim MensajeError = ""
|
Dim MensajeError As String = ""
|
||||||
|
|
||||||
Dim ObjInventario As New ClsInventarios
|
Dim ObjInventario As New ClsInventarios
|
||||||
|
|
||||||
@@ -2536,7 +2522,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim ObjAcum As New ClsAcumuladores(ObjInventario.IniciaTransacSQL())
|
Dim ObjAcum As New ClsAcumuladores(ObjInventario.IniciaTransacSQL())
|
||||||
Dim ObjVentas As New ClsVentas(ObjInventario.IniciaTransacSQL())
|
Dim ObjVentas As New ClsVentas(ObjInventario.IniciaTransacSQL())
|
||||||
Dim ObjContaAC As ClsContPAQi = Nothing
|
Dim ObjContaAC As ClsContPAQi = Nothing
|
||||||
Dim ObjContaContPAQ As ClsContPAQi = Nothing
|
|
||||||
Dim MensajeOC As New StringBuilder
|
Dim MensajeOC As New StringBuilder
|
||||||
|
|
||||||
'ENTREGA DIRECTA
|
'ENTREGA DIRECTA
|
||||||
@@ -2562,8 +2547,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim FolioSalidaTraspaso As String = ""
|
Dim FolioSalidaTraspaso As String = ""
|
||||||
|
|
||||||
'CONTABILIDAD
|
'CONTABILIDAD
|
||||||
Dim CvePrePoliza = -1
|
Dim CvePrePoliza As Integer = -1
|
||||||
Dim MensajeContabilidad = ""
|
Dim MensajeContabilidad As String = ""
|
||||||
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
@@ -2615,12 +2600,12 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim SumaTotal As Decimal = 0.0D
|
Dim SumaTotal As Decimal = 0.0D
|
||||||
Dim Cont As Integer = 0
|
Dim Cont As Integer = 0
|
||||||
|
|
||||||
Dim CveMovtoSalidaActual = -1
|
Dim CveMovtoSalidaActual As Integer = -1
|
||||||
Dim CveMovtoEntradaActual = -1
|
Dim CveMovtoEntradaActual As Integer = -1
|
||||||
Dim CveVendedorActual = -1
|
Dim CveVendedorActual As Integer = -1
|
||||||
Dim CveClienteActual = -1
|
Dim CveClienteActual As Integer = -1
|
||||||
|
|
||||||
Dim CveAlmacenDestino = CveAlmacenDevolucionProveedor
|
Dim CveAlmacenDestino As Integer = CveAlmacenDevolucionProveedor
|
||||||
Dim CveSeccionDestino As Integer = -1
|
Dim CveSeccionDestino As Integer = -1
|
||||||
|
|
||||||
'For Each RowAlmacen As DataRow In DtAlmacenesDevolucion.FiltraParametros("", DistinctColumns:={"CveAlmacenOrignal"}).Rows
|
'For Each RowAlmacen As DataRow In DtAlmacenesDevolucion.FiltraParametros("", DistinctColumns:={"CveAlmacenOrignal"}).Rows
|
||||||
@@ -2888,7 +2873,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim DtDetalleMovimiento As DataTable = Dt.FiltraParametros($"CveVenta={ObjFactura.CveVenta}")
|
Dim DtDetalleMovimiento As DataTable = Dt.FiltraParametros($"CveVenta={ObjFactura.CveVenta}")
|
||||||
|
|
||||||
If ObjFactura.TipoDocto = "Ing" Then
|
If ObjFactura.TipoDocto = "Ing" Then
|
||||||
Dim MovSalida = GenerarMovimientoAlmacenVenta(DdlAlmacen.SelectedValue.ToEntero(), 3, ObjFactura.CveVenta, CveMovimiento, DtDetalleMovimiento, ObjInventario, ObjConta, ObjContaContPAQ, EsContabilizable, "RA/G2")
|
Dim MovSalida As MMovimientoAlmacen = GenerarMovimientoAlmacenVenta(DdlAlmacen.SelectedValue.ToEntero(), 3, ObjFactura.CveVenta, CveMovimiento, DtDetalleMovimiento, ObjInventario, ObjConta, EsContabilizable, "RA/G2")
|
||||||
|
|
||||||
ErrorMovInv = MovSalida.CveMovimiento <= 0
|
ErrorMovInv = MovSalida.CveMovimiento <= 0
|
||||||
|
|
||||||
@@ -2898,7 +2883,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
ElseIf ObjFactura.TipoDocto = "Rem" Then
|
ElseIf ObjFactura.TipoDocto = "Rem" Then
|
||||||
Dim MovSalidaExA = GenerarMovimientoAlmacenVenta(DdlAlmacen.SelectedValue.ToEntero(), 8, ObjFactura.CveVenta, -1, DtDetalleMovimiento, ObjInventario, ObjConta, ObjContaContPAQ, False, "RA/G2R1")
|
Dim MovSalidaExA As MMovimientoAlmacen = GenerarMovimientoAlmacenVenta(DdlAlmacen.SelectedValue.ToEntero(), 8, ObjFactura.CveVenta, -1, DtDetalleMovimiento, ObjInventario, ObjConta, False, "RA/G2R1")
|
||||||
|
|
||||||
ErrorMovInv = MovSalidaExA.CveMovimiento <= 0
|
ErrorMovInv = MovSalidaExA.CveMovimiento <= 0
|
||||||
|
|
||||||
@@ -2912,7 +2897,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
drr("CveSeccionAlmacen") = -3
|
drr("CveSeccionAlmacen") = -3
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Dim MovEntradaExA = GenerarMovimientoAlmacenVenta(ObjFactura.CveAlmacenTraspasoDestino, 9, ObjFactura.CveVenta, MovSalidaExA.CveMovimiento, dttexa, ObjInventario, ObjConta, ObjContaContPAQ, False, "RA/G2R2")
|
Dim MovEntradaExA As MMovimientoAlmacen = GenerarMovimientoAlmacenVenta(ObjFactura.CveAlmacenTraspasoDestino, 9, ObjFactura.CveVenta, MovSalidaExA.CveMovimiento, dttexa, ObjInventario, ObjConta, False, "RA/G2R2")
|
||||||
|
|
||||||
ErrorMovInv = MovEntradaExA.CveMovimiento <= 0
|
ErrorMovInv = MovEntradaExA.CveMovimiento <= 0
|
||||||
|
|
||||||
@@ -2934,7 +2919,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
For Each DrFactura As DataRow In Dt.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
|
For Each DrFactura As DataRow In Dt.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
|
||||||
Dim dtSalidaFactura As DataTable = dttsalida.FiltraParametros($"CveVenta={DrFactura("CveVenta")}")
|
Dim dtSalidaFactura As DataTable = dttsalida.FiltraParametros($"CveVenta={DrFactura("CveVenta")}")
|
||||||
Dim MovSalidaDirectaExA = GenerarMovimientoAlmacenVenta(ObjFactura.CveAlmacenTraspasoDestino, 40, DrFactura("CveVenta").ToString().ToEntero(), MovEntradaExA.CveMovimiento, dtSalidaFactura, ObjInventario, ObjConta, ObjContaContPAQ, False, "RA/G2R3")
|
Dim MovSalidaDirectaExA As MMovimientoAlmacen = GenerarMovimientoAlmacenVenta(ObjFactura.CveAlmacenTraspasoDestino, 40, DrFactura("CveVenta").ToString().ToEntero(), MovEntradaExA.CveMovimiento, dtSalidaFactura, ObjInventario, ObjConta, False, "RA/G2R3")
|
||||||
|
|
||||||
ErrorMovInv = MovSalidaDirectaExA.CveMovimiento <= 0
|
ErrorMovInv = MovSalidaDirectaExA.CveMovimiento <= 0
|
||||||
|
|
||||||
@@ -2970,12 +2955,12 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
If Apartado Then
|
If Apartado Then
|
||||||
If ObjInventario.GetMovimientosDetalleVendedor(CveMovimiento) Then
|
If ObjInventario.GetMovimientosDetalleVendedor(CveMovimiento) Then
|
||||||
|
|
||||||
Dim CveMovtoSalidaActual = -1
|
Dim CveMovtoSalidaActual As Integer = -1
|
||||||
Dim CveMovtoEntradaActual = -1
|
Dim CveMovtoEntradaActual As Integer = -1
|
||||||
Dim CveVendedorActual = -1
|
Dim CveVendedorActual As Integer = -1
|
||||||
Dim CveClienteActual = -1
|
Dim CveClienteActual As Integer = -1
|
||||||
|
|
||||||
Dim CveAlmacenDestino = CveAlmacenApartado
|
Dim CveAlmacenDestino As Integer = CveAlmacenApartado
|
||||||
Dim CveSeccionDestino As Integer = -1
|
Dim CveSeccionDestino As Integer = -1
|
||||||
|
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
@@ -3016,7 +3001,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
If Not ErrorMovInv Then
|
If Not ErrorMovInv Then
|
||||||
'registra la prepóliza en el traspaso
|
'registra la prepóliza en el traspaso
|
||||||
If Not GeneraPrePolizaMovimientoAlmacen(CveMovtoEntradaActual, CveMovtoSalidaActual, ObjInventario, ObjConta, ObjContaContPAQ, False) Then
|
If Not GeneraPrePolizaMovimientoAlmacen(CveMovtoEntradaActual, CveMovtoSalidaActual, ObjInventario, ObjConta, False) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -3052,7 +3037,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
FolioVirtual = ObjInventario.Folio
|
FolioVirtual = ObjInventario.Folio
|
||||||
|
|
||||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
Dim CvePS As Integer = RowUsado("CvePS").ToString().ToEntero()
|
||||||
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||||
Dim PU As Decimal = RowUsado("Cargo").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()
|
||||||
@@ -3071,7 +3056,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
Dim tConcepto As String = String.Format("Entrada Virtual {0}", HLFolio.Text)
|
Dim tConcepto As String = String.Format("Entrada Virtual {0}", HLFolio.Text)
|
||||||
Dim tReferencia As String = HLFolio.Text
|
Dim tReferencia As String = HLFolio.Text
|
||||||
Dim tCvePrePoliza = ObjConta.AddPrePolizas("Inv_RAlmVirtual", 74, 0, 0, 1, TxtFecha.Text.ToDate, tConcepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
Dim tCvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv_RAlmVirtual", 74, 0, 0, 1, TxtFecha.Text.ToDate, tConcepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
If tCvePrePoliza > 0 Then
|
If tCvePrePoliza > 0 Then
|
||||||
|
|
||||||
@@ -3096,7 +3081,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
If Not ErrorMovInv AndAlso UsuarioActual.Empresa.UsaAC AndAlso EsContabilizable Then
|
If Not ErrorMovInv AndAlso UsuarioActual.Empresa.UsaAC AndAlso EsContabilizable Then
|
||||||
Dim IDPoliza As Integer
|
Dim IDPoliza As Integer
|
||||||
Dim TotalDetalle As Decimal = 0
|
Dim TotalDetalle As Decimal = 0
|
||||||
Dim TotalPorDevengar = 0.0
|
Dim TotalPorDevengar As Decimal = 0
|
||||||
TotalPorDevengar += GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(Gvr) Math.Round(Gvr.DataKey("PU").ToString.ToDecimal, 4) * Math.Round(Gvr.DataKey("CantidadF").ToString.ToDecimal, 4))
|
TotalPorDevengar += GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(Gvr) Math.Round(Gvr.DataKey("PU").ToString.ToDecimal, 4) * Math.Round(Gvr.DataKey("CantidadF").ToString.ToDecimal, 4))
|
||||||
TotalPorDevengar = Math.Round(TotalPorDevengar, 4)
|
TotalPorDevengar = Math.Round(TotalPorDevengar, 4)
|
||||||
If ObjContaAC Is Nothing Then
|
If ObjContaAC Is Nothing Then
|
||||||
@@ -3191,8 +3176,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
For Each Tam As DataRow In DtTamanios.Rows
|
For Each Tam As DataRow In DtTamanios.Rows
|
||||||
If Tam("CveTamaño").ToString() = GvRow.DataKey("CveTamaño") Then
|
If Tam("CveTamaño").ToString() = GvRow.DataKey("CveTamaño") Then
|
||||||
Dim CvePSCargo = Tam("CvePSCargo").ToString().ToEntero()
|
Dim CvePSCargo As Integer = Tam("CvePSCargo").ToString().ToEntero()
|
||||||
Dim RowCompraDetalle = DtComprasDetalle.FiltroPrimero($"CvePS = {CvePSCargo}")
|
Dim RowCompraDetalle As DataRow = DtComprasDetalle.FiltroPrimero($"CvePS = {CvePSCargo}")
|
||||||
|
|
||||||
If RowCompraDetalle IsNot Nothing Then
|
If RowCompraDetalle IsNot Nothing Then
|
||||||
Dim Row As DataRow = DtPSVirtual.NewRow()
|
Dim Row As DataRow = DtPSVirtual.NewRow()
|
||||||
@@ -3216,7 +3201,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
FolioVirtual = ObjInventario.Folio
|
FolioVirtual = ObjInventario.Folio
|
||||||
|
|
||||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
Dim CvePS As Integer = RowUsado("CvePS").ToString().ToEntero()
|
||||||
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||||
Dim PU As Decimal = RowUsado("PU").ToString().ToDecimal()
|
Dim PU As Decimal = RowUsado("PU").ToString().ToDecimal()
|
||||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||||
@@ -3268,7 +3253,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
FolioVirtual = ObjInventario.Folio
|
FolioVirtual = ObjInventario.Folio
|
||||||
|
|
||||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
Dim CvePS As Integer = RowUsado("CvePS").ToString().ToEntero()
|
||||||
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||||
Dim PU As Decimal = RowUsado("Cargo").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()
|
||||||
@@ -3357,9 +3342,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim CveProveedor As Integer = -1
|
Dim CveProveedor As Integer = -1
|
||||||
Dim ProveedorNombre As String = ""
|
Dim ProveedorNombre As String = ""
|
||||||
Dim SerieFolio As String = ""
|
Dim SerieFolio As String = ""
|
||||||
Dim CveConceptoContableCosto = -1
|
Dim CveConceptoContableCosto As Integer = -1
|
||||||
Dim CveConceptoContableCostoME = -1
|
Dim CveConceptoContableCostoME As Integer = -1
|
||||||
Dim CveConceptoContableCostoComplementaria = -1
|
Dim CveConceptoContableCostoComplementaria As Integer = -1
|
||||||
Dim UsaComplementariaFleteImportaciones As Boolean = False
|
Dim UsaComplementariaFleteImportaciones As Boolean = False
|
||||||
If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = False
|
If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaFleteImportaciones = False
|
||||||
|
|
||||||
@@ -3466,7 +3451,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||||
MensajeError = "El Movimiento presenta una diferencia en el registro."
|
MensajeError = "El Movimiento presenta una diferencia en el registro."
|
||||||
@@ -3494,11 +3479,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||||
If ObjContaContPAQ Is Nothing Then
|
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) 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>"
|
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
|
||||||
@@ -3524,7 +3505,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
|
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
|
||||||
|
|
||||||
Dim TotalNC As Decimal = 0
|
Dim TotalNC As Decimal = 0
|
||||||
Dim CveClasificacionDifCostoNC = -1
|
Dim CveClasificacionDifCostoNC As Integer = -1
|
||||||
Dim tTipoCambio As Decimal = 1
|
Dim tTipoCambio As Decimal = 1
|
||||||
If CveMoneda <> 1 Then tTipoCambio = TipoCambio
|
If CveMoneda <> 1 Then tTipoCambio = TipoCambio
|
||||||
|
|
||||||
@@ -3541,7 +3522,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim CveProveedor As Integer = -1
|
Dim CveProveedor As Integer = -1
|
||||||
Dim ProveedorNombre As String = ""
|
Dim ProveedorNombre As String = ""
|
||||||
Dim SerieFolio As String = ""
|
Dim SerieFolio As String = ""
|
||||||
Dim CveConceptoContableNC = -1
|
Dim CveConceptoContableNC As Integer = -1
|
||||||
|
|
||||||
If DtCostos.Rows.Count > 0 Then
|
If DtCostos.Rows.Count > 0 Then
|
||||||
If CveCompraSurtir > 0 Then
|
If CveCompraSurtir > 0 Then
|
||||||
@@ -3578,7 +3559,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPNC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPNC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
@@ -3606,9 +3587,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||||
ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa)
|
|
||||||
ObjContaContPAQ.IniciaTransacSQL()
|
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||||
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>"
|
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
|
||||||
@@ -3709,7 +3689,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
If Not ErrorMovInv Then
|
If Not ErrorMovInv Then
|
||||||
ObjInventario.Commit() ' aplica los movimientos insertados
|
ObjInventario.Commit() ' aplica los movimientos insertados
|
||||||
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
|
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
|
||||||
If ObjContaContPAQ IsNot Nothing Then ObjContaContPAQ.Commit()
|
|
||||||
RegistraScript("playsonidito('beep-07.wav')")
|
RegistraScript("playsonidito('beep-07.wav')")
|
||||||
|
|
||||||
' 'ENVIO DE CORREO NOTIFICACION A VENDEDORES DE OC
|
' 'ENVIO DE CORREO NOTIFICACION A VENDEDORES DE OC
|
||||||
@@ -3750,14 +3729,14 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Msg.AppendFormat("<br/><br/> Movimientos de control:<br/>")
|
Msg.AppendFormat("<br/><br/> Movimientos de control:<br/>")
|
||||||
|
|
||||||
If MovtosEntradaExA.Count > 0 Then
|
If MovtosEntradaExA.Count > 0 Then
|
||||||
For index = 0 To MovtosEntradaExA.Count - 1
|
For ind As Integer = 0 To MovtosEntradaExA.Count - 1
|
||||||
link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", MovtosEntradaExA(index), FoliosEntradaExA(index))
|
link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", MovtosEntradaExA(ind), FoliosEntradaExA(ind))
|
||||||
Msg.AppendFormat("<br/>Movimiento de Entrada Folio: <b>{0}</b>", link)
|
Msg.AppendFormat("<br/>Movimiento de Entrada Folio: <b>{0}</b>", link)
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
For index = 0 To MovtosSalidaDirecta.Count - 1
|
For ind As Integer = 0 To MovtosSalidaDirecta.Count - 1
|
||||||
link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", MovtosSalidaDirecta(index), FoliosSalidaDirecta(index))
|
link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", MovtosSalidaDirecta(ind), FoliosSalidaDirecta(ind))
|
||||||
Msg.AppendFormat("<br/>Movimiento de Salida Folio: <b>{0}</b>", link)
|
Msg.AppendFormat("<br/>Movimiento de Salida Folio: <b>{0}</b>", link)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
@@ -3767,10 +3746,10 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
'APARTADO
|
'APARTADO
|
||||||
If MovtosSalida.Count > 0 Then
|
If MovtosSalida.Count > 0 Then
|
||||||
Msg.AppendFormat("<br/><br/> Movimientos de control:<br/>")
|
Msg.AppendFormat("<br/><br/> Movimientos de control:<br/>")
|
||||||
For index = 0 To MovtosSalida.Count - 1
|
For ind As Integer = 0 To MovtosSalida.Count - 1
|
||||||
link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", MovtosSalida(index), FoliosSalida(index))
|
link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", MovtosSalida(ind), FoliosSalida(ind))
|
||||||
Msg.AppendFormat("<br/>Movimiento de Salida por Traspaso: Folio: <b>{0}</b>", link)
|
Msg.AppendFormat("<br/>Movimiento de Salida por Traspaso: Folio: <b>{0}</b>", link)
|
||||||
link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", MovtosEntrada(index), FoliosEntrada(index))
|
link = String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", MovtosEntrada(ind), FoliosEntrada(ind))
|
||||||
Msg.AppendFormat("<br/>Movimiento de Entrada por Traspaso: Folio: <b>{0}</b><br/>", link)
|
Msg.AppendFormat("<br/>Movimiento de Entrada por Traspaso: Folio: <b>{0}</b><br/>", link)
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
@@ -3797,7 +3776,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Else
|
Else
|
||||||
ObjInventario.RollBack()
|
ObjInventario.RollBack()
|
||||||
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
||||||
If ObjContaContPAQ IsNot Nothing Then ObjContaContPAQ.RollBack()
|
|
||||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||||
|
|
||||||
If Not String.IsNullOrEmpty(MensajeError) Then
|
If Not String.IsNullOrEmpty(MensajeError) Then
|
||||||
@@ -3807,10 +3785,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
ObjInventario.Dispose()
|
ObjInventario.Dispose()
|
||||||
If ObjContaAC IsNot Nothing Then ObjContaAC.Dispose()
|
If ObjContaAC IsNot Nothing Then ObjContaAC.Dispose()
|
||||||
If ObjContaContPAQ IsNot Nothing Then ObjContaContPAQ.Dispose()
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function GenerarMovimientoAlmacenVenta(CveAlmacen As Integer, CveConceptoAlmacen As Integer, CveVenta As Integer, CveMovimientoRelacionado As Integer, DtDetalle As DataTable, ObjInventario As ClsInventarios, ObjConta As ClsContabilidad, ObjContaContPAQ As ClsContPAQi, EsContabilizable As Boolean, Modulo As String) As MMovimientoAlmacen
|
Private Function GenerarMovimientoAlmacenVenta(CveAlmacen As Integer, CveConceptoAlmacen As Integer, CveVenta As Integer, CveMovimientoRelacionado As Integer, DtDetalle As DataTable, ObjInventario As ClsInventarios, ObjConta As ClsContabilidad, EsContabilizable As Boolean, Modulo As String) As MMovimientoAlmacen
|
||||||
Dim ErrorMovInv As Boolean = False
|
Dim ErrorMovInv As Boolean = False
|
||||||
Dim Retorno As New MMovimientoAlmacen
|
Dim Retorno As New MMovimientoAlmacen
|
||||||
|
|
||||||
@@ -3836,7 +3813,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ErrorMovInv AndAlso CveConceptoAlmacen = 3 Then
|
If Not ErrorMovInv AndAlso CveConceptoAlmacen = 3 Then
|
||||||
If Not GeneraPrePolizaSalidaEntregaDirecta(CveMovtoSalidaDirecta, ObjInventario, ObjConta, ObjContaContPAQ, EsContabilizable) Then
|
If Not GeneraPrePolizaSalidaEntregaDirecta(CveMovtoSalidaDirecta, ObjInventario, ObjConta, EsContabilizable) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -3853,7 +3830,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim InvFolio As String = ""
|
Dim InvFolio As String = ""
|
||||||
Dim FechaMovto As Date = TxtFecha.Text.ToDate
|
Dim FechaMovto As Date = TxtFecha.Text.ToDate
|
||||||
Dim ErrorMovInv As Boolean
|
Dim ErrorMovInv As Boolean
|
||||||
Dim MensajeError = ""
|
Dim MensajeError As String = ""
|
||||||
|
|
||||||
Dim ObjInventario As New ClsInventarios
|
Dim ObjInventario As New ClsInventarios
|
||||||
Dim ObjBitacora As New ClsOIEventos(ObjInventario.IniciaTransacSQL())
|
Dim ObjBitacora As New ClsOIEventos(ObjInventario.IniciaTransacSQL())
|
||||||
@@ -4027,7 +4004,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 6) Then
|
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=6) Then
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
@@ -4204,9 +4181,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Private Sub CargaOC()
|
Private Sub CargaOC()
|
||||||
|
|
||||||
'OBTENE CveOC
|
'OBTENE CveOC
|
||||||
Dim CveOC = -1
|
Dim CveOC As Integer = -1
|
||||||
Dim MensajeCompra = ""
|
Dim MensajeCompra As String = ""
|
||||||
Dim FolioOC = TxtOC.Text.Trim.ToEntero
|
Dim FolioOC As Integer = TxtOC.Text.Trim.ToEntero
|
||||||
Dim ObjOC As New ClsOC
|
Dim ObjOC As New ClsOC
|
||||||
If ObjOC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, -1, -1, FolioOC, -1, -1, UsuarioActual.CveEmpresa, -1) Then
|
If ObjOC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, -1, -1, FolioOC, -1, -1, UsuarioActual.CveEmpresa, -1) Then
|
||||||
'If ObjOC.DtResultados.FiltraParametros("TipoTermino = 3").Rows.Count = 1 Then
|
'If ObjOC.DtResultados.FiltraParametros("TipoTermino = 3").Rows.Count = 1 Then
|
||||||
@@ -4458,7 +4435,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
|
|
||||||
'AGREGA
|
'AGREGA
|
||||||
Dim Dr = DtBitacora.NewRow
|
Dim Dr As DataRow = DtBitacora.NewRow
|
||||||
Dr("FechaIng") = Now
|
Dr("FechaIng") = Now
|
||||||
Dr("FechaInicio") = ""
|
Dr("FechaInicio") = ""
|
||||||
Dr("Usuario") = UsuarioActual.Usuario
|
Dr("Usuario") = UsuarioActual.Usuario
|
||||||
@@ -4488,7 +4465,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
UPEventoBitacora.Update()
|
UPEventoBitacora.Update()
|
||||||
End Sub
|
End Sub
|
||||||
Private Function GuardaBitacoraTemporal(ObjEventoBitacora As ClsOIEventos, CveMovimiento As Integer) As Boolean
|
Private Function GuardaBitacoraTemporal(ObjEventoBitacora As ClsOIEventos, CveMovimiento As Integer) As Boolean
|
||||||
Dim Retorno = False
|
Dim Retorno As Boolean = False
|
||||||
Dim Archivo As System.IO.FileInfo = Nothing
|
Dim Archivo As System.IO.FileInfo = Nothing
|
||||||
|
|
||||||
For Each Dr As DataRow In DtBitacora.Rows
|
For Each Dr As DataRow In DtBitacora.Rows
|
||||||
@@ -5057,12 +5034,12 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Private Function GuardaDocumentoBitacora(ObjEventoBitacora As ClsOIEventos, CveMovimiento As Integer) As Boolean
|
Private Function GuardaDocumentoBitacora(ObjEventoBitacora As ClsOIEventos, CveMovimiento As Integer) As Boolean
|
||||||
Dim Retorno = True
|
Dim Retorno As Boolean = True
|
||||||
Dim Archivo As System.IO.FileInfo = Nothing
|
Dim Archivo As System.IO.FileInfo = Nothing
|
||||||
|
|
||||||
Dim Filesgral As List(Of Archivo) = TxtDocumento.getfiles().Archivos
|
Dim Filesgral As List(Of Archivo) = TxtDocumento.getfiles().Archivos
|
||||||
|
|
||||||
Dim archivoOriginal = Filesgral.FirstOrDefault()
|
Dim archivoOriginal As Archivo = Filesgral.FirstOrDefault()
|
||||||
Dim Bitacora As String = ""
|
Dim Bitacora As String = ""
|
||||||
|
|
||||||
If Not String.IsNullOrEmpty(TxtObservaciones.Text) Then
|
If Not String.IsNullOrEmpty(TxtObservaciones.Text) Then
|
||||||
|
|||||||
Reference in New Issue
Block a user