Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -1303,12 +1303,102 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState
|
||||
#End Region
|
||||
|
||||
#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
|
||||
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>")
|
||||
'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
|
||||
Dim TablaActual As Integer = 1
|
||||
@@ -1323,10 +1413,13 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState
|
||||
respuesta = False
|
||||
End If
|
||||
|
||||
sbTablas.AppendLine("</div></div>")
|
||||
|
||||
|
||||
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;japmx95@gmail.com"
|
||||
'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 = " oscar.irigoyen@adssistemas.mx"
|
||||
MandaCorreoDiario(sbTablas.ToString(), Correos, respuesta)
|
||||
Return respuesta
|
||||
End Function
|
||||
@@ -1334,15 +1427,15 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState
|
||||
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%;'>")
|
||||
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))
|
||||
html.Append("<thead style='background-color:#DDD; padding: 0px;'><tr>")
|
||||
html.Append("<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>")
|
||||
If ColumnaTitulo <> column.ColumnName Then html.Append($"<th style='border: 1px solid #ddd; padding: 8px; text-align: center; color:#dbb19a; '>{column.ColumnName}</th>")
|
||||
Next
|
||||
|
||||
html.Append("</tr></thead>")
|
||||
html.Append("</thead>")
|
||||
html.Append("<tbody>")
|
||||
Dim numericValue As Decimal = Nothing
|
||||
|
||||
@@ -1368,10 +1461,10 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState
|
||||
cellValue = ""
|
||||
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
|
||||
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
|
||||
Next
|
||||
|
||||
@@ -1243,16 +1243,21 @@ Partial Class Bancos_PopIEVentas
|
||||
Pago.Fecha = TxtFechaDocumento.Text.ToDate
|
||||
Pago.CveMonedaPago = CveMoneda
|
||||
Pago.Referencia = VentaActual.SerieFolio
|
||||
|
||||
If TxtComision.Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = TxtComision.Text.ToDecimal Else Pago.OtroGastoIngreso = 0
|
||||
|
||||
If DdlOtrosPagos.SelectedValue = "2" Then
|
||||
ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL + TxtComision.Text.ToDecimal
|
||||
Else
|
||||
ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL
|
||||
End If
|
||||
ImportePagadoVenta = ImportePagado
|
||||
|
||||
ImportePagadoVenta = ImportePagado - Pago.OtroGastoIngreso
|
||||
|
||||
'Tipos de cambio
|
||||
If Pago.CveMonedaPago = 1 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos
|
||||
'Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal
|
||||
ImportePagadoVenta = (ImportePagado / TxtTipoCambio.Text.ToDecimal).RoundSQL
|
||||
ImportePagadoVenta = (ImportePagadoVenta / TxtTipoCambio.Text.ToDecimal).RoundSQL
|
||||
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
|
||||
Pago.TCPago = TxtTCDolaresDolares.Text.ToDecimal
|
||||
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
|
||||
@@ -1261,8 +1266,6 @@ Partial Class Bancos_PopIEVentas
|
||||
'If ChkPagarPesos.Checked Then Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal
|
||||
If ChkPagarDolares.Checked Then Pago.TCPago = TxtTipoCambio.Text.ToDecimal
|
||||
|
||||
If TxtComision.Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = TxtComision.Text.ToDecimal Else Pago.OtroGastoIngreso = 0
|
||||
|
||||
Select Case RBLContado.SelectedValue
|
||||
Case "1" ' Banco
|
||||
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImportePagado, CveMoneda, Pago.TCPago, TxtObservaciones.Text.Trim, "",
|
||||
@@ -1286,7 +1289,7 @@ Partial Class Bancos_PopIEVentas
|
||||
Case "2" ' FyE
|
||||
|
||||
Pago.ImportePago = ImportePagado
|
||||
Pago.ImportePagoVenta = ImportePagado - Pago.OtroGastoIngreso
|
||||
Pago.ImportePagoVenta = ImportePagadoVenta
|
||||
Pago.TipoPago = "FyE"
|
||||
Pago.CvePersonal = DdlFuncionarioEmpleado.SelectedValue.ToEntero
|
||||
Pago.Referencia = DdlFuncionarioEmpleado.SelectedItem.ToString
|
||||
|
||||
@@ -13907,7 +13907,7 @@ Partial Class Compras_Compras
|
||||
Next
|
||||
'si no esta vinculado a nc simplemente me lo brinco
|
||||
If realizadevolucion Then
|
||||
|
||||
subtotaldevolucion = subtotaldevolucion.RoundSQL(2)
|
||||
'si el subtotal es igual a la nc lo guardo si no marco error
|
||||
Dim tTolerancia As Decimal = 0
|
||||
Dim tAjustaUltimo As Boolean = True
|
||||
|
||||
@@ -675,7 +675,7 @@
|
||||
<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."
|
||||
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>
|
||||
<asp:TemplateField HeaderText="" ItemStyle-Font-Size="6pt">
|
||||
<EditItemTemplate>
|
||||
|
||||
@@ -287,6 +287,23 @@ Partial Class Inventarios_EntradasSalidas
|
||||
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
|
||||
Get
|
||||
|
||||
@@ -1534,7 +1551,20 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
If CveMovimiento > 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()
|
||||
|
||||
Else
|
||||
AgregarPS()
|
||||
End If
|
||||
@@ -2894,6 +2924,8 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
TotalOriginalEdit = 0D
|
||||
CveMovimientoDetalleEdit = -1
|
||||
|
||||
'Dim i As Integer = e.NewEditIndex
|
||||
'GvM.EditIndex =
|
||||
@@ -2903,7 +2935,8 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
If CveMovimiento > 0 Then
|
||||
CveMovimientoDetalleEdit = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
||||
txtCantidad.Enabled = False
|
||||
TotalOriginalEdit = GvRow.DataKey("Total").ToDecimal
|
||||
'txtCantidad.Enabled = False
|
||||
'DdlClasificacion.Enabled = False
|
||||
DdlProducto2.Enabled = False
|
||||
'DdlUnidad.Enabled = False
|
||||
|
||||
@@ -436,20 +436,7 @@
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpOCS" UpdateMode="Conditional">
|
||||
<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>
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="col-md-1" style="text-align:right!important">
|
||||
<div id="DivIndicadorL1" runat="server" visible="false" >
|
||||
@@ -475,6 +462,19 @@
|
||||
</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>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
Reference in New Issue
Block a user