Compras Plantilla Prorrateo, Cat Secciones Tipo Operación, EMD Ajustes formatos almacén
This commit is contained in:
@@ -5741,6 +5741,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
|
|
||||||
<asp:UpdatePanel runat="server" ID="UpModalProrrateoGasolina" UpdateMode="Conditional">
|
<asp:UpdatePanel runat="server" ID="UpModalProrrateoGasolina" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
@@ -5753,6 +5755,11 @@
|
|||||||
<label>
|
<label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-6" style="text-align:right!important">
|
||||||
|
<asp:LinkButton ID="LnkProrrateoPlantilla" runat="server" CssClass="btn btn-success" OnClick="LnkProrrateoPlantilla_Click">
|
||||||
|
<i class="fa fa-upload" aria-hidden="true"></i> Cargar Plantilla
|
||||||
|
</asp:LinkButton>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" style="margin-top:10px">
|
<div class="row" style="margin-top:10px">
|
||||||
@@ -5830,6 +5837,10 @@
|
|||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<asp:UpdatePanel runat="server">
|
<asp:UpdatePanel runat="server">
|
||||||
@@ -5846,6 +5857,63 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<%--CARGA PRORRATEO PLANTILLA--%>
|
||||||
|
<div id="DVModalProrrateoPlantilla" class="modal ADS fade" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header ">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">Carga Plantilla Prorrateo</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<asp:UpdatePanel ID="UpDropZoneProrrateoPlantilla" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-11" style="margin-left: 30px; margin-right: 30px;">
|
||||||
|
<asp:TextBox ID="TxtExcelProrrateo" CssClass="ADSdropzone hidden" Text="" data-maxFile="1" runat="server"></asp:TextBox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<asp:UpdatePanel ID="UpDescargarProrrateoPlantilla" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2" style="text-align: left">
|
||||||
|
<asp:LinkButton ID="LnkDescargaPlatillaProrrateo" runat="server" CssClass="btn btn-warning" OnClick="LnkDescargaPlatillaProrrateo_Click">
|
||||||
|
<i class="fa fa-download" aria-hidden="true"></i> Descargar Plantilla
|
||||||
|
</asp:LinkButton>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-10" style="text-align: right">
|
||||||
|
<asp:Button ID="BtnAddProrrateoPlantilla" runat="server" CssClass="btn btn-success" Text="Aceptar" OnClick="BtnAddProrrateoPlantilla_Click"></asp:Button>
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
<Triggers>
|
||||||
|
<asp:PostBackTrigger ControlID="LnkDescargaPlatillaProrrateo" />
|
||||||
|
</Triggers>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div style="display:none">
|
<div style="display:none">
|
||||||
<asp:UpdatePanel runat="server">
|
<asp:UpdatePanel runat="server">
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ Imports MoreLinq
|
|||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports ClsPaginas
|
Imports ClsPaginas
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
|
Imports Microsoft.Owin.Security.Provider
|
||||||
|
|
||||||
|
|
||||||
Partial Class Compras_Compras
|
Partial Class Compras_Compras
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -8028,102 +8030,111 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ErrorPrepoliza AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=OpValidacion, AutoConta:=AutoConta) Then
|
If Not ErrorPrepoliza AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=OpValidacion, AutoConta:=AutoConta) Then
|
||||||
|
TieneError = True
|
||||||
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
|
Alert($"{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia}", TipoMensaje.MsgError)
|
||||||
|
ErrorPrepolizaDescuadre = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(574) = "1" AndAlso (ImporteRNC > 0 OrElse ImporteRNCProntoPago > 0) Then
|
||||||
|
|
||||||
|
If ImporteRNC > 0 AndAlso Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraActual, ObjConta, CvePrePoliza, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate, $"Remisión Nota de Crédito {TxtDescripcion.Text}", ImporteRNC, DdlMoneda.SelectedValue.ToEntero, TxtTC.Text.ToDecimal,
|
||||||
|
TxtSerie.Text, TxtFolio.Text) Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
|
||||||
Alert($"{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia}", TipoMensaje.MsgError)
|
|
||||||
ErrorPrepolizaDescuadre = True
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(574) = "1" AndAlso (ImporteRNC > 0 OrElse ImporteRNCProntoPago > 0) Then
|
If ImporteRNCProntoPago > 0 AndAlso Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraActual, ObjConta, CvePrePoliza, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate, $"Remisión Nota de Crédito {TxtDescripcion.Text}", ImporteRNCProntoPago, DdlMoneda.SelectedValue.ToEntero, TxtTC.Text.ToDecimal,
|
||||||
|
TxtSerie.Text, TxtFolio.Text, PrefijoSerie:="PP") Then
|
||||||
If ImporteRNC > 0 AndAlso Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraActual, ObjConta, CvePrePoliza, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate, $"Remisión Nota de Crédito {TxtDescripcion.Text}", ImporteRNC, DdlMoneda.SelectedValue.ToEntero, TxtTC.Text.ToDecimal,
|
TieneError = True
|
||||||
TxtSerie.Text, TxtFolio.Text) Then
|
|
||||||
TieneError = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
If ImporteRNCProntoPago > 0 AndAlso Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraActual, ObjConta, CvePrePoliza, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate, $"Remisión Nota de Crédito {TxtDescripcion.Text}", ImporteRNCProntoPago, DdlMoneda.SelectedValue.ToEntero, TxtTC.Text.ToDecimal,
|
|
||||||
TxtSerie.Text, TxtFolio.Text, PrefijoSerie:="PP") Then
|
|
||||||
TieneError = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not TieneError Then
|
End If
|
||||||
ObjCompras.Commit()
|
|
||||||
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
|
|
||||||
|
|
||||||
Dim CveEvaluacionProveedor As Integer = -1
|
If Not TieneError Then
|
||||||
|
ObjCompras.Commit()
|
||||||
|
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
|
||||||
|
|
||||||
If Me.RequiereEvaluacion Then
|
Dim CveEvaluacionProveedor As Integer = -1
|
||||||
Dim ObjPro As New ClsCompProveedores()
|
|
||||||
CveEvaluacionProveedor = ObjPro.AddEvaluacionProveedor(CveProveedor, CveCompra, NowADS(), "", Me.CveUsuarioEvaluador, "", "", UsuarioActual.CveEmpresa)
|
|
||||||
ObjPro.Dispose()
|
|
||||||
End If
|
|
||||||
|
|
||||||
'ENVIO DE CORREO NOTIFICACION A VENDEDORES DE OC
|
If Me.RequiereEvaluacion Then
|
||||||
MandaCorreoOCVendedores(CveCompra)
|
Dim ObjPro As New ClsCompProveedores()
|
||||||
If Not ErrorMovInv Then
|
CveEvaluacionProveedor = ObjPro.AddEvaluacionProveedor(CveProveedor, CveCompra, NowADS(), "", Me.CveUsuarioEvaluador, "", "", UsuarioActual.CveEmpresa)
|
||||||
For Each intMovimientoAlmacen As Integer In ListaMovimientosAlmacen
|
ObjPro.Dispose()
|
||||||
MandaCorreoOCVendedoresRecepcionAlmacen(CveCompra, intMovimientoAlmacen)
|
End If
|
||||||
Next
|
|
||||||
End If
|
|
||||||
|
|
||||||
If CveEvaluacionProveedor > 0 Then
|
'ENVIO DE CORREO NOTIFICACION A VENDEDORES DE OC
|
||||||
Msg.Append("<br/><br/>El proveedor tiene evaluaciones pendientes<br/>")
|
MandaCorreoOCVendedores(CveCompra)
|
||||||
Msg.Append("¿Desea realizar una evaluación al proveedor?")
|
If Not ErrorMovInv Then
|
||||||
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>")
|
For Each intMovimientoAlmacen As Integer In ListaMovimientosAlmacen
|
||||||
End If
|
MandaCorreoOCVendedoresRecepcionAlmacen(CveCompra, intMovimientoAlmacen)
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
BtnGuardar.Enabled = False
|
<<<<<<< HEAD
|
||||||
UpFacturar.Update()
|
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
|
||||||
|
Else
|
||||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
|
ObjCompras.RollBack()
|
||||||
Else
|
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
||||||
ObjCompras.RollBack()
|
|
||||||
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
|
||||||
' Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
|
' Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
=======
|
||||||
|
If CveEvaluacionProveedor > 0 Then
|
||||||
|
Msg.Append("<br/><br/>El proveedor tiene evaluaciones pendientes<br/>")
|
||||||
|
Msg.Append("¿Desea realizar una evaluación al proveedor?")
|
||||||
|
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>")
|
||||||
|
End If
|
||||||
|
>>>>>>> Compras Plantilla Prorrateo, Cat Secciones Tipo Operación, EMD Ajustes formatos almacén
|
||||||
|
BtnGuardar.Enabled = False
|
||||||
|
UpFacturar.Update()
|
||||||
|
|
||||||
|
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
|
||||||
Else
|
Else
|
||||||
ObjCompras.RollBack()
|
ObjCompras.RollBack()
|
||||||
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
||||||
Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente..", TipoMensaje.MsgError)
|
Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Alert("Debe seleccionar un Funcionario/Empleado o Caja Chica para Reembolsos. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
|
||||||
ObjCompras.RollBack()
|
ObjCompras.RollBack()
|
||||||
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
||||||
|
Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente..", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Alert("Ocurrió un error al agregar el movimiento bancario.<br />Revise sus datos de pago y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
|
Alert("Debe seleccionar un Funcionario/Empleado o Caja Chica para Reembolsos. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||||
ObjCompras.RollBack()
|
ObjCompras.RollBack()
|
||||||
|
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
Alert("Ocurrió un error al agregar el movimiento bancario.<br />Revise sus datos de pago y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
|
||||||
|
ObjCompras.RollBack()
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ObjCompras.RollBack()
|
ObjCompras.RollBack()
|
||||||
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
||||||
Alert("Ocurrió un error al registrar la compra. Cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgError)
|
Alert("Ocurrió un error al registrar la compra. Cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgError)
|
||||||
GuardaLog($"Ocurrió un error al registrar la compra. Cualquier detalle comuníquese a Soporte Técnico : {ex}")
|
GuardaLog($"Ocurrió un error al registrar la compra. Cualquier detalle comuníquese a Soporte Técnico : {ex}")
|
||||||
ViewState("CveCompra") = -1
|
ViewState("CveCompra") = -1
|
||||||
End Try
|
End Try
|
||||||
ObjAcar.Dispose()
|
ObjAcar.Dispose()
|
||||||
ObjCompras.Dispose()
|
ObjCompras.Dispose()
|
||||||
ObjConta.Dispose()
|
ObjConta.Dispose()
|
||||||
ObjIE.Dispose()
|
ObjIE.Dispose()
|
||||||
ObjInventario.Dispose()
|
ObjInventario.Dispose()
|
||||||
ObjAF.Dispose()
|
ObjAF.Dispose()
|
||||||
ObjOC.Dispose()
|
ObjOC.Dispose()
|
||||||
ObjProveedores.Dispose()
|
ObjProveedores.Dispose()
|
||||||
ObjCGame.Dispose()
|
ObjCGame.Dispose()
|
||||||
ObjProductosServicios.Dispose()
|
ObjProductosServicios.Dispose()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -22946,7 +22957,7 @@ Partial Class Compras_Compras
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Sub AgregarProrrateoGasolina(CveSubProyecto As Integer, SubProyecto As String, CvePS As Integer, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String)
|
Private Sub AgregarProrrateoGasolina(CveSubProyecto As Integer, SubProyecto As String, CvePS As Integer, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, Optional PrecioProrrateo As Decimal = 0)
|
||||||
|
|
||||||
Dim SubTotalOriginal As Decimal = TxtSubTotal.Text.ToDecimal
|
Dim SubTotalOriginal As Decimal = TxtSubTotal.Text.ToDecimal
|
||||||
Dim IVAOriginal As Decimal = TxtIVA.Text.ToDecimal
|
Dim IVAOriginal As Decimal = TxtIVA.Text.ToDecimal
|
||||||
@@ -22956,6 +22967,10 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
Dim totalParcialDeseado As Decimal = TxtPrecioProrrateoGasolina.Text.ToDecimal
|
Dim totalParcialDeseado As Decimal = TxtPrecioProrrateoGasolina.Text.ToDecimal
|
||||||
|
|
||||||
|
If PrecioProrrateo > 0 Then
|
||||||
|
totalParcialDeseado = PrecioProrrateo
|
||||||
|
End If
|
||||||
|
|
||||||
Dim PorcentajeCalculado As Decimal = totalParcialDeseado / TotalOriginal
|
Dim PorcentajeCalculado As Decimal = totalParcialDeseado / TotalOriginal
|
||||||
|
|
||||||
Dim subtotalParcial As Decimal = SubTotalOriginal * PorcentajeCalculado
|
Dim subtotalParcial As Decimal = SubTotalOriginal * PorcentajeCalculado
|
||||||
@@ -23070,15 +23085,180 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub LnkProrrateoPlantilla_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
If DdlPSProrrateoGasolina.SelectedValue.ToEntero > 0 And TxtTotal.Text.ToDecimal > 0 Then
|
||||||
|
TxtExcelProrrateo.Text = "[]"
|
||||||
|
UpDropZoneProrrateoPlantilla.Update()
|
||||||
|
RegistraScript("$('#DVModalProrrateoPlantilla').modal('show');")
|
||||||
|
Else
|
||||||
|
|
||||||
|
If Not DdlPSProrrateoGasolina.SelectedValue.ToEntero > 0 Then
|
||||||
|
Alert("Debe seleccionar un producto.", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not TxtTotal.Text.ToDecimal > 0 Then
|
||||||
|
Alert("El total de la compra debe de ser mayor a 0.", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub LnkDescargaPlatillaProrrateo_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
|
||||||
|
Dim RutaPlantilla As String = ""
|
||||||
|
|
||||||
|
RutaPlantilla = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\PlantillaProrrateo.xlsx"
|
||||||
|
|
||||||
|
If Not (RutaPlantilla = "") Then
|
||||||
|
Dim Archivo As New IO.FileInfo(RutaPlantilla)
|
||||||
|
If Archivo.Exists Then
|
||||||
|
Response.Clear()
|
||||||
|
Response.ClearHeaders()
|
||||||
|
Response.ClearContent()
|
||||||
|
Response.AddHeader("Content-Disposition", "attachment; filename=" + Archivo.Name)
|
||||||
|
Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||||
|
Response.ContentType = "text/plain"
|
||||||
|
Response.Flush()
|
||||||
|
Response.TransmitFile(Archivo.FullName)
|
||||||
|
Response.End()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnAddProrrateoPlantilla_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
Dim ErrorPrceos As Boolean = False
|
||||||
|
|
||||||
|
If TxtExcelProrrateo.getfiles().Archivos.Count > 0 Then
|
||||||
|
Dim file As Archivo = TxtExcelProrrateo.getfiles().Archivos(0)
|
||||||
|
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path
|
||||||
|
Try
|
||||||
|
If Not CargarPlantillaProrrateo(Directorio, file.filename) Then
|
||||||
|
ErrorPrceos = True
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Else
|
||||||
|
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
|
||||||
|
ErrorPrceos = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorPrceos Then
|
||||||
|
If Not ErrorPrceos Then
|
||||||
|
RegistraScript("$('#DVModalProrrateoPlantilla').modal('hide');")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function CargarPlantillaProrrateo(directorio As String, filename As String) As Boolean
|
||||||
|
|
||||||
|
Dim DT As New DataTable
|
||||||
|
Dim ErrorProceso As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
|
Try
|
||||||
|
DT = ReadExcelFile(directorio + filename, True)
|
||||||
|
Catch ex As Exception
|
||||||
|
ErrorProceso = True
|
||||||
|
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
If Not ErrorProceso Then
|
||||||
|
|
||||||
|
Dim ContadorRow As Integer = 1
|
||||||
|
Dim SBErrores As New StringBuilder
|
||||||
|
|
||||||
|
For Each row As DataRow In DT.Rows
|
||||||
|
|
||||||
|
If row("SubProyecto").ToString.Length > 0 Then
|
||||||
|
|
||||||
|
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $" SubProyecto = '{row("SubProyecto").ToString}' ").ToEntero
|
||||||
|
Dim Importe As Decimal = row("Importe").ToString.ToDecimal
|
||||||
|
|
||||||
|
If Not CveSubProyecto > 0 Then
|
||||||
|
SBErrores.Append($"Fila: {ContadorRow} SubProyecto: {row("SubProyecto").ToString} no encontrado.<br/>")
|
||||||
|
ErrorProceso = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not Importe > 0 Then
|
||||||
|
SBErrores.Append($"Fila: {ContadorRow} Importe Invalido: { Importe } debe ser mayor a 0.<br/>")
|
||||||
|
ErrorProceso = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
ContadorRow = ContadorRow + 1
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
If Not ErrorProceso Then
|
||||||
|
|
||||||
|
DTProrrateoGasolina.Rows.Clear()
|
||||||
|
|
||||||
|
Dim CvePs As Integer = DdlPSProrrateoGasolina.SelectedValue.ToEntero
|
||||||
|
|
||||||
|
If Not CvePs > 0 Then
|
||||||
|
Alert("Debe seleccionar un producto", TipoMensaje.MsgAdvertencia)
|
||||||
|
ErrorProceso = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim PsRow As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePs).FiltroPrimero("")
|
||||||
|
|
||||||
|
If PsRow Is Nothing Then
|
||||||
|
Alert("No se encontro el producto", TipoMensaje.MsgAdvertencia)
|
||||||
|
ErrorProceso = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorProceso Then
|
||||||
|
Dim CveUM As Integer = PsRow("CveUM").ToString.ToEntero
|
||||||
|
Dim UM As String = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("UnidadMedida", $" CveUnidadMedida = {CveUM} ")
|
||||||
|
|
||||||
|
Dim CveClasificacion As Integer = PsRow("CveClasificacion").ToString.ToEntero
|
||||||
|
Dim Clasificacion As String = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $" CveClasificacion = {CveClasificacion} ")
|
||||||
|
|
||||||
|
For Each row As DataRow In DT.Rows
|
||||||
|
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $" SubProyecto = '{row("SubProyecto").ToString}' ").ToEntero
|
||||||
|
Dim Importe As Decimal = row("Importe").ToString.ToDecimal
|
||||||
|
AgregarProrrateoGasolina(CveSubProyecto, row("SubProyecto").ToString, CvePs, CveUM, UM, CveClasificacion, Clasificacion, PrecioProrrateo:=Importe)
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
Alert(SBErrores.ToString, TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If Not ErrorProceso Then
|
||||||
|
TxtPrecioProrrateoGasolina.Text = ""
|
||||||
|
DdlSubProyectoProrrateoGasolina.SelectedValueExist(-1)
|
||||||
|
UpModalProrrateoGasolina.Update()
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Return If(ErrorProceso, False, True)
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -345,7 +345,7 @@
|
|||||||
<Value>=Fields!Cantidad.Value</Value>
|
<Value>=Fields!Cantidad.Value</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontSize>7.5pt</FontSize>
|
<FontSize>7.5pt</FontSize>
|
||||||
<Format>0.000000;(0.000000)</Format>
|
<Format>#,0.######</Format>
|
||||||
</Style>
|
</Style>
|
||||||
</TextRun>
|
</TextRun>
|
||||||
</TextRuns>
|
</TextRuns>
|
||||||
|
|||||||
@@ -826,13 +826,13 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</Tablix>
|
</Tablix>
|
||||||
</ReportItems>
|
</ReportItems>
|
||||||
<Height>0.68252in</Height>
|
<Height>0.62002in</Height>
|
||||||
<Style />
|
<Style />
|
||||||
</Body>
|
</Body>
|
||||||
<Width>7.70923in</Width>
|
<Width>7.70923in</Width>
|
||||||
<Page>
|
<Page>
|
||||||
<PageHeader>
|
<PageHeader>
|
||||||
<Height>3.84568cm</Height>
|
<Height>4.16318cm</Height>
|
||||||
<PrintOnFirstPage>true</PrintOnFirstPage>
|
<PrintOnFirstPage>true</PrintOnFirstPage>
|
||||||
<PrintOnLastPage>true</PrintOnLastPage>
|
<PrintOnLastPage>true</PrintOnLastPage>
|
||||||
<ReportItems>
|
<ReportItems>
|
||||||
@@ -1011,7 +1011,7 @@
|
|||||||
<Value>=iif(Parameters!CveConcepto.Value = 8, "AVISO", "RECEPCIÓN") & " DE TRASLADO"</Value>
|
<Value>=iif(Parameters!CveConcepto.Value = 8, "AVISO", "RECEPCIÓN") & " DE TRASLADO"</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontFamily>Myriad Pro</FontFamily>
|
<FontFamily>Myriad Pro</FontFamily>
|
||||||
<FontSize>12pt</FontSize>
|
<FontSize>11pt</FontSize>
|
||||||
<FontWeight>Bold</FontWeight>
|
<FontWeight>Bold</FontWeight>
|
||||||
</Style>
|
</Style>
|
||||||
</TextRun>
|
</TextRun>
|
||||||
@@ -1045,7 +1045,7 @@
|
|||||||
<Value>=Parameters!SubProyecto.Value</Value>
|
<Value>=Parameters!SubProyecto.Value</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontFamily>Myriad Pro</FontFamily>
|
<FontFamily>Myriad Pro</FontFamily>
|
||||||
<FontSize>12pt</FontSize>
|
<FontSize>11pt</FontSize>
|
||||||
<FontWeight>Bold</FontWeight>
|
<FontWeight>Bold</FontWeight>
|
||||||
</Style>
|
</Style>
|
||||||
</TextRun>
|
</TextRun>
|
||||||
@@ -1057,7 +1057,7 @@
|
|||||||
<Top>3.24566cm</Top>
|
<Top>3.24566cm</Top>
|
||||||
<Left>0.00711cm</Left>
|
<Left>0.00711cm</Left>
|
||||||
<Height>0.6cm</Height>
|
<Height>0.6cm</Height>
|
||||||
<Width>14.27979cm</Width>
|
<Width>16.54562cm</Width>
|
||||||
<ZIndex>6</ZIndex>
|
<ZIndex>6</ZIndex>
|
||||||
<Style>
|
<Style>
|
||||||
<Border>
|
<Border>
|
||||||
|
|||||||
@@ -67,11 +67,9 @@
|
|||||||
<asp:ListItem Text="GlobalDTAC" Value="GlobalDTAC"></asp:ListItem>
|
<asp:ListItem Text="GlobalDTAC" Value="GlobalDTAC"></asp:ListItem>
|
||||||
<asp:ListItem Text="GlobalDTSATUsosCFDI" Value="GlobalDTSATUsosCFDI"></asp:ListItem>
|
<asp:ListItem Text="GlobalDTSATUsosCFDI" Value="GlobalDTSATUsosCFDI"></asp:ListItem>
|
||||||
<asp:ListItem Text="GlobalDTVtaCondicionesEntrega" Value="GlobalDTVtaCondicionesEntrega"></asp:ListItem>
|
<asp:ListItem Text="GlobalDTVtaCondicionesEntrega" Value="GlobalDTVtaCondicionesEntrega"></asp:ListItem>
|
||||||
<<<<<<< HEAD
|
<asp:ListItem Text="GlobalDTTipoVenta" Value="GlobalDTTipoVenta"></asp:ListItem>
|
||||||
<asp:ListItem Text="GlobalDTTipoVenta" Value="GlobalDTTipoVenta"></asp:ListItem>
|
|
||||||
=======
|
|
||||||
<asp:ListItem Text="GlobalDTDIOTTipoOperacion" Value="GlobalDTDIOTTipoOperacion"></asp:ListItem>
|
<asp:ListItem Text="GlobalDTDIOTTipoOperacion" Value="GlobalDTDIOTTipoOperacion"></asp:ListItem>
|
||||||
>>>>>>> 5f99bce007430083b8e29bf39512f4aa4b51efae
|
|
||||||
|
|
||||||
|
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
|
|||||||
@@ -110,14 +110,11 @@ Partial Class Sistemas_CatSesiones
|
|||||||
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSATUsosCFDI" Then
|
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSATUsosCFDI" Then
|
||||||
CargaUsosCFDI()
|
CargaUsosCFDI()
|
||||||
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTVtaCondicionesEntrega" Then
|
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTVtaCondicionesEntrega" Then
|
||||||
CargaCondicionesEntrega()
|
CargaCondicionesEntrega()
|
||||||
<<<<<<< HEAD
|
|
||||||
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTTipoVenta" Then
|
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTTipoVenta" Then
|
||||||
CargaTipoVenta()
|
CargaTipoVenta()
|
||||||
=======
|
|
||||||
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTDIOTTipoOperacion" Then
|
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTDIOTTipoOperacion" Then
|
||||||
CargaDIOTTipoOperacion()
|
CargaDIOTTipoOperacion()
|
||||||
>>>>>>> 5f99bce007430083b8e29bf39512f4aa4b51efae
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user