Compras Plantilla Prorrateo, Cat Secciones Tipo Operación, EMD Ajustes formatos almacén

This commit is contained in:
rakcsle
2025-05-10 10:05:53 -07:00
parent b5398e9030
commit cd3f24be03
6 changed files with 328 additions and 85 deletions

View File

@@ -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">&times;</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">

View File

@@ -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
@@ -8069,12 +8071,21 @@ Partial Class Compras_Compras
Next Next
End If End If
<<<<<<< HEAD
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
Else
ObjCompras.RollBack()
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
' Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
End If
=======
If CveEvaluacionProveedor > 0 Then If CveEvaluacionProveedor > 0 Then
Msg.Append("<br/><br/>El proveedor tiene evaluaciones pendientes<br/>") Msg.Append("<br/><br/>El proveedor tiene evaluaciones pendientes<br/>")
Msg.Append("¿Desea realizar una evaluación al proveedor?") 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>") Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>")
End If End If
>>>>>>> Compras Plantilla Prorrateo, Cat Secciones Tipo Operación, EMD Ajustes formatos almacén
BtnGuardar.Enabled = False BtnGuardar.Enabled = False
UpFacturar.Update() UpFacturar.Update()
@@ -8082,7 +8093,7 @@ Partial Class Compras_Compras
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 End If
@@ -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

View File

@@ -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>

View File

@@ -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") &amp; " DE TRASLADO"</Value> <Value>=iif(Parameters!CveConcepto.Value = 8, "AVISO", "RECEPCIÓN") &amp; " 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>

View File

@@ -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>&nbsp;&nbsp; </asp:DropDownList>&nbsp;&nbsp;

View File

@@ -111,13 +111,10 @@ Partial Class Sistemas_CatSesiones
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