This commit is contained in:
2025-02-28 18:05:14 -07:00
7 changed files with 656 additions and 528 deletions

View File

@@ -1303,12 +1303,102 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState
#End Region #End Region
#Region "R E P O R T E D I A R I O " #Region "R E P O R T E D I A R I O "
'Private Function ReporteDiario(ByVal CveEmpresa As Integer, ByVal context As HttpContext) As Boolean
' Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
' Dim objGenerales As ClsGenerales = New ClsGenerales()
' Dim respuesta As Boolean = True
' Dim sbTablas As StringBuilder = New StringBuilder()
' sbTablas.Append($"<b><center>Reporte Diario {DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")}</center><b><br><br>")
' If objGenerales.GetReporteDiario(CveEmpresa) Then
' Dim TablaActual As Integer = 1
' For Each tabla As DataTable In objGenerales.DSResultados.Tables
' sbTablas.AppendLine(ConvertDataTableToHtml(tabla))
' TablaActual += 1
' sbTablas.Append("<br>")
' sbTablas.Append("<br>")
' Next
' Else
' respuesta = False
' End If
' objGenerales.Dispose()
' 'MandaCorreoDiario
' Dim Correos As String = "hdiaz@grupodiaz.com.mx;libarra@grupodiaz.com.mx;jguerrero@grupodiaz.com.mx;contabilidad@grupodiaz.com.mx;cnazarit@yahoo.com;julian@adsistemas.mx;rene.molina@adssistemas.mx"
' ' Dim Correos As String = " rene.molina@adssistemas.mx"
' MandaCorreoDiario(sbTablas.ToString(), Correos, respuesta)
' Return respuesta
'End Function
'Private Function ConvertDataTableToHtml(ByVal table As DataTable) As String
' Dim html As StringBuilder = New StringBuilder()
' Dim ColumnaTitulo As String = "Titulo"
' html.Append("<table border='1' style='border-collapse:collapse; width:100%;'>")
' If table.Columns(0).ColumnName = ColumnaTitulo AndAlso table.Rows.Count > 0 Then html.AppendFormat(" <caption style='background-color:#333333;'>{0}</caption>", table.Rows(0)(ColumnaTitulo))
' html.Append("<thead style='background-color:#DDD; padding: 0px;'><tr>")
' For Each column As DataColumn In table.Columns
' If ColumnaTitulo <> column.ColumnName Then html.Append($"<th style='padding:5px; text-align:left;'>{column.ColumnName}</th>")
' Next
' html.Append("</tr></thead>")
' html.Append("<tbody>")
' Dim numericValue As Decimal = Nothing
' For Each row As DataRow In table.Rows
' html.Append("<tr>")
' For Each column As DataColumn In table.Columns
' If ColumnaTitulo <> column.ColumnName Then
' Dim value As Object = row(column)
' Dim cellValue As String
' If column.DataType = GetType(Integer) OrElse column.DataType = GetType(Decimal) OrElse column.DataType = GetType(Double) OrElse column.DataType = GetType(Single) Then
' If value IsNot DBNull.Value AndAlso Decimal.TryParse(value.ToString(), numericValue) Then
' If numericValue <> 0 Then
' cellValue = numericValue.ToString("N2")
' Else
' cellValue = ""
' End If
' Else
' cellValue = ""
' End If
' html.Append($"<td style='padding:5px; text-align:right;'>{cellValue}</td>")
' Else
' cellValue = If(value?.ToString(), String.Empty)
' html.Append($"<td style='padding:5px; text-align:left;'>{cellValue}</td>")
' End If
' End If
' Next
' html.Append("</tr>")
' Next
' html.Append("</tbody>")
' html.Append("</table>")
' Return html.ToString()
'End Function
Private Function ReporteDiario(ByVal CveEmpresa As Integer, ByVal context As HttpContext) As Boolean Private Function ReporteDiario(ByVal CveEmpresa As Integer, ByVal context As HttpContext) As Boolean
Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa) Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Dim objGenerales As ClsGenerales = New ClsGenerales() Dim objGenerales As ClsGenerales = New ClsGenerales()
Dim respuesta As Boolean = True Dim respuesta As Boolean = True
Dim sbTablas As StringBuilder = New StringBuilder() Dim sbTablas As StringBuilder = New StringBuilder()
sbTablas.Append($"<b><center>Reporte Diario {DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")}</center><b><br><br>") 'sbTablas.Append($"<b><center>Reporte Diario {DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")}</center><b><br><br>")
sbTablas.AppendLine($"<div style='font-family: Arial, sans-serif; margin: 20px; padding: 20px; background-color: #f4f4f4;'>
<div style='width: 90%; margin: auto; background: white; padding: 20px; border-radius: 10px; box-shadow: 0px 0px 10px 0px #aaa; '>
<table style='width:100%'>
<td style='width:33%'><img src='https://sig.adssistemas.mx/imagenes/u248.png' style='width:210px;height:95px'></td>
<td style='width:33%'><h1 style='text-align: center;'>Reporte Diario</h1></td>
<td style='width:33%;text-align:right'><img src='https://sig.adssistemas.mx/imagenes/u8.svg' style='width:56px;height:56px'></td>
</table>
<h2 style='text-align: center;'>{DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")}</h2>")
If objGenerales.GetReporteDiario(CveEmpresa) Then If objGenerales.GetReporteDiario(CveEmpresa) Then
Dim TablaActual As Integer = 1 Dim TablaActual As Integer = 1
@@ -1323,10 +1413,13 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState
respuesta = False respuesta = False
End If End If
sbTablas.AppendLine("</div></div>")
objGenerales.Dispose() objGenerales.Dispose()
'MandaCorreoDiario 'MandaCorreoDiario
Dim Correos As String = "hdiaz@grupodiaz.com.mx;libarra@grupodiaz.com.mx;jguerrero@grupodiaz.com.mx;contabilidad@grupodiaz.com.mx;cnazarit@yahoo.com;julian@adsistemas.mx;rene.molina@adssistemas.mx" 'Dim Correos As String = "hdiaz@grupodiaz.com.mx;libarra@grupodiaz.com.mx;jguerrero@grupodiaz.com.mx;contabilidad@grupodiaz.com.mx;cnazarit@yahoo.com;julian@adsistemas.mx;rene.molina@adssistemas.mx"
'Dim Correos As String = " rene.molina@adssistemas.mx;japmx95@gmail.com" Dim Correos As String = " oscar.irigoyen@adssistemas.mx"
MandaCorreoDiario(sbTablas.ToString(), Correos, respuesta) MandaCorreoDiario(sbTablas.ToString(), Correos, respuesta)
Return respuesta Return respuesta
End Function End Function
@@ -1334,15 +1427,15 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState
Private Function ConvertDataTableToHtml(ByVal table As DataTable) As String Private Function ConvertDataTableToHtml(ByVal table As DataTable) As String
Dim html As StringBuilder = New StringBuilder() Dim html As StringBuilder = New StringBuilder()
Dim ColumnaTitulo As String = "Titulo" Dim ColumnaTitulo As String = "Titulo"
html.Append("<table border='1' style='border-collapse:collapse; width:100%;'>") html.Append("<table style='width: 100%; border-collapse: collapse; margin-top: 20px;'>")
If table.Columns(0).ColumnName = ColumnaTitulo AndAlso table.Rows.Count > 0 Then html.AppendFormat(" <caption style='background-color:#333333;'>{0}</caption>", table.Rows(0)(ColumnaTitulo)) If table.Columns(0).ColumnName = ColumnaTitulo AndAlso table.Rows.Count > 0 Then html.AppendFormat(" <caption style='background-color:#333333;'>{0}</caption>", table.Rows(0)(ColumnaTitulo))
html.Append("<thead style='background-color:#DDD; padding: 0px;'><tr>") html.Append("<tr>")
For Each column As DataColumn In table.Columns For Each column As DataColumn In table.Columns
If ColumnaTitulo <> column.ColumnName Then html.Append($"<th style='padding:5px; text-align:left;'>{column.ColumnName}</th>") If ColumnaTitulo <> column.ColumnName Then html.Append($"<th style='border: 1px solid #ddd; padding: 8px; text-align: center; color:#dbb19a; '>{column.ColumnName}</th>")
Next Next
html.Append("</tr></thead>") html.Append("</thead>")
html.Append("<tbody>") html.Append("<tbody>")
Dim numericValue As Decimal = Nothing Dim numericValue As Decimal = Nothing
@@ -1368,10 +1461,10 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState
cellValue = "" cellValue = ""
End If End If
html.Append($"<td style='padding:5px; text-align:right;'>{cellValue}</td>") html.Append($"<td style='border: 1px solid #ddd; padding: 8px; text-align: center;'>{cellValue}</td>")
Else Else
cellValue = If(value?.ToString(), String.Empty) cellValue = If(value?.ToString(), String.Empty)
html.Append($"<td style='padding:5px; text-align:left;'>{cellValue}</td>") html.Append($"<td style='border: 1px solid #ddd; padding: 8px; text-align: center;'>{cellValue}</td>")
End If End If
End If End If
Next Next

View File

@@ -1494,36 +1494,36 @@
<div class="btn-group"> <div class="btn-group">
</div> </div>
</div> </div>
<div class="tools"> <div class="tools">
<table width="325px"> <div class="row">
<tr> <div class="col-md-6" id="DivAlmacenDev" runat="server" visible="false">
<td width="50px">Compra:</td> <table width="275px">
<td width="250px"> <tr>
<asp:DropDownList ID="DDLDevolucion" Style="width: 100%" AutoPostBack="true" runat="server" CssClass="form-control input-sm select2me " DataTextField="Compra" DataValueField="CveCompra"></asp:DropDownList> <td width="50px">Almacen:</td>
</td> <td width="200px">
<td width="25px"> <asp:DropDownList ID="DdlAlmacenDevolucion" Style="width: 100%" AutoPostBack="true" runat="server" CssClass="form-control input-sm select2me " DataTextField="Almacen" DataValueField="CveAlmacen"></asp:DropDownList>
<a href="javascript:;" class="collapse" data-original-title="" title=""></a> </td>
</td> </tr>
</tr> </table>
</table> </div>
<div class="col-md-6">
<table width="325px">
<tr>
<td width="50px">Compra:</td>
<td width="250px">
<asp:DropDownList ID="DDLDevolucion" Style="width: 100%" AutoPostBack="true" runat="server" CssClass="form-control input-sm select2me " DataTextField="Compra" DataValueField="CveCompra"></asp:DropDownList>
</td>
<td width="25px">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</td>
</tr>
</table>
</div>
</div>
</div> </div>
</div> </div>
<div class="portlet-body"> <div class="portlet-body">
<div id="DivAlmacenDev" runat="server" visible="false" class="row">
<div class="col-md-12">
<table width="325px">
<tr>
<td width="50px">Almacen:</td>
<td width="250px">
<asp:DropDownList ID="DdlAlmacenDevolucion" Style="width: 100%" AutoPostBack="true" runat="server" CssClass="form-control input-sm select2me " DataTextField="Almacen" DataValueField="CveAlmacen"></asp:DropDownList>
</td>
</tr>
</table>
</div>
</div>
<br />
<asp:GridView ID="GVDevolucion" runat="server" DataKeyNames="CveMovimientoDetalle,CveAlmacen,Total,PU,Cantidad,CvePS,CveUM,UM,CveClasificacion,Clasificacion,CodigoPS,CveTipoPS,PUExtranjero" ShowFooter="true" GridLines="None" AutoGenerateColumns="false" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" CssClass="table table-striped table-hover Widthall"> <asp:GridView ID="GVDevolucion" runat="server" DataKeyNames="CveMovimientoDetalle,CveAlmacen,Total,PU,Cantidad,CvePS,CveUM,UM,CveClasificacion,Clasificacion,CodigoPS,CveTipoPS,PUExtranjero" ShowFooter="true" GridLines="None" AutoGenerateColumns="false" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" CssClass="table table-striped table-hover Widthall">
<Columns> <Columns>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="60px" ItemStyle-HorizontalAlign="Right"> <asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="60px" ItemStyle-HorizontalAlign="Right">

File diff suppressed because it is too large Load Diff

View File

@@ -675,7 +675,7 @@
<asp:HiddenField runat="server" ID="HdnCodAFEdit" Value="-1" ClientIDMode="Static" /> <asp:HiddenField runat="server" ID="HdnCodAFEdit" Value="-1" ClientIDMode="Static" />
<asp:GridView ID="GvM" runat="server" GridLines="none" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" EmptyDataText="Aún no hay registros." <asp:GridView ID="GvM" runat="server" GridLines="none" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" EmptyDataText="Aún no hay registros."
DataKeyNames="No,CveMovimientoDetalle,Cantidad,CvePS,CveUM,PU,Observaciones,CodigoPS,UnidadMedida,CveAF,Serie,Lote,FechaCaducidad,CveSeccionAlmacen,Codigo" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True"> DataKeyNames="No,CveMovimientoDetalle,Cantidad,CvePS,CveUM,PU,Observaciones,CodigoPS,UnidadMedida,CveAF,Serie,Lote,FechaCaducidad,CveSeccionAlmacen,Codigo,Total" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True">
<Columns> <Columns>
<asp:TemplateField HeaderText="" ItemStyle-Font-Size="6pt"> <asp:TemplateField HeaderText="" ItemStyle-Font-Size="6pt">
<EditItemTemplate> <EditItemTemplate>

View File

@@ -287,6 +287,23 @@ Partial Class Inventarios_EntradasSalidas
End Property End Property
Public Property TotalOriginalEdit() As Decimal
Get
If ViewState("TotalOriginalEdit") Is Nothing Then
ViewState("TotalOriginalEdit") = 0D
End If
Return ViewState("TotalOriginalEdit").ToString.ToDecimal
End Get
Set(value As Decimal)
ViewState("TotalOriginalEdit") = value
End Set
End Property
Public Property IndexActualTabla() As Integer Public Property IndexActualTabla() As Integer
Get Get
@@ -1534,7 +1551,20 @@ Partial Class Inventarios_EntradasSalidas
If CveMovimiento > 0 Then If CveMovimiento > 0 Then
If CveMovimientoDetalleEdit > 0 Then If CveMovimientoDetalleEdit > 0 Then
If CveCompra > 0 Then
Dim TotalActual As Decimal = (txtCantidad.Text.ToDecimal * txtPrecio.Text.ToDecimal)
Dim Diferencia As Decimal = Math.Abs(TotalOriginalEdit - TotalActual).RoundSQL(2)
If Diferencia > 0 Then
Alert($"Existe una diferencia de {Diferencia.ToString("###,###,###.00")} entre el total anterior ({TotalOriginalEdit.ToString("###,###,###.00")}) y actual({TotalActual.ToString("###,###,###.00")}).", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
ActualizarPS() ActualizarPS()
Else Else
AgregarPS() AgregarPS()
End If End If
@@ -2894,6 +2924,8 @@ Partial Class Inventarios_EntradasSalidas
Protected Sub imgE_Click(sender As Object, e As EventArgs) Protected Sub imgE_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
TotalOriginalEdit = 0D
CveMovimientoDetalleEdit = -1
'Dim i As Integer = e.NewEditIndex 'Dim i As Integer = e.NewEditIndex
'GvM.EditIndex = 'GvM.EditIndex =
@@ -2903,7 +2935,8 @@ Partial Class Inventarios_EntradasSalidas
If CveMovimiento > 0 Then If CveMovimiento > 0 Then
CveMovimientoDetalleEdit = GvRow.DataKey("CveMovimientoDetalle").ToEntero CveMovimientoDetalleEdit = GvRow.DataKey("CveMovimientoDetalle").ToEntero
txtCantidad.Enabled = False TotalOriginalEdit = GvRow.DataKey("Total").ToDecimal
'txtCantidad.Enabled = False
'DdlClasificacion.Enabled = False 'DdlClasificacion.Enabled = False
DdlProducto2.Enabled = False DdlProducto2.Enabled = False
'DdlUnidad.Enabled = False 'DdlUnidad.Enabled = False

View File

@@ -436,20 +436,7 @@
<asp:UpdatePanel runat="server" ID="UpOCS" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpOCS" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="col-md-1" style="text-align:right!important">
<div id="DivIndicadorOC2" runat="server" visible="false" >
<div style=" color: gray;font-size: 12px;font-weight: bold;">
OC
</div>
<div style=" color: blue; font-size: 20px; font-weight: bold;">
<asp:LinkButton ID="LnkIndicador_OC2" Text="" OnClick="LnkIndicador_OC_Click" runat="server" CssClass="Texto" />
</div>
</div>
</div>
<div class="col-md-1" style="text-align:right!important"> <div class="col-md-1" style="text-align:right!important">
<div id="DivIndicadorL1" runat="server" visible="false" > <div id="DivIndicadorL1" runat="server" visible="false" >
@@ -475,6 +462,19 @@
</div> </div>
</div> </div>
<div class="col-md-1" style="text-align:right!important">
<div id="DivIndicadorOC2" runat="server" visible="false" >
<div style=" color: gray;font-size: 12px;font-weight: bold;">
OC
</div>
<div style=" color: blue; font-size: 20px; font-weight: bold;">
<asp:LinkButton ID="LnkIndicador_OC2" Text="" OnClick="LnkIndicador_OC_Click" runat="server" CssClass="Texto" />
</div>
</div>
</div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>

View File

@@ -34643,7 +34643,11 @@ Partial Class Ventas
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetRemisionesSinFacturar(TxtFechaIRem.Text, TxtFechaFRem.Text, CveCliente, CveContrato, 1, CveMoneda) Then If ObjVentas.GetRemisionesSinFacturar(TxtFechaIRem.Text, TxtFechaFRem.Text, CveCliente, CveContrato, 1, CveMoneda) Then
If CveContrato = -1 Then If CveContrato = -1 Then
DTRemisiones = ObjVentas.DtResultados.FiltraParametros("CveContrato = 0") If UsuarioActual.CveEmpresa = 188 Then
DTRemisiones = ObjVentas.DtResultados
Else
DTRemisiones = ObjVentas.DtResultados.FiltraParametros("CveContrato = 0")
End If
Else Else
DTRemisiones = ObjVentas.DtResultados.FiltraParametros($"CveContrato = {CveContrato}") DTRemisiones = ObjVentas.DtResultados.FiltraParametros($"CveContrato = {CveContrato}")
End If End If