-
This commit is contained in:
@@ -2783,12 +2783,13 @@ Public Class ClsInventarios
|
|||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function GetInventarioFisicoResultadosAvance(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean
|
Public Function GetInventarioFisicoResultadosAvance(CveInventarioFisico As Integer, CveEmpresa As Integer, Optional GPO As Integer = 1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Inv_InventarioFisicoResultadoAvance")
|
DataAdapter("PA_Inv_InventarioFisicoResultadoAvance")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico
|
.Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@GPO", SqlDbType.Int).Value = GPO
|
||||||
End With
|
End With
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Imports System.Text.RegularExpressions
|
|||||||
Imports System.Threading.Tasks
|
Imports System.Threading.Tasks
|
||||||
Imports System.Xml
|
Imports System.Xml
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
|
Imports Newtonsoft.Json
|
||||||
|
|
||||||
Partial Class Compras_Compras
|
Partial Class Compras_Compras
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -4280,7 +4281,11 @@ Partial Class Compras_Compras
|
|||||||
Next
|
Next
|
||||||
If ErrorValidacion Then Exit Sub
|
If ErrorValidacion Then Exit Sub
|
||||||
|
|
||||||
|
Dim dtPSInvalidos As String = ValidarPSContrato(TmpDT.FiltraParametros("", "", {"CveSubProyecto", "CvePS", "Cantidad", "PU"}))
|
||||||
|
If dtPSInvalidos <> "" Then
|
||||||
|
Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
'RECORRO LOS PRODUCTOS O SERVICIOS PARA REGISTRARLOS LOS QUE NO EXISTEN EN EL CATÁLOGO
|
'RECORRO LOS PRODUCTOS O SERVICIOS PARA REGISTRARLOS LOS QUE NO EXISTEN EN EL CATÁLOGO
|
||||||
Dim tCve As Integer
|
Dim tCve As Integer
|
||||||
@@ -4586,7 +4591,7 @@ Partial Class Compras_Compras
|
|||||||
Else
|
Else
|
||||||
CveConceptoContableAlmacen = 205
|
CveConceptoContableAlmacen = 205
|
||||||
End If
|
End If
|
||||||
If OCVinculada AndAlso DdlOCVinculaInv.visible AndAlso Not (CveImportacion > 0 Or CveFlete > 0) Then
|
If OCVinculada AndAlso DdlOCVinculaInv.Visible AndAlso Not (CveImportacion > 0 Or CveFlete > 0) Then
|
||||||
CveConceptoContableAlmacen = DdlOCVinculaInv.SelectedValue.ToEntero
|
CveConceptoContableAlmacen = DdlOCVinculaInv.SelectedValue.ToEntero
|
||||||
End If
|
End If
|
||||||
If UsuarioActual.CveEmpresa.Contiene(72, 80, 140, 141) And Not (CveImportacion > 0 Or CveFlete > 0) Then 'se comento, RMF. 2020.08.19, no le hallo sentido
|
If UsuarioActual.CveEmpresa.Contiene(72, 80, 140, 141) And Not (CveImportacion > 0 Or CveFlete > 0) Then 'se comento, RMF. 2020.08.19, no le hallo sentido
|
||||||
@@ -9056,7 +9061,7 @@ Partial Class Compras_Compras
|
|||||||
PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal
|
PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal
|
||||||
IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
|
IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
|
||||||
|
|
||||||
If chkImportacion.checked Then
|
If chkImportacion.Checked Then
|
||||||
ConceptoContable = 287
|
ConceptoContable = 287
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -9109,7 +9114,7 @@ Partial Class Compras_Compras
|
|||||||
PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal
|
PorcentajeImpuesto = TmpDT.MAX("IVAPorcentaje").ToDecimal
|
||||||
IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
|
IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
|
||||||
|
|
||||||
If chkImportacion.checked Then
|
If chkImportacion.Checked Then
|
||||||
ConceptoContable = 288
|
ConceptoContable = 288
|
||||||
End If
|
End If
|
||||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
|
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
|
||||||
@@ -11200,7 +11205,7 @@ Partial Class Compras_Compras
|
|||||||
Dim subproyectos As New List(Of Integer)
|
Dim subproyectos As New List(Of Integer)
|
||||||
|
|
||||||
For Each Row As DataRow In TmpDT.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}).Rows
|
For Each Row As DataRow In TmpDT.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}).Rows
|
||||||
Dim RowCon As DataRow = GlobalDTContratos.FiltroPrimero(String.Format("CveSubProyecto={0}", Row("CveSubProyecto")))
|
Dim RowCon As DataRow = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto={0}", Row("CveSubProyecto")))
|
||||||
If Not IsNothing(RowCon) Then
|
If Not IsNothing(RowCon) Then
|
||||||
filtro.AppendFormat(",{0}", Row("CveSubProyecto"))
|
filtro.AppendFormat(",{0}", Row("CveSubProyecto"))
|
||||||
subproyectos.Add(Row("CveSubProyecto").ToString.ToEntero)
|
subproyectos.Add(Row("CveSubProyecto").ToString.ToEntero)
|
||||||
@@ -15043,7 +15048,7 @@ Partial Class Compras_Compras
|
|||||||
dt = ObjContabilidad.DtResultados
|
dt = ObjContabilidad.DtResultados
|
||||||
|
|
||||||
For Each dr As DataRow In dt.Rows
|
For Each dr As DataRow In dt.Rows
|
||||||
If Not ObjContabilidad.UpdatePrepolizasDetalle(dr("CvePrePolizaDetalle").ToString.ToEntero, dr("Concepto").ToString, dr("CveSubProyecto").ToString.ToEntero, dr("IdCtaContable").ToString.ToEntero, CBool(dr("TipoMovto").ToString), 0, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
If Not ObjContabilidad.UpdatePrePolizasDetalle(dr("CvePrePolizaDetalle").ToString.ToEntero, dr("Concepto").ToString, dr("CveSubProyecto").ToString.ToEntero, dr("IdCtaContable").ToString.ToEntero, CBool(dr("TipoMovto").ToString), 0, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||||
ErrorCancelar = True : Exit For
|
ErrorCancelar = True : Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -18103,109 +18108,125 @@ Partial Class Compras_Compras
|
|||||||
ActualizaTotales = True
|
ActualizaTotales = True
|
||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
Dim TieneError As Boolean = False
|
Dim TieneError As Boolean = False
|
||||||
Dim Mensaje As String = ""
|
Dim dttemp As New DataTable ' GlobalDTContratos().FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString))
|
||||||
Dim dttemp As DataTable = Nothing ' GlobalDTContratos(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString))
|
dttemp.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||||
If dttemp IsNot Nothing AndAlso dttemp.Rows.Count > 0 Then
|
dttemp.Columns.Add("CvePS", GetType(Integer))
|
||||||
Dim drContrato As DataRow = dttemp.Rows(0)
|
dttemp.Columns.Add("Cantidad", GetType(Decimal))
|
||||||
If ObjContratos.GetContratosDetalle(drContrato("CveContrato").ToString.ToEntero) Then
|
dttemp.Columns.Add("PU", GetType(Decimal))
|
||||||
Dim dtContratodetalle As DataTable = ObjContratos.DtResultados.FiltraParametros(String.Format("CvePS = {0}", DdlPS.SelectedValue.ToString))
|
|
||||||
If dtContratodetalle IsNot Nothing AndAlso dtContratodetalle.Rows.Count > 0 Then
|
Dim DrPS = dttemp.NewRow
|
||||||
Dim drContratoDetalle As DataRow = dtContratodetalle(0)
|
DrPS("CveSubProyecto") = DdlSubProyecto.SelectedValue.ToString.ToEntero
|
||||||
If Convert.ToBoolean(drContratoDetalle("LimitarCantidad")) Then
|
DrPS("CvePS") = DdlPS.SelectedValue.ToString.ToEntero
|
||||||
If ObjContratos.GetReporteContratosAvancesDetalleControl(drContrato("CveContrato").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
DrPS("Cantidad") = TxtCantidad.Text.Trim.ToDecimal
|
||||||
Dim dtContratodetalleControl As DataTable = ObjContratos.DtResultados.FiltraParametros(String.Format("CvePS = {0}", DdlPS.SelectedValue.ToString))
|
DrPS("PU") = TxtPrecio.Text.Trim.ToDecimal
|
||||||
If dtContratodetalleControl IsNot Nothing AndAlso dtContratodetalleControl.Rows.Count > 0 Then
|
dttemp.Rows.Add(DrPS)
|
||||||
Dim drContratoDetalleControl As DataRow = dtContratodetalleControl(0)
|
|
||||||
If TxtCantidad.Text.Trim.ToDouble > drContratoDetalleControl("FaltanteCantidad").ToString.ToDouble Then
|
Dim dtPSInvalidos As String = ValidarPSContrato(dttemp)
|
||||||
Mensaje = String.Format("La cantidad del Producto/Servicio debe ser menor o igual a {0}", drContratoDetalleControl("FaltanteCantidad").ToString)
|
If dtPSInvalidos <> "" Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
Else
|
'If dttemp IsNot Nothing AndAlso dttemp.Rows.Count > 0 Then
|
||||||
Mensaje = "Este producto no pertenece al contrato seleccionado."
|
' Dim drContrato As DataRow = dttemp.Rows(0)
|
||||||
TieneError = True
|
' If ObjContratos.GetContratosDetalle(drContrato("CveContrato").ToString.ToEntero) Then
|
||||||
|
' Dim dtContratodetalle As DataTable = ObjContratos.DtResultados.FiltraParametros(String.Format("CvePS = {0}", DdlPS.SelectedValue.ToString))
|
||||||
|
' If dtContratodetalle IsNot Nothing AndAlso dtContratodetalle.Rows.Count > 0 Then
|
||||||
|
' Dim drContratoDetalle As DataRow = dtContratodetalle(0)
|
||||||
|
' If Convert.ToBoolean(drContratoDetalle("LimitarCantidad")) Then
|
||||||
|
' If ObjContratos.GetReporteContratosAvancesDetalleControl(drContrato("CveContrato").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||||
|
' Dim dtContratodetalleControl As DataTable = ObjContratos.DtResultados.FiltraParametros(String.Format("CvePS = {0}", DdlPS.SelectedValue.ToString))
|
||||||
|
' If dtContratodetalleControl IsNot Nothing AndAlso dtContratodetalleControl.Rows.Count > 0 Then
|
||||||
|
' Dim drContratoDetalleControl As DataRow = dtContratodetalleControl(0)
|
||||||
|
' If TxtCantidad.Text.Trim.ToDouble > drContratoDetalleControl("FaltanteCantidad").ToString.ToDouble Then
|
||||||
|
' Mensaje = String.Format("La cantidad del Producto/Servicio debe ser menor o igual a {0}", drContratoDetalleControl("FaltanteCantidad").ToString)
|
||||||
|
' TieneError = True
|
||||||
|
' End If
|
||||||
|
' Else
|
||||||
|
' Mensaje = "Este producto no pertenece al contrato seleccionado."
|
||||||
|
' TieneError = True
|
||||||
|
' End If
|
||||||
|
' Else
|
||||||
|
' Mensaje = "Error al consultar el contrato."
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' Else
|
||||||
|
' Mensaje = "Este producto no pertenece al contrato seleccionado."
|
||||||
|
' TieneError = True
|
||||||
|
' End If
|
||||||
|
' Else
|
||||||
|
' Mensaje = "Error al consultar el contrato."
|
||||||
|
|
||||||
|
' End If
|
||||||
|
'End If
|
||||||
|
ObjContratos.Dispose()
|
||||||
|
If Not TieneError Then
|
||||||
|
Select Case Modalidad
|
||||||
|
Case "A" 'ADD
|
||||||
|
|
||||||
|
Dim SATClavePS = -1
|
||||||
|
Dim PSRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("")
|
||||||
|
If PSRow IsNot Nothing Then
|
||||||
|
SATClavePS = PSRow("SATClavePS").ToString.ToEntero
|
||||||
End If
|
End If
|
||||||
Else
|
Dim IVA As Double
|
||||||
Mensaje = "Error al consultar el contrato."
|
If chkImportacion.Checked Then
|
||||||
End If
|
IVA = (txtImportacion.Text.Trim.ToDouble / (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.Trim.ToDouble))
|
||||||
|
Else
|
||||||
|
IVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2)
|
||||||
|
End If
|
||||||
|
AddPS(TxtCantidad.Text.Trim.ToDouble, ddlUM.SelectedValue.ToEntero, ddlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, HdnTipoPS.Value.ToEntero,
|
||||||
|
DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDouble, Total, IVA,
|
||||||
|
TxtRetIVAModal.Text.ToDouble / 100, TxtRetISRModal.Text.ToDouble / 100, TxtIEPSModal.Text.ToDouble / 100, 0, TxtDescuentoModal.Text.ToDouble, OtrosGastos:=TxtOtrosGastos.Text.ToDouble, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text,
|
||||||
|
NoDeducible:=ChkEsNoDeduciblePS.Checked, CveSATPS:=SATClavePS)
|
||||||
|
|
||||||
|
AddPS2()
|
||||||
|
LimpiaAgregar()
|
||||||
|
|
||||||
|
If ChkAgregar.Checked = True And Modalidad = "A" Then
|
||||||
|
RegistraScript("displayToastr(1);", "display")
|
||||||
|
Else
|
||||||
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddProducto"))
|
||||||
|
End If
|
||||||
|
|
||||||
|
Case "U" 'UPDATE
|
||||||
|
UpdatePS()
|
||||||
|
Alert("Concepto actualizado Correctamente.", TipoMensaje.MsgInformacion)
|
||||||
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddProducto"))
|
||||||
|
End Select
|
||||||
|
ActualizaTotales = False
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(562).ToEntero > 0 Then CargaGastosServicios(UsuarioActual.Empresa.Funcionalidad(562).ToEntero)
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.UsaAC Then
|
||||||
|
CompruebaAgregar()
|
||||||
|
GuardaAC()
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Mensaje = "Este producto no pertenece al contrato seleccionado."
|
Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia)
|
||||||
TieneError = True
|
|
||||||
End If
|
End If
|
||||||
Else
|
|
||||||
Mensaje = "Error al consultar el contrato."
|
|
||||||
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
ObjContratos.Dispose()
|
|
||||||
If Not TieneError Then
|
|
||||||
Select Case Modalidad
|
|
||||||
Case "A" 'ADD
|
|
||||||
|
|
||||||
Dim SATClavePS = -1
|
'If UsuarioActual.Empresa.Funcionalidad(577).ToString = "1" Then
|
||||||
Dim PSRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("")
|
|
||||||
If PSRow IsNot Nothing Then
|
|
||||||
SATClavePS = PSRow("SATClavePS").ToString.ToEntero
|
|
||||||
End If
|
|
||||||
Dim IVA As Double
|
|
||||||
If chkImportacion.Checked Then
|
|
||||||
IVA = (txtImportacion.Text.Trim.ToDouble / (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.Trim.ToDouble))
|
|
||||||
Else
|
|
||||||
IVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2)
|
|
||||||
End If
|
|
||||||
AddPS(TxtCantidad.Text.Trim.ToDouble, ddlUM.SelectedValue.ToEntero, ddlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, HdnTipoPS.Value.ToEntero,
|
|
||||||
DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDouble, Total, IVA,
|
|
||||||
TxtRetIVAModal.Text.ToDouble / 100, TxtRetISRModal.Text.ToDouble / 100, TxtIEPSModal.Text.ToDouble / 100, 0, TxtDescuentoModal.Text.ToDouble, OtrosGastos:=TxtOtrosGastos.Text.ToDouble, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text,
|
|
||||||
NoDeducible:=ChkEsNoDeduciblePS.Checked, CveSATPS:=SATClavePS)
|
|
||||||
|
|
||||||
AddPS2()
|
' 'If UsuarioActual.CveRol = 1 Then
|
||||||
LimpiaAgregar()
|
' ' Alert($"Ok funcionalidad 577 RetencionIVA { RetencionIVA} IVAOriginal {IVAOriginal}")
|
||||||
|
' 'End If
|
||||||
|
|
||||||
If ChkAgregar.Checked = True And Modalidad = "A" Then
|
' If RetencionIVA = 0 And IVAOriginal > 0 Then
|
||||||
RegistraScript("displayToastr(1);", "display")
|
' For Each dRow As DataRow In TmpDT.Rows
|
||||||
Else
|
' If dRow("CveTipoPS").ToString.ToEntero = 1 Then
|
||||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddProducto"))
|
' 'Comnetado para reubicar el boton
|
||||||
End If
|
' 'tdIVA6.Visible = True
|
||||||
|
' Exit For
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
' End If
|
||||||
|
|
||||||
Case "U" 'UPDATE
|
'End If
|
||||||
UpdatePS()
|
|
||||||
Alert("Concepto actualizado Correctamente.", TipoMensaje.MsgInformacion)
|
|
||||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddProducto"))
|
|
||||||
End Select
|
|
||||||
ActualizaTotales = False
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(562).ToEntero > 0 Then CargaGastosServicios(UsuarioActual.Empresa.Funcionalidad(562).ToEntero)
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
|
||||||
CompruebaAgregar()
|
|
||||||
GuardaAC()
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
Alert(Mensaje, TipoMensaje.MsgAdvertencia)
|
|
||||||
End If
|
|
||||||
|
|
||||||
'If UsuarioActual.Empresa.Funcionalidad(577).ToString = "1" Then
|
|
||||||
|
|
||||||
' 'If UsuarioActual.CveRol = 1 Then
|
|
||||||
' ' Alert($"Ok funcionalidad 577 RetencionIVA { RetencionIVA} IVAOriginal {IVAOriginal}")
|
|
||||||
' 'End If
|
|
||||||
|
|
||||||
' If RetencionIVA = 0 And IVAOriginal > 0 Then
|
|
||||||
' For Each dRow As DataRow In TmpDT.Rows
|
|
||||||
' If dRow("CveTipoPS").ToString.ToEntero = 1 Then
|
|
||||||
' 'Comnetado para reubicar el boton
|
|
||||||
' 'tdIVA6.Visible = True
|
|
||||||
' Exit For
|
|
||||||
' End If
|
|
||||||
' Next
|
|
||||||
' End If
|
|
||||||
|
|
||||||
'End If
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UpPS.Update()
|
UpPS.Update()
|
||||||
CargaGvPersonal()
|
CargaGvPersonal()
|
||||||
End Sub
|
End Sub
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Regresa el INDEX del row que acaba de agregar en el TMPDT
|
''' Regresa el INDEX del row que acaba de agregar en el TMPDT
|
||||||
@@ -20777,7 +20798,7 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
|
|
||||||
DdlContratosObra.Items.Clear()
|
DdlContratosObra.Items.Clear()
|
||||||
DdlContratosObra.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
|
DdlContratosObra.DataSource = GlobalDTContratos(UsuarioActual.CveEmpresa).FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
|
||||||
DdlContratosObra.DataBind()
|
DdlContratosObra.DataBind()
|
||||||
DdlContratosObra.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
DdlContratosObra.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
|
||||||
@@ -20894,6 +20915,41 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
Private Function ValidarPSContrato(DtPS As DataTable) As String
|
||||||
|
Dim Retorno As String = ""
|
||||||
|
Dim objContratos As New ClsContratos
|
||||||
|
Dim TempPS As String = JsonConvert.SerializeObject(DtPS).ToString
|
||||||
|
Dim MensajeProducto As String = ""
|
||||||
|
Dim MensajeCantidad As String = ""
|
||||||
|
Dim MensajeImporte As String = ""
|
||||||
|
If objContratos.ValidaPSContrato(TempPS) Then
|
||||||
|
If objContratos.DtResultados.Rows.Count > 0 Then
|
||||||
|
MensajeProducto = "Los siguientes productos no pertenece al contrato seleccionado: "
|
||||||
|
MensajeCantidad = "Los siguientes productos sobrepasan la cantidad faltante del contrato seleccionado: "
|
||||||
|
MensajeImporte = "Los siguientes productos sobrepasan los importes faltantes del contrato seleccionado: "
|
||||||
|
For Each dr As DataRow In objContratos.DtResultados.Rows
|
||||||
|
If dr("ProductoNoContratado").ToString.ToEntero = 1 Then
|
||||||
|
MensajeProducto += String.Format("<br/> {0}", dr("PS"))
|
||||||
|
ElseIf dr("CantidadSobrePasada").ToString.ToEntero = 1 Then
|
||||||
|
MensajeCantidad += String.Format("<br/> {0} - Cantidad maxima: {1}", dr("PS"), dr("FaltanteCantidad"))
|
||||||
|
ElseIf dr("ImporteSobrePasado").ToString.ToEntero = 1 Then
|
||||||
|
MensajeImporte += String.Format("<br/> {0} - Importe maximo: {1}", dr("PS"), dr("FaltanteImporte"))
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If MensajeProducto.Length <> 64 Then
|
||||||
|
Retorno = MensajeProducto
|
||||||
|
ElseIf MensajeCantidad.Length <> 84 Then
|
||||||
|
Retorno = MensajeCantidad
|
||||||
|
ElseIf MensajeImporte.Length <> 86 Then
|
||||||
|
Retorno = MensajeImporte
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|||||||
@@ -649,63 +649,14 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
|||||||
Dim IncluyePS, ExcluyePS, IncluyeClasificacion, ExcluyeClasificacion, IncluyeProveedor As New StringBuilder
|
Dim IncluyePS, ExcluyePS, IncluyeClasificacion, ExcluyeClasificacion, IncluyeProveedor As New StringBuilder
|
||||||
Dim ObjInventario As New ClsInventarios
|
Dim ObjInventario As New ClsInventarios
|
||||||
|
|
||||||
If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetInventarioFisicoUniversoProductos(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||||
Dim dt As DataTable = ObjInventario.DtResultados
|
|
||||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
|
||||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
|
|
||||||
IncluyeClasificacion.AppendFormat("{0},", dr("CveClasificacion"))
|
|
||||||
Next
|
|
||||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 0").Rows
|
|
||||||
ExcluyeClasificacion.AppendFormat("{0},", dr("CveClasificacion"))
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjInventario.GetInventarioFisicoDetallesProductosServicios(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
|
||||||
Dim dt As DataTable = ObjInventario.DtResultados
|
|
||||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
|
||||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
|
|
||||||
IncluyePS.AppendFormat("{0},", dr("CvePS"))
|
|
||||||
Next
|
|
||||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 0").Rows
|
|
||||||
ExcluyePS.AppendFormat("{0},", dr("CvePS"))
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
If ObjInventario.GetInventarioFisicoDetallesProveedores(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
|
||||||
Dim dt As DataTable = ObjInventario.DtResultados
|
|
||||||
Dim str As New StringBuilder
|
|
||||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
|
||||||
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
|
|
||||||
IncluyeProveedor.AppendFormat("{0},", dr("CveProveedor"))
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Dim dtPS As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa)
|
|
||||||
If IncluyePS.ToString <> "" Then
|
|
||||||
dtPS = dtPS.FiltraParametros(String.Format("CvePS IN ({0})", IncluyePS.ToString.TrimEnd(",")))
|
|
||||||
End If
|
|
||||||
If ExcluyePS.ToString <> "" Then
|
|
||||||
dtPS = dtPS.FiltraParametros(String.Format("CvePS NOT IN ({0})", ExcluyePS.ToString.TrimEnd(",")))
|
|
||||||
End If
|
|
||||||
If IncluyeClasificacion.ToString <> "" Then
|
|
||||||
dtPS = dtPS.FiltraParametros(String.Format("CveClasificacion IN ({0})", IncluyeClasificacion.ToString.TrimEnd(",")))
|
|
||||||
End If
|
|
||||||
If ExcluyeClasificacion.ToString <> "" Then
|
|
||||||
dtPS = dtPS.FiltraParametros(String.Format("CveClasificacion NOT IN ({0})", ExcluyeClasificacion.ToString.TrimEnd(",")))
|
|
||||||
End If
|
|
||||||
If IncluyeProveedor.ToString <> "" Then
|
|
||||||
dtPS = dtPS.FiltraParametros(String.Format("CveProveedorCompra IN ({0})", IncluyeProveedor.ToString.TrimEnd(",")))
|
|
||||||
End If
|
|
||||||
dtPS = dtPS.FiltraParametros("", "PS", {"Codigo", "PS", "Clasificacion", "ProveedorCompra"})
|
|
||||||
Dim NombreArchivo As String
|
Dim NombreArchivo As String
|
||||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||||
Dim workbook As New ExcelFile()
|
Dim workbook As New ExcelFile()
|
||||||
Dim worksheet = workbook.Worksheets.Add("Productos")
|
Dim worksheet = workbook.Worksheets.Add("Productos")
|
||||||
worksheet.InsertDataTable(dtPS, New InsertDataTableOptions() With
|
worksheet.InsertDataTable(ObjInventario.DtResultados, New InsertDataTableOptions() With
|
||||||
{
|
{
|
||||||
.ColumnHeaders = True,
|
.ColumnHeaders = True,
|
||||||
.StartRow = 0,
|
.StartRow = 0,
|
||||||
|
|||||||
@@ -109,7 +109,31 @@
|
|||||||
|
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
<asp:UpdatePanel ID="UpFiltros" runat="server" RenderMode="Inline" ViewStateMode="Inherit" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||||
|
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||||
|
<div class="tools">
|
||||||
|
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||||
|
</div>
|
||||||
|
<div class="titlefiltros caption">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-1 truncate">Ver por:</div>
|
||||||
|
<div class="col-md-1">
|
||||||
|
<asp:DropDownList ID="DdlGPO" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" Width="100%">
|
||||||
|
<asp:ListItem Text="Detalle" Value="1"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="Cantidad" Value="2"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body" style="display: none;">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ Partial Class Inventarios_RepAnomalias
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If EsAvance Then
|
If EsAvance Then
|
||||||
If Inventario.GetInventarioFisicoResultadosAvance(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
If Inventario.GetInventarioFisicoResultadosAvance(CveInventarioFisico, UsuarioActual.CveEmpresa, DdlGPO.SelectedValue.ToString.ToEntero) Then
|
||||||
dt = Inventario.DtResultados
|
dt = Inventario.DtResultados
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
@@ -206,6 +206,11 @@ Partial Class Inventarios_RepAnomalias
|
|||||||
End If
|
End If
|
||||||
Inventarios.Dispose()
|
Inventarios.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||||
|
CargaDatos(CveInventarioFisico)
|
||||||
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user