Merge -- Empresas
This commit is contained in:
@@ -2747,7 +2747,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row col-md-12" align="right" runat="server" id="divBusqueda" visible="false">
|
||||
<div class="row col-md-12" align="right" runat="server" id="divBusqueda" visible="false">
|
||||
<input type="text" id="TxtBusqueda3" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda3','{0}');", GvContratosControl.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda3','{0}');", GvContratosControl.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
@@ -2781,7 +2781,7 @@
|
||||
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtImporte" Text="" data-cve='<%# Eval("CveContratoDetalle") %>' CssClass="txtimporte" type="number" step="any" Width="90" runat="server" onkeydown="keydownenabledtab(event)"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtImporte" Text="" data-cve='<%# Eval("CveContratoDetalle") %>' CssClass="txtimporte" type="number" step="any" Width="90" runat="server" ></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
272
OC/OC.aspx.vb
272
OC/OC.aspx.vb
@@ -4,6 +4,7 @@ Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports System.IO
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
Partial Class OC
|
||||
Inherits ClsPaginas
|
||||
@@ -2095,141 +2096,122 @@ Partial Class OC
|
||||
End If
|
||||
|
||||
'Valida cantidad en contrato
|
||||
Dim ObjContratos As New ClsContratos
|
||||
|
||||
Dim TieneError As Boolean = False
|
||||
Dim Mensaje As String = ""
|
||||
Dim dttemp As DataTable = Nothing 'GlobalDTContratos(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString))
|
||||
If dttemp IsNot Nothing AndAlso dttemp.Rows.Count > 0 Then
|
||||
Dim drContrato As DataRow = dttemp.Rows(0)
|
||||
If ObjContratos.GetContratosDetalle(drContrato("CveContrato").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
Dim dtContratodetalle As DataTable = ObjContratos.DtResultados.FiltraParametros(String.Format("CvePS = {0}", DdlP2.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}", DdlP2.SelectedValue.ToString))
|
||||
If dtContratodetalleControl IsNot Nothing AndAlso dtContratodetalleControl.Rows.Count > 0 Then
|
||||
Dim drContratoDetalleControl As DataRow = dtContratodetalleControl(0)
|
||||
If TxtCant.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 pertence al contrato seleccionado"
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
Mensaje = "Error al consultar el contrato"
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Mensaje = "Este producto no pertence al contrato seleccionado"
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
Mensaje = "Error al consultar el contrato"
|
||||
Dim dttemp As New DataTable ' GlobalDTContratos().FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString))
|
||||
dttemp.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||
dttemp.Columns.Add("CvePS", GetType(Integer))
|
||||
dttemp.Columns.Add("Cantidad", GetType(Decimal))
|
||||
dttemp.Columns.Add("PU", GetType(Decimal))
|
||||
|
||||
Dim DrPSValidar = dttemp.NewRow
|
||||
DrPSValidar("CveSubProyecto") = DdlSubProyecto.SelectedValue.ToString.ToEntero
|
||||
DrPSValidar("CvePS") = DdlP2.SelectedValue.ToString.ToEntero
|
||||
DrPSValidar("Cantidad") = TxtCant.Text.Trim.ToDecimal
|
||||
DrPSValidar("PU") = txtPrecioUnitario.Text.Trim.ToDecimal
|
||||
dttemp.Rows.Add(DrPSValidar)
|
||||
If UsuarioActual.Empresa.Funcionalidad(545) = "1" Then
|
||||
Dim dtPSInvalidos As String = ValidarPSContrato(dttemp)
|
||||
If dtPSInvalidos <> "" Then
|
||||
Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
|
||||
ObjContratos.Dispose()
|
||||
If DtDetalle IsNot Nothing Then
|
||||
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=DdlP2.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
If DrPS Is Nothing Then
|
||||
Alert("Ocurrió un error al cargar la información del producto. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
|
||||
Dim ObjCon As New ClsContratos
|
||||
Dim CvePresupuesto As Integer = 0
|
||||
Dim Autorizado As Double = 0
|
||||
Dim Ejercido As Double = 0
|
||||
If ObjCon.GetPresupuestos(-1, "-1", DdlSubProyecto.SelectedValue.ToEntero, 2, -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjCon.DtResultados.Rows.Count > 0 Then
|
||||
CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero
|
||||
If CvePresupuesto > 0 Then
|
||||
If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows.Count > 0 Then
|
||||
Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows(0)("Importe").ToString.ToDouble
|
||||
End If
|
||||
If DtDetalle IsNot Nothing Then
|
||||
Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=DdlP2.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
If DrPS Is Nothing Then
|
||||
Alert("Ocurrió un error al cargar la información del producto. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
|
||||
Dim ObjCon As New ClsContratos
|
||||
Dim CvePresupuesto As Integer = 0
|
||||
Dim Autorizado As Double = 0
|
||||
Dim Ejercido As Double = 0
|
||||
If ObjCon.GetPresupuestos(-1, "-1", DdlSubProyecto.SelectedValue.ToEntero, 2, -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjCon.DtResultados.Rows.Count > 0 Then
|
||||
CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero
|
||||
If CvePresupuesto > 0 Then
|
||||
If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows.Count > 0 Then
|
||||
Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows(0)("Importe").ToString.ToDouble
|
||||
End If
|
||||
If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero,
|
||||
DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
|
||||
If ObjCon.DtResultados.Rows.Count > 0 Then
|
||||
Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDouble
|
||||
End If
|
||||
End If
|
||||
If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero,
|
||||
DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
|
||||
If ObjCon.DtResultados.Rows.Count > 0 Then
|
||||
Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDouble
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
ObjCon.Dispose()
|
||||
End If
|
||||
ObjCon.Dispose()
|
||||
|
||||
If CvePresupuesto > 0 And Autorizado > 0 Then
|
||||
Dim Diferencia As Double = (Ejercido + If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0)) - Autorizado
|
||||
If Diferencia > 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{DdlSubProyecto.SelectedItem.Text}</b> y la clasificación <b>{DdlClasificacion.SelectedItem.Text}</b> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If CvePresupuesto > 0 And Autorizado > 0 Then
|
||||
Dim Diferencia As Double = (Ejercido + If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0)) - Autorizado
|
||||
If Diferencia > 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{DdlSubProyecto.SelectedItem.Text}</b> y la clasificación <b>{DdlClasificacion.SelectedItem.Text}</b> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Dim RetISR As Double = DrPS("RetISR").ToString.ToDouble
|
||||
Dim RetIVA As Double = DrPS("RetIVA").ToString.ToDouble
|
||||
Dim IvaPS As Double = DrPS("IVA").ToString.ToDouble
|
||||
|
||||
'If IvaPS = -1 Then 'IVA DE LA SUCURSAL
|
||||
' IvaPS = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero).FiltroPrimeroValor("IVA").ToDouble
|
||||
'End If
|
||||
|
||||
Dim IEPSPS As Double = DrPS("IEPSPorcentaje").ToString.ToDouble
|
||||
Dim IEPSPSIVA As Double = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0)
|
||||
Dim IdCuentaPorEjercer As Integer = If(HdnCveCuentaPorEjercer.Value = String.Empty, -1, HdnCveCuentaPorEjercer.Value.ToEntero)
|
||||
Dim IdCuentaComprometido As Integer = If(HdnCveCuentaComprometido.Value = String.Empty, -1, HdnCveCuentaComprometido.Value.ToEntero)
|
||||
Dim Proyecto As String = If(DdlProyecto.SelectedValue.ToString.ToEntero > 0, DdlProyecto.SelectedItem.Text, "Sin Proyecto")
|
||||
Dim SubProyecto As String = If(DdlSubProyecto.SelectedValue.ToString.ToEntero > 0, DdlSubProyecto.SelectedItem.Text, "Sin SubProyecto")
|
||||
Dim TotalPS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0)
|
||||
Dim ImportePS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, txtPrecioUnitario.Text.ToDouble, 0)
|
||||
Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100
|
||||
|
||||
'Si es Proveedor Extranjero el IVA es 0%
|
||||
If GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {DdlProveedores.SelectedValue} AND RFC = 'XEXX010101000'").Rows.Count = 1 Then
|
||||
IvaPS = 0
|
||||
End If
|
||||
|
||||
AddPS(TxtCant.Text, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDouble, TotalPS,
|
||||
CboUnidadMedida.SelectedValue.ToEntero, IvaPS, IEPSPS, IEPSPSIVA, DdlClasificacion.SelectedValue.ToEntero, CboUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero, Proyecto,
|
||||
DdlSubProyecto.SelectedValue.ToEntero, SubProyecto, LblCodigo.Text, HdnCveActivoFijo.Value.ToEntero, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer,
|
||||
IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero,
|
||||
DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR, CveCultivoCuadroDetalle:=DdlCultivosCuadro.SelectedValue.ToEntero, Cuadro:=DdlCultivosCuadro.SelectedItem.Text)
|
||||
|
||||
TxtCant.Text = ""
|
||||
CboUnidadMedida.SelectedIndex = 0
|
||||
DdlClasificacion.SelectedIndex = 0
|
||||
DdlP2.SelectedValue = "-1"
|
||||
DdlP2.SelectedText = "Seleccione un producto o servicio"
|
||||
txtPrecioUnitario.Text = ""
|
||||
TxtObsPS.Text = ""
|
||||
HdnCveActivoFijo.Value = ""
|
||||
LblCodigo.Text = ""
|
||||
LblCvePOA.Text = ""
|
||||
TxtCant.Focus()
|
||||
|
||||
Total.Text = "0.00"
|
||||
TxtDescuentoAdd.Text = "0.00"
|
||||
|
||||
End If
|
||||
|
||||
CargaSuperior()
|
||||
CargaDatosDetalles()
|
||||
|
||||
UPPDetalle.Update()
|
||||
Else
|
||||
Alert(Mensaje, TipoMensaje.MsgAdvertencia)
|
||||
Dim RetISR As Double = DrPS("RetISR").ToString.ToDouble
|
||||
Dim RetIVA As Double = DrPS("RetIVA").ToString.ToDouble
|
||||
Dim IvaPS As Double = DrPS("IVA").ToString.ToDouble
|
||||
|
||||
'If IvaPS = -1 Then 'IVA DE LA SUCURSAL
|
||||
' IvaPS = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero).FiltroPrimeroValor("IVA").ToDouble
|
||||
'End If
|
||||
|
||||
Dim IEPSPS As Double = DrPS("IEPSPorcentaje").ToString.ToDouble
|
||||
Dim IEPSPSIVA As Double = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0)
|
||||
Dim IdCuentaPorEjercer As Integer = If(HdnCveCuentaPorEjercer.Value = String.Empty, -1, HdnCveCuentaPorEjercer.Value.ToEntero)
|
||||
Dim IdCuentaComprometido As Integer = If(HdnCveCuentaComprometido.Value = String.Empty, -1, HdnCveCuentaComprometido.Value.ToEntero)
|
||||
Dim Proyecto As String = If(DdlProyecto.SelectedValue.ToString.ToEntero > 0, DdlProyecto.SelectedItem.Text, "Sin Proyecto")
|
||||
Dim SubProyecto As String = If(DdlSubProyecto.SelectedValue.ToString.ToEntero > 0, DdlSubProyecto.SelectedItem.Text, "Sin SubProyecto")
|
||||
Dim TotalPS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0)
|
||||
Dim ImportePS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, txtPrecioUnitario.Text.ToDouble, 0)
|
||||
Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100
|
||||
|
||||
'Si es Proveedor Extranjero el IVA es 0%
|
||||
If GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {DdlProveedores.SelectedValue} AND RFC = 'XEXX010101000'").Rows.Count = 1 Then
|
||||
IvaPS = 0
|
||||
End If
|
||||
|
||||
AddPS(TxtCant.Text, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDouble, TotalPS,
|
||||
CboUnidadMedida.SelectedValue.ToEntero, IvaPS, IEPSPS, IEPSPSIVA, DdlClasificacion.SelectedValue.ToEntero, CboUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero, Proyecto,
|
||||
DdlSubProyecto.SelectedValue.ToEntero, SubProyecto, LblCodigo.Text, HdnCveActivoFijo.Value.ToEntero, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer,
|
||||
IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero,
|
||||
DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR, CveCultivoCuadroDetalle:=DdlCultivosCuadro.SelectedValue.ToEntero, Cuadro:=DdlCultivosCuadro.SelectedItem.Text)
|
||||
|
||||
TxtCant.Text = ""
|
||||
CboUnidadMedida.SelectedIndex = 0
|
||||
DdlClasificacion.SelectedIndex = 0
|
||||
DdlP2.SelectedValue = "-1"
|
||||
DdlP2.SelectedText = "Seleccione un producto o servicio"
|
||||
txtPrecioUnitario.Text = ""
|
||||
TxtObsPS.Text = ""
|
||||
HdnCveActivoFijo.Value = ""
|
||||
LblCodigo.Text = ""
|
||||
LblCvePOA.Text = ""
|
||||
TxtCant.Focus()
|
||||
|
||||
Total.Text = "0.00"
|
||||
TxtDescuentoAdd.Text = "0.00"
|
||||
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
|
||||
CargaSuperior()
|
||||
CargaDatosDetalles()
|
||||
|
||||
UPPDetalle.Update()
|
||||
End Sub
|
||||
Private Sub AddPS(Cantidad As String, CvePS As Integer, PS As String, Observaciones As String, Importe As Double, Descuento As Double, Total As Double, CveUnidadMedida As Integer, IVAPS As Double, IEPSPS As Double, IEPSPSIVA As Double, CveClasificacion As Integer,
|
||||
UM As String, Clasificacion As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, CodigoAF As String, CveActivoFijo As Integer, TipoDato As Integer,
|
||||
@@ -2505,6 +2487,15 @@ Partial Class OC
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(545) = "1" Then
|
||||
Dim dtPSInvalidos As String = ValidarPSContrato(DtDetalle.FiltraParametros("", "", {"CveSubProyecto", "CvePS", "Cantidad", "PU"}))
|
||||
If dtPSInvalidos <> "" Then
|
||||
Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia)
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Return TieneError
|
||||
End Function
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
@@ -6369,8 +6360,8 @@ Partial Class OC
|
||||
Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
|
||||
If TxtExcel.getfiles().Archivos.Count > 0 Then
|
||||
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
|
||||
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
|
||||
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
|
||||
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path
|
||||
Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
|
||||
CargarArchivo(Directorio, file.filename, Tipo)
|
||||
Else
|
||||
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
|
||||
@@ -7746,7 +7737,7 @@ Partial Class OC
|
||||
Protected Sub BtnCargaExcelCot_Click(sender As Object, e As EventArgs)
|
||||
If TxtExcelCot.getfiles().Archivos.Count > 0 Then
|
||||
Dim file As Archivo = TxtExcelCot.getfiles().Archivos(0)
|
||||
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
|
||||
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path
|
||||
CargarArchivoCot(Directorio, file.filename)
|
||||
|
||||
CargaCotizaciones(CveOrdenCompra)
|
||||
@@ -8522,8 +8513,9 @@ Partial Class OC
|
||||
CargaSuperior()
|
||||
CargaDatosDetalles()
|
||||
|
||||
|
||||
RegistraScript("$('#DivmodalConmtrato').modal('hide')")
|
||||
If Not ChkContinualAgregandoControl.Checked Then
|
||||
RegistraScript("$('#DivmodalConmtrato').modal('hide')")
|
||||
End If
|
||||
UPPDetalle.Update()
|
||||
|
||||
|
||||
@@ -8544,4 +8536,40 @@ Partial Class OC
|
||||
DdlCultivosCuadroEdit.SelectedValueExist(CveCultivoCuadroDetalle)
|
||||
|
||||
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 Class
|
||||
|
||||
Reference in New Issue
Block a user