This commit is contained in:
2024-12-28 14:56:47 -07:00
26 changed files with 608 additions and 586 deletions

View File

@@ -4565,7 +4565,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Integer, CveUM As Integer, CvePS As Integer, Precio As Decimal, Observaciones As String,
Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Decimal, CveUM As Integer, CvePS As Integer, Precio As Decimal, Observaciones As String,
CveContratoDetalle As Integer, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Boolean
Dim Retorno As Boolean = False
Dim CveTraspasoSolicitud As Integer = 0
@@ -4573,7 +4573,7 @@ Public Class ClsInventarios
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTrasladoSolicitud", SqlDbType.Int).Value = CveTrasladoSolicitud
.Add("@Cantidad", SqlDbType.Int).Value = Cantidad
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
.Add("@CveUM", SqlDbType.Int).Value = CveUM
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@Precio", SqlDbType.Float).Value = Precio
@@ -4597,6 +4597,41 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function UpdateTrasladoSolicitudDetalle(CveTrasladoSolicitudDetalle As Integer, CveEmpresa As Integer, CveTrasladoSolicitud As Integer, Cantidad As Decimal, CveUM As Integer, CvePS As Integer, Precio As Decimal, Observaciones As String,
CveContratoDetalle As Integer, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Boolean
Dim Retorno As Boolean = False
Dim CveTraspasoSolicitud As Integer = 0
DataAdapter("PA_Inv_TraspasoSolicitudDetalleUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTrasladoSolicitudDetalle", SqlDbType.Int).Value = CveTrasladoSolicitudDetalle
.Add("@CveTrasladoSolicitud", SqlDbType.Int).Value = CveTrasladoSolicitud
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
.Add("@CveUM", SqlDbType.Int).Value = CveUM
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@Precio", SqlDbType.Float).Value = Precio
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
.Add("@Serie", SqlDbType.NVarChar).Value = Serie
.Add("@Lote", SqlDbType.NVarChar).Value = Lote
.Add("@FechaCaducidad", SqlDbType.Date).Value = FechaCaducidad
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al actualizar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al actualizar los detalles del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddTrasladoSolicitudGet(CveTrasladoSolicitud As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
Dim CveTraspasoSolicitud As Integer = 0

View File

@@ -342,10 +342,11 @@ Public Class ClsNominas
End Try
Return retorno
End Function
Public Function PersonalAplicaCalculoAnual(CveEmpresa As Integer, CveUsuario As Integer, CvePersonal As Integer, Aplica As Integer, motivo As String) As Boolean
Public Function PersonalAplicaCalculoAnual(CveEmpresa As Integer, CveUsuario As Integer, Ejercicio As Integer, CvePersonal As Integer, Aplica As Integer, motivo As String) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Nom_PersonalAplicaCalculoAnual", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
@@ -611,6 +612,29 @@ Public Class ClsNominas
End Try
Return retorno
End Function
Public Function GuardarAguinaldo(CveEmpresa As Integer, CveUsuario As Integer, registros As String, EJercicio As Integer) As Boolean
Dim retorno As Boolean = False
Try
DataAdapter("PA_Nom_GuardarAguinaldo", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Decimal).Value = CveUsuario
.Add("@registros", SqlDbType.Xml).Value = registros
.Add("@EJercicio", SqlDbType.Xml).Value = EJercicio
End With
SqlAdapter.Fill(Data)
retorno = True
Catch sqEx As SqlException
retorno = False
OnError("Ocurrió un error al guardar Aguinaldo.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
retorno = False
OnError("Ocurrió un error al guardar Aguinaldo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
Public Function RegistraProvision(CvePeriodo As Int32, CveUsuario As Int32, CveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Nom_RegistraProvision", CommandType.StoredProcedure)

View File

@@ -2300,7 +2300,7 @@ Public Class ClsRH
.Add("@SalarioDiarioSS", SqlDbType.Money).Value = SalarioDiarioSS
.Add("@CalcularSDI", SqlDbType.Bit).Value = CalcularSDI
.Add("@ActualizaSalarioV", SqlDbType.Bit).Value = ActualizaSalarioV
.Add("@OrigenU", SqlDbType.Bit).Value = OrigenU
.Add("@OrigenU", SqlDbType.VarChar).Value = OrigenU
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -293,7 +293,7 @@ Public Class ClsVentas
Public Function GetVentas(CveEmpresa As Integer, TipoDocto As String, Serie As String, Folio As Integer, Codigo As String, CveCliente As Integer,
CveSubProyecto As Integer, CveEstatus As Integer, CveUsuario As Integer, FechaI As String, FechaF As String, FolioFiscal As String, Optional CveClienteSucursal As Integer = -1, Optional CvePS As Integer = -1, Optional PedidoContrato As String = "-1",
Optional OrdenCompra As String = "-1", Optional CveUsuarioConsulta As Integer = -1, Optional ClienteRFC As String = "-1",
Optional CveEmpresaCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional TopSelect As Integer = 1000) As Boolean
Optional CveEmpresaCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional TopSelect As Integer = 1000, Optional CveVendedor As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasGetBuscar")
@@ -319,6 +319,7 @@ Public Class ClsVentas
.Add("@CveEmpresaCRM", SqlDbType.Int).Value = CveEmpresaCRM
.Add("@CveAcercamientoCRM", SqlDbType.Int).Value = CveAcercamientoCRM
.Add("@TopSelect", SqlDbType.Int).Value = TopSelect
.Add("@CveVendedorFiltro", SqlDbType.Int).Value = CveVendedor
End With
Try
@@ -2473,20 +2474,21 @@ Public Class ClsVentas
'End Function
#Region " PROMOCIONES "
Public Function GetPromociones(CvePromocion As Integer, Fecha As String, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer,
CveSubProyecto As Integer, Optional CveMarca As Integer = -1) As Boolean
Public Function GetPromociones(CvePromocion As Integer, Fecha As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer,
CveSubProyecto As Integer, Optional CveMarca As Integer = -1, Optional CveUsuario As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PromocionesGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion
.Add("@Fecha", SqlDbType.VarChar).Value = Fecha
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario
End With
Try

View File

@@ -1311,7 +1311,7 @@
ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall mysmallbtn" Visible="false">
<Columns>
<%--0--%>
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField ItemStyle-Width="70px" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
Aplica<br />
Inventario<br />
@@ -1322,7 +1322,7 @@
</ItemTemplate>
</asp:TemplateField>
<%--1--%>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:TextBox ID="TbCantidad" runat="server" Width="50px" Mask="999,999.99" Text='<%# Eval("CantidadF", "{0:N2}")%>'></asp:TextBox>
<br />
@@ -1330,11 +1330,10 @@
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
<asp:Button Text="D" ID="BtnDividirCompra" runat="server" OnClick="BtnDividirCompra_Click" Style="display: none;" />
<asp:Button Text="Serie" ID="BtnSerieLote" OnClick="BtnSerieLote_Click" CssClass="btn btn-primary mysmallbtn" runat="server" />
</ItemTemplate>
<HeaderStyle CssClass="Titulos" />
</ItemTemplate>
</asp:TemplateField>
<%--2--%>
<asp:TemplateField>
<asp:TemplateField ItemStyle-Width="80px" >
<HeaderTemplate>
Unidad
</HeaderTemplate>
@@ -1343,9 +1342,9 @@
</ItemTemplate>
</asp:TemplateField>
<%--3--%>
<asp:BoundField ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" HeaderText=" Producto" DataField="PS" />
<asp:BoundField ItemStyle-HorizontalAlign="Left" HeaderText=" Producto" DataField="CodigoPS" />
<%--4--%>
<asp:BoundField ItemStyle-Width="7.5%" HeaderText="P.U." DataField="PU" DataFormatString="{0:#,##0.00####}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField ItemStyle-Width="120px" HeaderText="P.U." DataField="PU" DataFormatString="{0:#,##0.00####}" ItemStyle-HorizontalAlign="Right" />
<%--5--%>
<asp:TemplateField ItemStyle-Width="10%">
<ItemTemplate>
@@ -5162,7 +5161,7 @@
</div>
<div id="DivDevolucion" class="modal fade">
<div class="modal-dialog">
<div class="modal-dialog" style="width: 750px;">
<asp:UpdatePanel ID="UPPSolDev" runat="server" class="modal-content rowpadding" tabindex="-1" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
@@ -5172,10 +5171,9 @@
<div class="modal-body">
<div class="row">
<div class="col-md-12" style="text-align:right">
<asp:CheckBox runat="server" ID="ChkEsDevolucionDevInv" Text="Es Temporal" Visible="false" />
<asp:CheckBox runat="server" ID="ChkEsDevolucionDevInv" Text="Genera Saldo a favor" Visible="false" />
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:GridView ID="GvSolDev" runat="server" AutoGenerateColumns="false" GridLines="none" BorderWidth="0"
DataKeyNames="Cantidad,CveCompraDetalle,CvePS,PU,CveUM,CodigoPS"
@@ -5191,7 +5189,8 @@
<asp:BoundField DataField="Cantidad" HeaderText="Total" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.######}" />
<asp:BoundField DataField="UM" HeaderText="UM" />
<asp:BoundField DataField="CodigoPS" HeaderText="Producto" />
<asp:BoundField DataField="Total" DataFormatString="{0:#,##0.00####}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PU" DataFormatString="{0:#,##0.00####}" HeaderText ="PU" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Total" DataFormatString="{0:#,##0.00####}" HeaderText="Total" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</div>

View File

@@ -1377,7 +1377,7 @@ Partial Class Compras_Compras
DdlMedico.DataBind()
End If
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
If UsuarioActual.Empresa.Funcionalidad(590).ToString = "1" Then
DVCultivosCuadro.Visible = True
DdlSubProyecto.AutoPostBack = True
@@ -1906,24 +1906,11 @@ Partial Class Compras_Compras
TmpDT.Columns.Add("CveSATPSActualizado")
SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL
If Not TmpDT.Columns.Contains("Amortizacion") Then
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
End If
If Not TmpDT.Columns.Contains("AplicaLote") Then
TmpDT.Columns.Add("AplicaLote", GetType(Boolean))
End If
If Not TmpDT.Columns.Contains("AplicaCaducidad") Then
TmpDT.Columns.Add("AplicaCaducidad", GetType(Boolean))
End If
If Not TmpDT.Columns.Contains("Lote") Then
TmpDT.Columns.Add("Lote", GetType(String))
End If
If Not TmpDT.Columns.Contains("FechaCaducidad") Then
TmpDT.Columns.Add("FechaCaducidad", GetType(Date))
End If
If Not TmpDT.Columns.Contains("Amortizacion") Then TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
If Not TmpDT.Columns.Contains("AplicaLote") Then TmpDT.Columns.Add("AplicaLote", GetType(Boolean))
If Not TmpDT.Columns.Contains("AplicaCaducidad") Then TmpDT.Columns.Add("AplicaCaducidad", GetType(Boolean))
If Not TmpDT.Columns.Contains("Lote") Then TmpDT.Columns.Add("Lote", GetType(String))
If Not TmpDT.Columns.Contains("FechaCaducidad") Then TmpDT.Columns.Add("FechaCaducidad", GetType(Date))
AddPS2(False)
@@ -2324,6 +2311,19 @@ Partial Class Compras_Compras
End If
End If
Next
'consideración si el usuarioactual, solo tienen un centro de costo, que lo asigne en automático
Dim dtsubAsignados As DataTable = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
If dtsubAsignados.Rows.Count = 1 Then
Dim drtt As DataRow = dtsubAsignados.FiltroPrimero("")
For Each item As DataRow In TmpDT.Rows
item("CveSubProyecto") = drtt("CveSubProyecto")
item("SubProyecto") = drtt("SubProyecto")
item("CveProyecto") = drtt("CveProyecto")
item("Proyecto") = drtt("Proyecto")
Next
End If
GvPS.DataSource = TmpDT
GvPS.DataBind()
UpPS.Update()
@@ -4391,24 +4391,6 @@ Partial Class Compras_Compras
End If
''VERIFICA SI LOS PRODUCTOS/SERVICIOS EXISTEN EN EL CATALOGO DEL SAT
'If UsuarioActual.CveEmpresa = 72 Then
' Dim DtNoEncontrados As DataTable = TmpDT.FiltraParametros("ISNULL(CveSATPS,0) = 46920 ")
' If DtNoEncontrados IsNot Nothing AndAlso DtNoEncontrados.Rows.Count > 0 Then
' Dim StrNoEncontrados As New StringBuilder
' StrNoEncontrados.Append("Los siguientes productos no tiene asignado la clave Producto SAT o Unidad Medida SAT<br/><br/>")
' For Each drt As DataRow In DtNoEncontrados.Rows
' StrNoEncontrados.AppendFormat("{0} <br/>", drt("CodigoPS"))
' Next
' Alert(StrNoEncontrados.ToString(), TipoMensaje.MsgAdvertencia)
' DtNoEncontrados.Dispose()
' StrNoEncontrados.Clear()
' Exit Sub
' End If
' DtNoEncontrados.Dispose()
'End If
'Verifica funcionalidad 128 "Require orden de compra para factura de compra"
Dim EsViatico As Boolean = False
@@ -4447,21 +4429,6 @@ Partial Class Compras_Compras
Exit Sub
End If
''DF - 10/04/2017
'If UsuarioActual.TienePermisoProceso(187) Then
' If TxtSerie.Text <> SerieVieja Then
' Dim dtt As DataTable = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa)
' If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
' Dim SerieNueva As String = dtt.FiltroPrimeroValor("Serie", $"Serie = '{TxtSerie.Text}'").ToString
' If SerieNueva = "" Then
' Alert("La Serie no es válida, por favor revise que se encuentre dentro de la lista de las sucursales del proveedor.", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' End If
' End If
'End If
'Excede el limite de credito
If RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Fac") AndAlso UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then
Dim ObjCompras As New ClsCompras
@@ -4527,31 +4494,29 @@ Partial Class Compras_Compras
End If
ValidaFechaDeAlamacen()
Else
Dim x As Integer = 0
For Each Dr As GridViewRow In GvInv.Rows
If Dr.FCCheckBox("cbInv").Checked Then
x = x + 1
End If
Next
If Not (CveCompraRefacturacion > 0 AndAlso ChkRefacturacionConAlmacen.Checked) Then
If x = 0 AndAlso GvInv.Rows.Count > 0 Then
Alert("Favor de seleccionar un producto en la pestaña de almacen", TipoMensaje.MsgAdvertencia)
Exit Sub
'GvInv.Rows(x).FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero 'Charlie
'pestaña de almacen, si hay especificado una entrada por partida dealmacen, debe de existir el almacen.
If GvInv.Rows.Count > 0 Then
If DdlTipoComprobante.SelectedValue.Contiene("Fac") Then
Dim x As Integer = 0
For Each Dr As GridViewRow In GvInv.Rows
If Dr.FCCheckBox("cbInv").Checked Then
If Dr.FCDropDownList("ddlEAlmacen").SelectedValue.ToEntero <= 0 Then
Alert("Favor de seleccionar almacen en la pestaña de almacén.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
x = x + 1
End If
Next
If Not (CveCompraRefacturacion > 0 AndAlso ChkRefacturacionConAlmacen.Checked) Then
If x = 0 AndAlso GvInv.Rows.Count > 0 Then
Alert("Favor de seleccionar un producto en la pestaña de almacén", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
End If
End If
End If
If UsuarioActual.Empresa.Funcionalidad(538) = "1" Then
If TmpDT.MIN("CvePS").ToEntero <= 0 Then
Alert("Todos los Productos/Servicios deben estar registrados o aliados a un productos ya registrado.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
@@ -11496,7 +11461,7 @@ Partial Class Compras_Compras
e.Row.FCDropDownList("ddlAlmacenConsignacionGeneral").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 4)
e.Row.FCDropDownList("ddlAlmacenConsignacionGeneral").DataBind()
'que no sea recepcion alamcen adelatnado. DdlOCVinculaInv
'que no sea recepcion almacen adelantado. DdlOCVinculaInv
If UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso DdlOCVinculaInv.SelectedValue <> "176" Then
If e.Row.FCDropDownList("ddlAlmacen").Items.Count > 1 Then
e.Row.FCDropDownList("ddlAlmacen").SelectedIndex = 1
@@ -19146,7 +19111,11 @@ Partial Class Compras_Compras
Else
HplDevv.Text = "<i class='fa fa-pencil'></i> Solicitar Devolución Almacén"
HplDevv.ToolTip = "¿Está seguro de Solicitar la Devolución de Almacén?"
ChkEsDevolucionDevInv.Visible = True
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
ChkEsDevolucionDevInv.Visible = True
ChkEsDevolucionDevInv.Checked = True
ChkEsDevolucionDevInv.Enabled = False
End If
End If
End If
@@ -19175,35 +19144,23 @@ Partial Class Compras_Compras
Dim tCveSubProyeto As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", " CveSubProyecto > 0").ToEntero
ObjCompras.IniciaTransacSQL()
If ChkEsDevolucionDevInv.Checked Then
End If
Dim ImporteCompra As Decimal = 0
If EstatusAlmacen = 0 Then
For Each gvr As GridViewRow In GvSolDev.Rows
Dim Canidad As Decimal = gvr.FCTextBox("TxtCant").Text.ToDecimal
Dim Cantidad As Decimal = gvr.FCTextBox("TxtCant").Text.ToDecimal
Dim PU As Decimal = gvr.DataKey("PU").ToDecimal
If gvr.FCTextBox("TxtCant").Text.ToDecimal > 0 Then
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 0, UsuarioActual.CveUsuario, CantidadDevolucion:=gvr.FCTextBox("TxtCant").Text.ToDecimal)
ImporteCompra = ImporteCompra + ((PU * Canidad))
ImporteCompra = ImporteCompra + ((PU * Cantidad))
Else
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 1, UsuarioActual.CveUsuario, CantidadDevolucion:=0)
End If
Next
End If
ImporteRNC = ImporteCompra
ImporteRNC = ImporteCompra.RoundSQL
If ObjCompras.UpdateEstatusAlmacen(CveCompra, If(EstatusAlmacen = 1, 0, 1), UsuarioActual.CveUsuario) Then
EstatusAlmacen = If(EstatusAlmacen = 1, 0, 1)
Alert(If(EstatusAlmacen = 1, "La solicitud de devolución de almacen se guardo correctamente.", "La solicitud de almacen se canceló correctamente."))
End If
If ChkEsDevolucionDevInv.Checked Then
@@ -19259,33 +19216,27 @@ Partial Class Compras_Compras
End If
If Not TieneError AndAlso ObjCompras.UpdateEstatusAlmacen(CveCompra, If(EstatusAlmacen = 1, 0, 1), UsuarioActual.CveUsuario) Then
EstatusAlmacen = If(EstatusAlmacen = 1, 0, 1)
Alert(If(EstatusAlmacen = 1, "La solicitud de devolución de almacen se guardo correctamente.", "La solicitud de almacen se canceló correctamente."))
End If
If Not TieneError Then
ObjCompras.Commit()
Else
Alert("No se pudo registrar la devolución.", TipoMensaje.MsgAdvertencia)
ObjCompras.RollBack()
End If
ObjCompras.Dispose()
InicializaDevolucionAlmacen()
End Sub
Function RegistroInventarioDevTemporal(ByRef transaccion As SqlTransaction, tCveSubProyecto As Integer, CveCompraDRMCRelacionada As Integer, EsCancelacion As Boolean) As Boolean
'Dim CveConceptoInv As Integer = If(OpcionOrigen = 1, 2, 3)
Dim CveConceptoSalida As Integer = If(EsCancelacion, 2, 13)
'Dim CveConceptoEntrada As Integer = 2 'OIC FIXME Ver Con Rene
Dim Respuesta As Boolean = True
'Dim ObjOC As New ClsOC(transaccion)
Dim CveAlmacenOrigen As Integer = -1
'Dim CveAlmacenDestino As Integer = -1
For Each gvRow As GridViewRow In GvInvMov.Rows
CveAlmacenOrigen = gvRow.DataKey("CveAlmacen").ToEntero
@@ -19299,31 +19250,12 @@ Partial Class Compras_Compras
Return False
End If
'CveAlmacenDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveSubProyecto = {tCveSubProyecto} AND CveTipoAlmacen = 21 ").ToEntero
'If CveAlmacenDestino <= 0 Then
' CveAlmacenDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen = 21 ").ToEntero
'End If
'If CveAlmacenDestino <= 0 Then
' Alert("Almacén destino de devolución proveedor no esta asignado.")
' Return False
'End If
Dim ObjConta As New ClsContabilidad(transaccion)
Dim ObjInventario As New ClsInventarios(transaccion)
'Dim CveConceptoInv As Integer = If(TipoTermino = 1, 3, 2)
Dim CvePrePolizaSalida As Integer = ObjConta.AddPrePolizas("Comp/InvDevSal", 53, 0, 0, 1, TxtFecha.Text.Replace(",", "").ToDate, $"Devolución proveedor {TxtSerie.Text}{TxtFolio.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
'Dim CvePrePolizaEntrada As Integer = ObjConta.AddPrePolizas("Comp/InvDevEnt", 53, 0, 0, 1, TxtFecha.Text.Replace(",", "").ToDate, $"Devolución proveedor {TxtSerie.Text}{TxtFolio.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
Dim CvePrePolizaSalida As Integer = ObjConta.AddPrePolizas("Comp/InvDevSal", 53, 0, 0, 1, Now, $"Devolución proveedor {TxtSerie.Text}{TxtFolio.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenOrigen, CveConceptoSalida, 1, NowADS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraDRMCRelacionada, -1, tCveSubProyecto, -1, Observaciones:=$"Devolución proveedor {TxtSerie.Text}{TxtFolio.Text}",
CveAlmacenDestino:=-1, Modulo:="ComprasDev/1")
Dim FolioMtoSalida As Integer = ObjInventario.Folio
Dim FolioMtoEntrada As Integer = 0 'Se asigna mas abajo
If CveMovimientoSalida <= 0 OrElse CvePrePolizaSalida <= 0 Then
Alert("No se pudo almacenar el movimiento correctamente", TipoMensaje.MsgError)
@@ -19342,15 +19274,12 @@ Partial Class Compras_Compras
Dim Cantidad As Decimal = gvRow.DataKey("Cantidad").ToDecimal
If Cantidad > 0 Then
Dim CveUM As Integer = gvRow.DataKey("CveUM").ToString.ToEntero
Dim CvePS As Integer = gvRow.DataKey("CvePS").ToString.ToEntero
'Dim CveCompraDetalle As Integer = gvRow.DataKey("CveCompraDetalle").ToEntero' OIC 2024-12-26 se quita relacion
Dim PU As Decimal = gvRow.DataKey("PU").ToDecimal
Dim CodigoPS As String = gvRow.DataKey("CodigoPS")
If UsuarioActual.TienePermisoProceso(114) Or EsCancelacion Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUM, CvePS, PU, -1, Observaciones:=$"Devolución proveedor {TxtSerie.Text}{TxtFolio.Text}", CveUsuarioModifico:=UsuarioActual.CveUsuario,
CveOrdenCompraDetalle:=-1) Then
@@ -19364,9 +19293,6 @@ Partial Class Compras_Compras
Respuesta = False
Exit For
End If
Cont += 1
End If
@@ -19379,7 +19305,6 @@ Partial Class Compras_Compras
Dim Cantidad As Decimal = gvRow.FCTextBox("TxtCant").Text.ToDecimal
If Cantidad > 0 Then
Dim CveUM As Integer = gvRow.DataKey("CveUM").ToString.ToEntero
Dim CvePS As Integer = gvRow.DataKey("CvePS").ToString.ToEntero
'Dim CveCompraDetalle As Integer = gvRow.DataKey("CveCompraDetalle").ToEntero' OIC 2024-12-26 se quita relacion
@@ -19394,7 +19319,6 @@ Partial Class Compras_Compras
Exit For
End If
Else
If UsuarioActual.TienePermisoProceso(114) Or EsCancelacion Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUM, CvePS, PU, -1, Observaciones:=$"Devolución proveedor {TxtSerie.Text}{TxtFolio.Text}", CveUsuarioModifico:=UsuarioActual.CveUsuario,
CveOrdenCompraDetalle:=-1) Then
@@ -19408,47 +19332,14 @@ Partial Class Compras_Compras
Respuesta = False
Exit For
End If
End If
Cont += 1
End If
Next
End If
''Se quita entrada
'Dim CveMovimientoEntrada As Integer = ObjInventario.AddMovimiento(CveAlmacenDestino, CveConceptoEntrada, 1, NowADS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, tCveSubProyecto, -1, Observaciones:=$"Devolución proveedor {TxtSerie.Text}{TxtFolio.Text}",
' Modulo:="ComprasDev/2", CveMovimientoRelacionado:=CveMovimientoSalida)
'FolioMtoEntrada = ObjInventario.Folio
'If Respuesta AndAlso CveMovimientoEntrada > 0 Then
' If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
' For Each dRow As DataRow In ObjInventario.DtResultados.Rows
' Dim Cantidad As Decimal = dRow("Cantidad").ToString.ToDecimal
' If Cantidad > 0 Then
' Dim CveUM As Integer = dRow("CveUM").ToString.ToEntero
' Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
' Dim CveMovimientoDetalle As Integer = dRow("CveMovimientoDetalle").ToString.ToEntero
' Dim PU As Decimal = dRow("PU").ToString.ToDecimal
' Dim CodigoPS As String = dRow("CodigoPS").ToString
' Dim ImporteConcepto As Decimal = PU
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, ImporteConcepto, Observaciones:=$"Devolución proveedor {TxtSerie.Text}{TxtFolio.Text}", CveUsuarioModifico:=UsuarioActual.CveUsuario,
' CveMovimientoDetalleEntrada:=CveMovimientoDetalle) Then
' Mensaje = "Error al guardar los movimientos"
' Respuesta = False
' Exit For
' End If
' Cont += 1
' End If
' Next
' End If
'End If
'PrePoliza Movmiento de salida
Dim EsContabilizable As Boolean = False
Dim EsContabilizable As Boolean = True
'Registro la prepóliza
If Respuesta AndAlso ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim tValorInventario As Decimal = ObjInventario.DtResultados.SUMD("Total", "").RoundSQL() '* (If(EsCancelacion, -1, 1))
@@ -19457,7 +19348,6 @@ Partial Class Compras_Compras
Dim TipoMovtoAlmacen As Boolean = False
Dim TipoMovtoOtro As Boolean = True
Dim drA2 As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", CveAlmacenOrigen))
If drA2 IsNot Nothing Then
tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero
@@ -19469,40 +19359,6 @@ Partial Class Compras_Compras
Dim CveConceptoContable As Integer = 260
Dim CveClasificacion As Integer = -1
Select Case CveConceptoSalida
Case 2, 32
CveConceptoContable = 78
EsContabilizable = True
Case 28, 31
CveConceptoContable = 51
If CveConceptoSalida = 28 Then
''cuando es 28, es otros ingresos.78
CveConceptoContable = 78
End If
EsContabilizable = True
Case 30
CveConceptoContable = 181
TipoMovtoOtro = False
If DdlSubProyecto.Visible = True AndAlso DdlSubProyecto.SelectedValue.ToEntero > 0 Then tCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero
Case 34
CveConceptoContable = 51
EsContabilizable = True
Case 13, 29
CveConceptoContable = 69
TipoMovtoOtro = True
'tValorOtro = -tValorOtro
Dim drr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimero("")
If drr IsNot Nothing Then
CveClasificacion = drr("CveClasificacion").ToString.ToEntero
End If
Case 3
CveConceptoContable = 51
EsContabilizable = True
Case Else
CveConceptoContable = 95
End Select
'2-78
Dim Obs As String = $"Devolución proveedor {TxtSerie.Text}{TxtFolio.Text}"
@@ -19517,137 +19373,23 @@ Partial Class Compras_Compras
Respuesta = False
End If
Next
'If CveConceptoContable.Contiene(181, 78, 51, 69) Then
' Dim Dt As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}).Copy
' For Each Dr As DataRow In Dt.Rows
' Dim Total As Decimal = ObjInventario.DtResultados.FiltraParametros($"CveClasificacion = {Dr("CveClasificacion")}").SUM("Total").RoundSQL()
' If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaSalida, Not TipoMovtoAlmacen, Total, Total, CveConceptoContable, LblFolio.Text, Obs, 0, CveMovimientoAlmacen:=CveMovimientoSalida, CveClasificacion:=Dr("CveClasificacion").ToString.ToEntero, CveSubProyecto:=tCveSubProyecto) Then
' Respuesta = False
' End If
' Next
'Else
' If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaSalida, Not TipoMovtoAlmacen, tValorInventario, tValorInventario, CveConceptoContable, Obs, Obs, CveMovimientoAlmacen:=CveMovimientoSalida, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then
' Respuesta = False
' End If
'End If
Else
Respuesta = False
End If
Else
Respuesta = False
End If
''PrePoliza Movmiento de entrada
'If Respuesta AndAlso ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
' Dim tValorInventario As Decimal = ObjInventario.DtResultados.SUMD("Total", "").RoundSQL()
' Dim tValorOtro As Decimal = tValorInventario
' Dim TipoMovtoAlmacen As Boolean = False
' Dim TipoMovtoOtro As Boolean = True
' Dim drA2 As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", CveAlmacenOrigen))
' If drA2 IsNot Nothing Then
' tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero
' End If
' Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & CveConceptoEntrada).ToEntero
' If OrigenMov = 1 Then TipoMovtoAlmacen = False Else TipoMovtoAlmacen = True
' TipoMovtoOtro = Not TipoMovtoAlmacen
' Dim CveConceptoContable As Integer = 260
' Dim CveClasificacion As Integer = -1
' Select Case CveConceptoEntrada
' Case 2, 32
' CveConceptoContable = 78
' EsContabilizable = True
' Case 28, 31
' CveConceptoContable = 51
' If CveConceptoEntrada = 28 Then
' ''cuando es 28, es otros ingresos.78
' CveConceptoContable = 78
' End If
' EsContabilizable = True
' Case 30
' CveConceptoContable = 181
' TipoMovtoOtro = False
' If DdlSubProyecto.Visible = True AndAlso DdlSubProyecto.SelectedValue.ToEntero > 0 Then tCveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero
' Case 34
' CveConceptoContable = 51
' EsContabilizable = True
' Case 13, 29
' CveConceptoContable = 69
' TipoMovtoOtro = True
' tValorOtro = -tValorOtro
' Dim drr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimero("")
' If drr IsNot Nothing Then
' CveClasificacion = drr("CveClasificacion").ToString.ToEntero
' End If
' Case 3
' CveConceptoContable = 51
' EsContabilizable = True
' Case Else
' CveConceptoContable = 95
' End Select
' '2-78
' Dim Obs As String = $"Devolución proveedor {TxtSerie.Text}{TxtFolio.Text}"
' If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaEntrada, TipoMovtoAlmacen, tValorInventario, tValorInventario, 68, Obs, Obs, CveMovimientoAlmacen:=CveMovimientoEntrada, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then
' Respuesta = False
' Else
' 'Dim Total As Decimal = 0
' If CveConceptoContable.Contiene(181, 78, 51, 69) Then
' Dim Dt As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}).Copy
' For Each Dr As DataRow In Dt.Rows
' Dim Total As Decimal = ObjInventario.DtResultados.FiltraParametros($"CveClasificacion = {Dr("CveClasificacion")}").SUM("Total").RoundSQL()
' If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaEntrada, Not TipoMovtoAlmacen, Total, Total, CveConceptoContable, LblFolio.Text, Obs, 0, CveMovimientoAlmacen:=CveMovimientoEntrada, CveClasificacion:=Dr("CveClasificacion").ToString.ToEntero, CveSubProyecto:=tCveSubProyecto) Then
' Respuesta = False
' End If
' Next
' Else
' If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaEntrada, Not TipoMovtoAlmacen, tValorInventario, tValorInventario, CveConceptoContable, Obs, Obs, CveMovimientoAlmacen:=CveMovimientoEntrada, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then
' Respuesta = False
' End If
' End If
' End If
'Else
' Respuesta = False
'End If
End If
If Respuesta Then
Alert($"Movimientos Guardados Correctamente Folio Salida: {FolioMtoSalida}, Folio Entrada: {FolioMtoEntrada}", TipoMensaje.MsgInformacion)
Alert($"Solicitud de devolución guardada. <br/> Folio Salida: <b><a href = '/Inventarios/EntradasSalidas.aspx?CveMovimiento={CveMovimientoSalida}' class='Titulo'>{FolioMtoSalida}</a><b> ", TipoMensaje.MsgInformacion)
End If
Return Respuesta
End Function
'Protected Sub LBDevolucionAlmacen_Click(sender As Object, e As EventArgs)
' Dim ObjCompras As New ClsCompras
' If ObjCompras.UpdateEstatusAlmacen(CveCompra, If(EstatusAlmacen = 1, 0, 1)) Then
' EstatusAlmacen = If(EstatusAlmacen = 1, 0, 1)
' Alert(If(EstatusAlmacen = 1, "La solicitud de devolución de almacen se guardo correctamente.", "La solicitud de almacen se canceló correctamente."))
' End If
' ObjCompras.Dispose()
' InicializaDevolucionAlmacen()
'End Sub
Private Sub HabilitaNCInv()
@@ -22213,7 +21955,7 @@ Partial Class Compras_Compras
#Region "PRONTO PAGO"
Public Function GeneraRNC(ByRef sqltransaccion As SqlTransaction, CveCompraRegistrada As Integer, ByRef CompraActual As Compra, ByRef ObjConta As ClsContabilidad, CvePrePoliza As Integer,
CveProveedor As Integer, NombreProveedor As String, Fecha As Date, Descripcion As String, CveMoneda As Integer, Serie As String, Folio As String, Optional EsDRMN As Boolean = False) As Boolean
CveProveedor As Integer, NombreProveedor As String, Fecha As Date, Descripcion As String, CveMoneda As Integer, Serie As String, Folio As String, Optional EsDRMN As Boolean = False, Optional TmpListadoPS As DataTable = Nothing) As Boolean
CveCompraDRMC = -1
Dim respuesta As Boolean = True
Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal
@@ -22247,7 +21989,7 @@ Partial Class Compras_Compras
.NombreProveedor = NombreProveedor,
.Fecha = Fecha,
.CveMoneda = CveMoneda,
.Serie = If(EsDRMN, $"DRNC{Serie}", Serie),
.Serie = If(EsDRMN, $"DRNC-{Serie}", Serie),
.Folio = Folio,
.CveCompraAmortizacion = CveCompraRegistrada
}
@@ -22779,7 +22521,7 @@ Public Class ClsCompraManagerCompras
Public Property AplicoPromocion As Boolean = False
Public Property CveConceptoContableAlmacen As Integer = -1
Public Property NoDeducible As Integer = 0
Public Property CveTipoCompra As Integer = 1
Public Property CveTipoCompra As Integer = -1
Public Property TotalOriginal As Decimal = 0D
Public Property CveTipoConcepto As Integer = 1 'FIX ME Esto tiene que ver con el CveTipoProveedor 1 y 3 es CveTipoConcepto 1 y 2 es CveTipoConcepto 2
Public Property CveSubProyectoPrincipal As Integer = -1

View File

@@ -299,7 +299,7 @@
<div class="col-md-12">
<asp:GridView ID="GvSolicitudes" runat="server" AutoGenerateColumns="False"
DataKeyNames="CvePS, CodigoPS, CveUM, Cantidad, Precio, Observaciones, CveContratoDetalle,UnidadMedida,Serie, Lote, FechaCaducidad" EmptyDataText="No se encontraron Productos registrados"
DataKeyNames="CveTrasladoSolicitudDetalle,CvePS, CodigoPS, CveUM, Cantidad, Precio, Observaciones, CveContratoDetalle,UnidadMedida,Serie, Lote, FechaCaducidad" EmptyDataText="No se encontraron Productos registrados"
ToolTip="Listado de Productos" CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall" GridLines="None"
OnRowDataBound="GvSolicitudes_RowDataBound" >
<Columns>
@@ -359,7 +359,7 @@
$chk.prop('checked', true);
} else if (valorTxt > cantidad) {
$chk.prop('checked', true);
$txt.val(cantidad);
//$txt.val(cantidad);
}
}
}

View File

@@ -270,7 +270,7 @@ Partial Class Inventarios_TrasladoSolicitud
'CodigoPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=Row.DataKey("CvePS").ToEntero).FiltroPrimeroValor("PSCodigo", "")
Existencia = ObjInventarios.GetExistenciasPS(DdlProductoServicio.SelectedValue.ToEntero, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=NowADS.ToString("yyyy/MM/dd 23:59"))
If Existencia - (TempDT.SUM("Cantidad", $"CvePS = {DdlProductoServicio.SelectedValue.ToEntero} AND CveUM = {CveUnidadMedida}") + TxtCantidad.Text.Trim.ToDecimal) <= 0 Then
If Existencia - (TempDT.SUM("Cantidad", $"CvePS = {DdlProductoServicio.SelectedValue.ToEntero} AND CveUM = {CveUnidadMedida}") + TxtCantidad.Text.Trim.ToDecimal) < 0 Then
MensajeExistencia.AppendFormat("<br/> - <b>{0}.</b> Existencia: {1}", DdlProductoServicio.SelectedText, Existencia)
TieneErrorExistencia = True
End If
@@ -503,8 +503,9 @@ Partial Class Inventarios_TrasladoSolicitud
TextoExistencia.Append("Los siguiente productos no tienen existencia:<br/>")
For Each gvr As GridViewRow In GvSolicitudes.Rows
Dim Existencia As Decimal = 0
Dim Existencia As Decimal = 0
Dim MsgAdicional As String = ""
If ObjInventario.GetExistenciasProducto(gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, CveAlmacenOrigen, FechaMovto:=NowADS.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=-1, Serie:="-1", Lote:="-1", Caducidad:=MinFecha) Then
@@ -606,15 +607,32 @@ Partial Class Inventarios_TrasladoSolicitud
For Each gvr As GridViewRow In GvSolicitudes.Rows
Dim Cantidad As Decimal = gvr.FCTextBox("TxtCantidad").Text.ToDecimal
If gvr.FCCheckBox("Chk").Checked AndAlso Cantidad > 0 Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, 0, CveAF:=-1, CveSeccionAlmacen:=-1, Serie:="-1", Lote:="-1", FechaCaducidad:=MinFecha, Observaciones:="") Then
Dim CveTrasladoSolicitudDetalle As Integer = gvr.DataKey("CveTrasladoSolicitudDetalle").ToEntero
Dim CantidadOriginal As Decimal = gvr.DataKey("Cantidad").ToDecimal
Dim CantidadAceptada As Decimal = gvr.FCTextBox("TxtCantidad").Text.ToDecimal
If gvr.FCCheckBox("Chk").Checked AndAlso CantidadAceptada > 0 Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadAceptada, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, 0, CveAF:=-1, CveSeccionAlmacen:=-1, Serie:="-1", Lote:="-1", FechaCaducidad:=MinFecha, Observaciones:="") Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
End If
If CantidadOriginal <> CantidadAceptada Then
If Not ObjInventario.UpdateTrasladoSolicitudDetalle(CveTrasladoSolicitudDetalle, UsuarioActual.CveEmpresa, -1, CantidadAceptada, -1, -1, -1, "-1", -1, "-1", "-1", MinFecha) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al actuazliar el detalle de traslado"
Exit For
End If
End If
Cont += 1
End If
Next
'For Each Dr As DataRow In DtMovimientos.RowsF
@@ -752,9 +770,12 @@ Partial Class Inventarios_TrasladoSolicitud
Protected Sub GvSolicitudes_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Cantidad As Decimal = e.Row.DataKey("Cantidad").ToDecimal
e.Row.FCCheckBox("chk").Attributes.Add("onclick", $"validaCantidadSolicitud({Cantidad},'{e.Row.FCTextBox("TxtCantidad").ClientID}','{e.Row.FCCheckBox("Chk").ClientID}',1);")
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"validaCantidadSolicitud({Cantidad},'{e.Row.FCTextBox("TxtCantidad").ClientID}','{e.Row.FCCheckBox("Chk").ClientID}',2);")
End If
End Sub

View File

@@ -1,4 +1,5 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Aguinaldo.aspx.cs" Inherits="Nomina_Aguinaldo" %>
<%@ Import Namespace="Extensiones" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
@@ -8,10 +9,12 @@
.dSala {
width: 90px;
}
.dSalaz input {
width: 50px;
text-align: right;
}
.dlab {
width: 50px;
}
@@ -38,6 +41,21 @@
<li>
<asp:LinkButton ID="LnkDownExcel" OnClick="LnkDownExcel_Click" runat="server"><i class="fa fa-download"></i> Descargar excel</asp:LinkButton>
</li>
<asp:UpdatePanel runat="server" ID="Upacciones" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAutorizarModal" OnClick="LnkAutorizarModal_Click" Visible="false" runat="server"><i class="fa fa-check" ></i> Autorizar</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkCargarExcel" OnClick="LnkCargarExcel_Click" Visible="false" runat="server"><i class="fa fa-upload" ></i> Cargar Excel</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
@@ -71,7 +89,8 @@
</div>
<div class="col-md-3">
<asp:Button ID="BtnCalcular" runat="server" Text="Calcular" OnClick="BtnCalcular_Click" class="btn btn-primary" />
<asp:Button ID="LnkAutorizarModal" runat="server" Text="Autorizar" OnClick="LnkAutorizarModal_Click" Visible="false" class="btn btn-primary" />
<asp:Button ID="BtnGuardar" Visible ="false" runat="server" Text="Aplicar Cambios" OnClick="BtnGuardar_Click" class="btn btn-success" />
<asp:Button ID="BtnLimpiar" Visible ="false" runat="server" Text="Limpiar" OnClick="BtnLimpiar_Click" class="btn btn-danger" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</div>
</div>
</div>
@@ -138,8 +157,8 @@
</div>
<br />
<div style="text-align: right">
<asp:Button ID="BtnRecalcular" CssClass="btn btn-primary" OnClick="BtnRecalcular_Click" runat="server" Text="Recalcular" />
<asp:TextBox ID="TxtBusqueda" runat="server" CssClass="form-control input-sm" style="display: inline-block; margin-right: -20px; width: 150px;"></asp:TextBox>
<%--<asp:Button ID="BtnRecalcular" CssClass="btn btn-primary" OnClick="BtnRecalcular_Click" runat="server" Text="Recalcular" />--%>
<asp:TextBox ID="TxtBusqueda" runat="server" CssClass="form-control input-sm" Style="display: inline-block; margin-right: -20px; width: 150px;"></asp:TextBox>
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('{1}','{0}')", GVCalcularAguinaldo.ClientID,TxtBusqueda.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
@@ -148,13 +167,14 @@
<Columns>
<asp:TemplateField HeaderText="Nombre ">
<ItemTemplate>
<asp:HyperLink ID="HypnombreCompleto" Visible='<%# Eval("CvePersonal").ToString().ToEntero() > 0%>' runat="server" Text='<%# Eval("Nombre")%>' NavigateUrl='<%# Eval("CvePersonal","/RH/Personal.aspx?CvePersonal={0}")%>'> </asp:HyperLink>
<asp:Label ID="lblnombreCompleto" Visible='<%# (Eval("CvePersonal").ToString().ToEntero() <= 0)%>' runat="server" Text='<%# Eval("Nombre")%>'> </asp:Label>
<asp:HyperLink ID="HypnombreCompleto" Visible='<%# Eval("CvePersonal").ToString().ToEntero() > 0%>' runat="server" Text='<%# Eval("Nombre")%>' NavigateUrl='<%# Eval("CvePersonal","/RH/Personal.aspx?CvePersonal={0}")%>'> </asp:HyperLink>
<asp:Label ID="lblnombreCompleto" Visible='<%# (Eval("CvePersonal").ToString().ToEntero() <= 0)%>' runat="server" Text='<%# Eval("Nombre")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
Fecha<br />ingreso
Fecha<br />
ingreso
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblfechaingreso" runat="server" Text='<%# Eval("FechaInicio", "{0:dd/MM/yyyy}")%>'> </asp:Label>
@@ -163,7 +183,8 @@
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Salario<br />diario
Salario<br />
diario
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblsueldoDiario" runat="server" Text='<%# Eval("SalarioDiario", "${0:N2}")%>'> </asp:Label>
@@ -173,7 +194,8 @@
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Salario<br />Aguinaldo
Salario<br />
Aguinaldo
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblSalarioAguinaldo" runat="server" Text='<%# Eval("SalarioAguinaldo", "${0:N2}")%>'> </asp:Label>
@@ -181,27 +203,33 @@
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" CssClass="dSala" />
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
Días <br />laborados
Días
<br />
laborados
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="TxtdiasLaborados" runat="server" Text='<%# Eval("DiasLaborados", "{0:N0}")%>'> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" CssClass="dlab" />
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
Días <br />Faltados
Días
<br />
Faltados
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="TxtdiasFaltados" runat="server" Text='<%# Eval("DiasFaltados", "{0:N0}")%>'> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" CssClass="dlab" />
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
Días <br />Incapacidad
Días
<br />
Incapacidad
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="TxtdiasIncapacidad" runat="server" Text='<%# Eval("DiasIncapacidad", "{0:N0}")%>'> </asp:Label>
@@ -210,16 +238,20 @@
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Días <br />base
Días
<br />
base
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="TxtdiasAguinaldo" runat="server" Text='<%# Eval("NumDiasAguinaldo")%>'> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" CssClass="dlab" />
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
Días <br /> pago
Días
<br />
pago
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtdiasAguinaldoprop" runat="server" Text='<%# Eval("diasPropAgui", "{0:N2}")%>'> </asp:TextBox>
@@ -227,9 +259,9 @@
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" CssClass="dSalaz" />
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
Aguinaldo
Aguinaldo
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblsueldoAguinaldoz" runat="server" Text='<%# Eval("Aguinaldo", "${0:N2}")%>'> </asp:Label>
@@ -239,75 +271,79 @@
<asp:TemplateField HeaderText="Ajuste($)">
<ItemTemplate>
<asp:TextBox ID="TxtAjuste" runat="server" Text='<%# Eval("Ajuste", "{0:N2}")%>'> </asp:TextBox>
<asp:Label ID="lblAjuste" runat="server" > </asp:Label>
<asp:Label ID="lblAjuste" runat="server"> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" CssClass="dSala" />
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
Aguinaldo <br /> Por Pagar
Aguinaldo
<br />
Por Pagar
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblsueldoAguinaldo" runat="server" Text='<%# Eval("Aguinaldo", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<%-- <asp:TemplateField HeaderText="Aguinaldo exento">
<%-- <asp:TemplateField HeaderText="Aguinaldo exento">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("AguinaldoExento", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" CssClass="dSala" />
</asp:TemplateField>--%>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
Aguinaldo <br /> gravado
Aguinaldo
<br />
gravado
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblAguinaldoGravado" runat="server" Text='<%# Eval("AguinaldoGravado", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Fraccion I">
<ItemTemplate>
<asp:Label ID="lblFraccion1" runat="server" > </asp:Label>
<asp:Label ID="lblFraccion1" runat="server"> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Fraccion II">
<ItemTemplate>
<asp:Label ID="lblFraccion2" runat="server" > </asp:Label>
<asp:Label ID="lblFraccion2" runat="server"> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Fraccion III">
<ItemTemplate>
<asp:Label ID="lblFraccion3" runat="server" > </asp:Label>
<asp:Label ID="lblFraccion3" runat="server"> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Fraccion IV">
<ItemTemplate>
<asp:Label ID="lblFraccion4" runat="server" > </asp:Label>
<asp:Label ID="lblFraccion4" runat="server"> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Total Gravado" >
<asp:TemplateField HeaderText="Total Gravado">
<ItemTemplate>
<asp:Label ID="lbltotalgravado" runat="server" > </asp:Label>
<asp:Label ID="lbltotalgravado" runat="server"> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="I.S.R. Total">
<ItemTemplate>
<asp:Label ID="lblISRTotal" runat="server" > </asp:Label>
<asp:Label ID="lblISRTotal" runat="server"> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="I.S.R. Mensual">
<ItemTemplate>
<asp:Label ID="lblISRMensual" runat="server" > </asp:Label>
<asp:Label ID="lblISRMensual" runat="server"> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
@@ -321,7 +357,7 @@
<asp:TemplateField HeaderText="Descuento">
<ItemTemplate>
<asp:TextBox ID="TxtDescuento" runat="server" Text=''> </asp:TextBox>
<asp:Label ID="lblDescuento" runat="server" > </asp:Label>
<asp:Label ID="lblDescuento" runat="server"> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" CssClass="dSala" />
</asp:TemplateField>
@@ -356,7 +392,6 @@
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalAutorizar" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAutorizar" UpdateMode="Conditional">
@@ -397,6 +432,30 @@
</asp:UpdatePanel>
</div>
<div id="Modalxls" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">Cargar Excel</h4>
</div>
<div class="modal-body">
<asp:TextBox ID="TxtFileaguinaldo" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
<div class="modal-footer">
<asp:LinkButton ID="LnkProcesarXls" OnClick="LnkProcesarXls_Click" CssClass="btn btn-primary" runat="server">Procesar</asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
@@ -404,13 +463,13 @@
FiltrarTabla('<%= TxtBusqueda.ClientID %>', '<%= GVCalcularAguinaldo.ClientID %>');
}
function ADSReady() {
// onkeyup = String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVCalcularAguinaldo.ClientID)'
// onkeyup = String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVCalcularAguinaldo.ClientID)'
setTimeout(filtraaguinaldo, 250);
$('#<%= TxtBusqueda.ClientID %> ').keyup(function () {
filtraaguinaldo();
});
$('#<%= TxtBusqueda.ClientID %> ').bind("copy paste cut ", function () {
filtraaguinaldo();
$('#<%= TxtBusqueda.ClientID %> ').bind("copy paste cut ", function () {
filtraaguinaldo();
});
}
</script>

View File

@@ -8,7 +8,9 @@ using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml.Linq;
using Extensiones;
using static Stimulsoft.Report.StiOptions.Export;
public partial class Nomina_Aguinaldo : ClsPaginas
{
@@ -28,14 +30,25 @@ public partial class Nomina_Aguinaldo : ClsPaginas
{
get
{
return ViewState["tipocalculo"].ToString().ToEntero();
return ViewState["tipocalculo"].ToString().ToEntero();
}
set
{
ViewState["tipocalculo"] = value;
}
}
private int ejercicioActual
{
get
{
return ViewState["ejercicioActual"].ToString().ToEntero();
}
set
{
ViewState["ejercicioActual"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
@@ -66,7 +79,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
LtlUma.Text = "";
int cveempresa = 1;
if (UsuarioActual != null) { cveempresa = UsuarioActual.CveEmpresa; }
using (ClsNominas onom = new ClsNominas())
{
if (onom.UMAFechaGet(cveempresa, $"{NowADS():yyyy/MM/dd}") && onom.DtResultados.Rows.Count > 0)
@@ -84,6 +97,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
int ejercicio = DdlEjercicios.SelectedValue.ToEntero();
int CveTipoPeriodo = DdlTipoPeriodo.SelectedValue.ToEntero();
int CvePeriodo = -1;
ejercicioActual = ejercicio;
using (ClsNominas objnom = new ClsNominas())
{
@@ -98,8 +112,12 @@ public partial class Nomina_Aguinaldo : ClsPaginas
GVCalcularAguinaldo.DataBind();
LnkAutorizarModal.Visible = true;
BtnGuardar.Visible = true;
BtnLimpiar.Visible = true;
LnkCargarExcel.Visible = true;
BtnRecalcular_Click(sender, null);
upDatosPA_N.Update();
Upacciones.Update();
}
private void CargaPeriodos()
{
@@ -266,7 +284,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
if (CveNomina > 0)
{
if (continuar && !objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, ImporteValor, UsuarioActual.CveUsuario, false, 1, 1, 1,false))
if (continuar && !objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, ImporteValor, UsuarioActual.CveUsuario, false, 1, 1, 1, false))
{
continuar = false;
}
@@ -337,6 +355,8 @@ public partial class Nomina_Aguinaldo : ClsPaginas
{
int CveNomina = e.Row.DBCampo("CveNomina").ToString().ToEntero();
int CvePersonal = e.Row.DBCampo("CvePersonal").ToString().ToEntero();
e.Row.FCTextBox("TxtAjuste").Text = e.Row.DBCampo("Ajuste").ToString();
e.Row.FCTextBox("TxtDescuento").Text = e.Row.DBCampo("descuento").ToString();
if (CveNomina > 0)
{
e.Row.CssClass = "success";
@@ -361,7 +381,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
protected void BtnRecalcular_Click(object sender, EventArgs e)
{
tipocalculo = ddltipoCalculo.SelectedValue.ToEntero();
GVCalcularAguinaldo.Columns[13].Visible = (tipocalculo ==1 || tipocalculo == 3);
GVCalcularAguinaldo.Columns[13].Visible = (tipocalculo == 1 || tipocalculo == 3);
GVCalcularAguinaldo.Columns[14].Visible = (tipocalculo == 1 || tipocalculo == 3);
GVCalcularAguinaldo.Columns[15].Visible = (tipocalculo == 1 || tipocalculo == 3);
GVCalcularAguinaldo.Columns[16].Visible = (tipocalculo == 1 || tipocalculo == 3);
@@ -392,7 +412,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
decimal Aguinaldoapagar = 0;
decimal descuento = 0;
decimal ajuste =0;
decimal ajuste = 0;
decimal aguinaldoSubproyeto = 0;
decimal aguinaldogravadoSubproyeto = 0;
@@ -409,9 +429,9 @@ public partial class Nomina_Aguinaldo : ClsPaginas
decimal ISRTOTAL = 0;
decimal AguinaldoapagarTotal = 0;
decimal totalgravado= 0;
decimal totalgravado = 0;
decimal isrtotalgravado = 0;
decimal isrmensual= 0;
decimal isrmensual = 0;
decimal lisr = 0;
GridViewRow gvrowTotal = null;
@@ -442,7 +462,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
diasaguipago = gvrow.FCTextBox("TxtdiasAguinaldoprop").Text.ToDecimal();// (diaslaborados / diasanio) * diasaguinaldo;
salariomensual = salariodiario * 30;
aguinaldo = (diasaguipago * salarioAguinaldo)+ ajuste;
aguinaldo = (diasaguipago * salarioAguinaldo) + ajuste;
/*if (gvrow.FCTextBox("TxtAguinaldoExento").Text.Length > 0)
{
aguinaldoexcento = (aguinaldoExcentoreg > aguinaldo ? aguinaldo : aguinaldoExcentoreg);
@@ -456,7 +476,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
if (aguinaldogravado > 0)
{
totalgravado = aguinaldogravado + salariomensual;
totalgravado = aguinaldogravado + salariomensual;
if (objbase.CalculosISRAguinaldo(totalgravado, salariomensual, diasmes, DdlEjercicios.SelectedValue.ToEntero()))
{
DataRow drow = objbase.DtResultados.Rows[0];
@@ -464,11 +484,11 @@ public partial class Nomina_Aguinaldo : ClsPaginas
isrmensual = drow["isrFraccionIII_1"].ToString().ToDecimal();
}
else { break; }
lisr = isrtotalgravado- isrmensual;
lisr = isrtotalgravado - isrmensual;
@@ -478,7 +498,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
//str.AppendFormat("SELECT dbo.Fnc_NomValues(40, 0, {2}, -1, {0}, {1}, {1}) isrFraccionII_2,", FraccionII_1, diasmes, DdlEjercicios.SelectedValue);
//str.AppendFormat(" dbo.Fnc_NomValues(40, 0, {2}, -1, {0}, {1}, {1}) isrFraccionIII_1", salariomensual, diasmes, DdlEjercicios.SelectedValue);
//if (objbase.runQuerystr(str.ToString()))
if(objbase.CalculosISRAguinaldo(FraccionII_1, salariomensual, diasmes, DdlEjercicios.SelectedValue.ToEntero()))
if (objbase.CalculosISRAguinaldo(FraccionII_1, salariomensual, diasmes, DdlEjercicios.SelectedValue.ToEntero()))
{
DataRow drow = objbase.DtResultados.Rows[0];
FraccionII_2 = drow["isrFraccionII_2"].ToString().ToDecimal();
@@ -494,9 +514,9 @@ public partial class Nomina_Aguinaldo : ClsPaginas
else
{
totalgravado = 0;
isrtotalgravado = 0;
isrmensual = 0;
totalgravado = 0;
isrtotalgravado = 0;
isrmensual = 0;
lisr = 0;
@@ -516,7 +536,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
{
FraccionIV = lisr;
}
if (tipocalculo == 3 && FraccionIV > lisr)
if (tipocalculo == 3 && FraccionIV > lisr)
{
FraccionIV = lisr;
}
@@ -633,7 +653,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
libro.Cell(fila, cxc++).Value = "Días base";
libro.Cell(fila, cxc++).Value = "Días aguinaldo";
libro.Cell(fila, cxc++).Value = "Ajuste";//TxtAjuste
libro.Cell(fila, cxc++).Value = "Aguinaldo completo";
libro.Cell(fila, cxc++).Value = "Aguinaldo completo";
libro.Cell(fila, cxc++).Value = "Aguinaldo gravado";
libro.Cell(fila, cxc++).Value = "Aguinaldo exento";
libro.Cell(fila, cxc++).Value = "Fraccion I"; //lblFraccion1
@@ -641,7 +661,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
libro.Cell(fila, cxc++).Value = "Fraccion III"; //lblFraccion3
libro.Cell(fila, cxc++).Value = "Fraccion IV"; //lblFraccion4
libro.Cell(fila, cxc++).Value = "I.S.R.";
libro.Cell(fila, cxc++).Value = "Descuento"; //TxtDescuento
libro.Cell(fila, cxc++).Value = "Descuento"; //TxtDescuento
libro.Cell(fila, cxc++).Value = "Aguinaldo por pagar";
libro.Range(fila, 1, fila, 20).Style.Font.FontColor = ClosedXML.Excel.XLColor.White;
@@ -666,7 +686,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
}
cxc = 1;
libro.Cell(fila, cxc++).Value = string.Format("'{0}",gvrow.DataKey("Codigo"));
libro.Cell(fila, cxc++).Value = string.Format("'{0}", gvrow.DataKey("Codigo"));
libro.Cell(fila, cxc++).Value = gvrow.FCLabel("lblnombreCompleto").Text;
libro.Cell(fila, cxc++).Value = gvrow.FCLabel("lblfechaingreso").Text;
libro.Cell(fila, cxc++).Value = gvrow.FCTextBox("TxtsueldoDiario").Text.ToDecimal();
@@ -677,7 +697,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
libro.Cell(fila, cxc++).Value = gvrow.FCLabel("TxtdiasAguinaldo").Text.ToDecimal();
libro.Cell(fila, cxc++).Value = gvrow.FCTextBox("TxtdiasAguinaldoprop").Text.ToDecimal();
libro.Cell(fila, cxc++).Value = gvrow.FCTextBox("TxtAjuste").Text.ToDecimal();
libro.Cell(fila, cxc++).Value = gvrow.FCLabel("lblsueldoAguinaldo").Text.ToDecimal();
libro.Cell(fila, cxc++).Value = gvrow.FCLabel("lblAguinaldoGravado").Text.ToDecimal();
libro.Cell(fila, cxc++).Value = gvrow.FCLabel("lblsueldoAguinaldo").Text.ToDecimal() - gvrow.FCLabel("lblAguinaldoGravado").Text.ToDecimal();
@@ -695,7 +715,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
libro.Range(filatitulo, 1, fila, 18).Columns();
libro.Range(filatitulo + 1, 4, fila + 1, 20).DataType = ClosedXML.Excel.XLDataType.Number;
libro.Range(filatitulo + 1, 4, fila + 1,5).Style.NumberFormat.Format = "$###,###,###,##0.00";
libro.Range(filatitulo + 1, 4, fila + 1, 5).Style.NumberFormat.Format = "$###,###,###,##0.00";
libro.Range(filatitulo + 1, 11, fila + 1, 20).Style.NumberFormat.Format = "$###,###,###,##0.00";
libro.ColumnsUsed().AdjustToContents();
@@ -718,4 +738,125 @@ public partial class Nomina_Aguinaldo : ClsPaginas
Response.BinaryWrite(memoryStream.ToArray());
Response.End();
}
protected void BtnGuardar_Click(object sender, EventArgs e)
{
System.Xml.Linq.XDocument xmlregistros = null;
xmlregistros = new System.Xml.Linq.XDocument(
new System.Xml.Linq.XElement("registros",
GVCalcularAguinaldo.Rows.Cast<GridViewRow>().Where(row =>
{
// Obtener el valor de CvePersonal (por DataKeys o celda)
if (int.TryParse(GVCalcularAguinaldo.DataKeys[row.RowIndex]["CvePersonal"]?.ToString(), out var cvePersonal))
{
return cvePersonal > 0;
}
return false;
})
.Select(row =>
{
// Obtener valores directamente desde las celdas o controles
var TxtdiasAguinaldoprop = ((TextBox)row.FindControl("TxtdiasAguinaldoprop"))?.Text;
var txtAjuste = ((TextBox)row.FindControl("TxtAjuste"))?.Text;
var txtDescuento = ((TextBox)row.FindControl("TxtDescuento"))?.Text;
return new XElement("registro",
new XElement("EJercicio", ejercicioActual),
new XElement("CveSubProyecto", GVCalcularAguinaldo.DataKeys[row.RowIndex]["CveSubProyecto"]),
new XElement("CvePersonal", GVCalcularAguinaldo.DataKeys[row.RowIndex]["CvePersonal"]),
new XElement("diasAguinaldo", decimal.TryParse(TxtdiasAguinaldoprop, out var diasPropAgui) ? diasPropAgui : 0),
new XElement("Ajuste", decimal.TryParse(txtAjuste, out var ajuste) ? ajuste : 0),
new XElement("descuento", decimal.TryParse(txtDescuento, out var descuento) ? descuento : 0)
);
}
)));
string xml = xmlregistros.ToString();
using (ClsNominas objnom = new ClsNominas())
{
objnom.GuardarAguinaldo(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, xml, ejercicioActual);
}
BtnCalcular_Click(null, null);
}
protected void BtnLimpiar_Click(object sender, EventArgs e)
{
string xml = "<registros></registros>";
using (ClsNominas objnom = new ClsNominas())
{
objnom.GuardarAguinaldo(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, xml, ejercicioActual);
}
BtnCalcular_Click(null, null);
}
protected void LnkCargarExcel_Click(object sender, EventArgs e)
{
RegistraScript("$('#Modalxls').modal();");
}
protected void LnkProcesarXls_Click(object sender, EventArgs e)
{
List<Archivo> Filesgral = TxtFileaguinaldo.getfiles().Archivos;
bool continuar = Filesgral.Count > 0;
string stringError = "";
Archivo fileItem = continuar ? Filesgral[0] : null;
if (continuar)
{
string FileExtension = fileItem.Extension.ToUpper();
if (FileExtension == "XLS" | FileExtension == "XLSX" | FileExtension == "CSV")
{
}
else
{
continuar = false;
stringError = "No se inserto un archivo de tipo Excel";
}
}
else
{
stringError = "favor de ingresar el archivo y esperar a que cargue";
}
DataTable dtxz = Extensiones.ModExtensiones.ReadExcelFile(fileItem.FileUrl, true);
// Filtrar filas con longitud de "Concepto" > 0
DataRow[] filteredRows = dtxz.Select("LEN(Código) > 0");
// Crear nuevo DataTable con las filas filtradas
DataTable filteredTable = dtxz.Clone(); // Clona la estructura del DataTable original
foreach (DataRow row in filteredRows)
{
filteredTable.ImportRow(row);
}
foreach (GridViewRow gvrow in GVCalcularAguinaldo.Rows)
{
string Codigo = gvrow.DataKey("Codigo");
string TxtdiasAguinaldoprop = "";
string TxtAjuste = "";
string TxtDescuento = "";
DataRow drow = filteredTable.FiltroPrimero(string.Format(" Código='{0}'", Codigo));
if (drow != null)
{
TxtdiasAguinaldoprop = drow["Días aguinaldo"].ToString();
TxtAjuste = drow["Ajuste"].ToString();
TxtDescuento = drow["Descuento"].ToString();
((TextBox)gvrow.FindControl("TxtdiasAguinaldoprop")).Text = TxtdiasAguinaldoprop;
((TextBox)gvrow.FindControl("TxtAjuste")).Text = TxtAjuste;
((TextBox)gvrow.FindControl("TxtDescuento")).Text = TxtDescuento;
}
}
BtnRecalcular_Click(sender, null);
RegistraScript("$('#Modalxls').modal('hide');");
upDatosPA_N.Update();
}
}

View File

@@ -7,10 +7,11 @@
.GVCalculoISRAnual tr td:nth-child(n+6) {
text-align: right;
}
.GVCalculoISRAnual tr td:nth-child(5) {
white-space: nowrap;
}
.GVCalculoISRAnual tr td:nth-child(6) {
white-space: nowrap;
}
@@ -36,7 +37,7 @@
<li>
<asp:LinkButton ID="LnkdownExcel" OnClick="LnkdownExcel_Click" runat="server"><i class="fa fa-download" aria-hidden="true"></i>Descargar XLS</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkFormatoCargaAnual" OnClick="LnkFormatoCargaAnual_Click" runat="server"><i class="fa fa-download" aria-hidden="true"></i> Constancia 37</asp:LinkButton>
</li>
@@ -134,25 +135,31 @@
<asp:Label ID="lblfechaInicio" runat="server" Text='<%# string.Format("{0} - {1:dd/MM/yyyy}",Eval("TipoIngreso"), Eval("FechaInicio"))%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
<span data-toggle="tooltip" data-html="true" title="Suma de percepciones <br/>capturadas en los distintos <br/>periodos del año">Ingresos <br/>totales</span>
<span data-toggle="tooltip" data-html="true" title="Suma de percepciones <br/>capturadas en los distintos <br/>periodos del año">Ingresos
<br />
totales</span>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblingresosTotales" runat="server" Text='<%# Eval("IngresosTotales","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
<span data-toggle="tooltip" data-html="true" title="">Base <br/>gravada</span>
<span data-toggle="tooltip" data-html="true" title="">Base
<br />
gravada</span>
</HeaderTemplate>
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("BaseGravada","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
<span data-toggle="tooltip" data-html="true" title="">Base <br/>exenta</span>
<span data-toggle="tooltip" data-html="true" title="">Base
<br />
exenta</span>
</HeaderTemplate>
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("BaseExcenta","{0:N2}")%>'> </asp:Label>
@@ -160,7 +167,9 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<HeaderTemplate>
<span data-toggle="tooltip" data-html="true" title="Suma del isr capturado <br/>en los distintos <br/>periodos del año">ISR <br/>retenido</span>
<span data-toggle="tooltip" data-html="true" title="Suma del isr capturado <br/>en los distintos <br/>periodos del año">ISR
<br />
retenido</span>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lbliSRRetenido" runat="server" Text='<%# Eval("ISRRetenido","{0:N2}")%>'> </asp:Label>
@@ -174,9 +183,10 @@
<asp:Label ID="lblart152" runat="server" Text='<%# Eval("Art152","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
<span data-toggle="tooltip" data-html="true" title=" suma de importes <br/>durante el ejercicio <br/>(subsidio acreditalbe -<br/> ajuste al subsidio causado)">Subs.<br />correspondiente</span>
<span data-toggle="tooltip" data-html="true" title=" suma de importes <br/>durante el ejercicio <br/>(subsidio acreditalbe -<br/> ajuste al subsidio causado)">Subs.<br />
correspondiente</span>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblsubsCorrespondiente" runat="server" Text='<%# Eval("SubsCorrespondiente","{0:N2}")%>'> </asp:Label>
@@ -184,7 +194,8 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Impuesto anual">
<HeaderTemplate>
<span data-toggle="tooltip" data-html="true" title="">Impuesto<br />anual</span>
<span data-toggle="tooltip" data-html="true" title="">Impuesto<br />
anual</span>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblimpuestoAnual" runat="server" Text='<%# Eval("ImpuestoAnual","{0:N2}")%>'> </asp:Label>
@@ -251,18 +262,33 @@
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" Text="Modalidad:" AssociatedControlID=""></asp:Label>
<asp:DropDownList ID="ddldivision" runat="server" DataTextField="CodigoConcepto" DataValueField="CveConcepto" Class="form-control input-sm select2me" Width="100%" ValidationGroup="GrpGuardar" AutoPostBack="true" OnSelectedIndexChanged="ddldivision_SelectedIndexChanged">
<asp:ListItem Value="1" Text="diferir cargos a futuros periodos" Selected="True"></asp:ListItem>
<asp:ListItem Value="2" Text="aplicar en periodo de diciembre"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="col-md-6" style =" padding-top: 25px;">
<div runat="server" ID="divnumeropagos" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNumerodePagos" Text="1" type="number" min="1" CssClass="form-control" runat="server"></asp:TextBox>
<asp:Label runat="server" Text="Dividir en pagos:" AssociatedControlID="TxtNumerodePagos"></asp:Label>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" Text="Concepto a cargo:" AssociatedControlID=""></asp:Label>
<asp:DropDownList ID="DdlConceptoCargo" runat="server" DataTextField="CodigoConcepto" DataValueField="CveConcepto" Class="form-control input-sm select2me" Width="100%" ValidationGroup="GrpGuardar"></asp:DropDownList>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNumerodePagos" Text="1" type="number" min="1" CssClass="form-control" runat="server"></asp:TextBox>
<asp:Label runat="server" Text="Dividir en pagos:" AssociatedControlID="TxtNumerodePagos"></asp:Label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" Text="Concepto a compensar:" AssociatedControlID=""></asp:Label>
<asp:DropDownList ID="DdlConceptoCompensar" runat="server" DataTextField="CodigoConcepto" DataValueField="CveConcepto" Class="form-control input-sm select2me" Width="100%" ValidationGroup="GrpGuardar"></asp:DropDownList>
</div>
<%--<asp:CheckBox ID="chk" Text=" Calcular en último periodo de diciembre " Checked="false" runat="server" />--%>
</div>
<div class="modal-footer">

View File

@@ -186,7 +186,7 @@ public partial class Nomina_CalculoISRAnual : ClsPaginas
CvePersonal = gvrow.DataKey("CvePersonal").ToString().ToEntero();
using (ClsNominas onom = new ClsNominas())
{
if (onom.PersonalAplicaCalculoAnual(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, CvePersonal, 1, ""))
if (onom.PersonalAplicaCalculoAnual(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Ejercicio, CvePersonal, 1, ""))
{
Alert("El empleado sera incluido al calculo anual");
CargaCalculoISRAnual();
@@ -205,7 +205,7 @@ public partial class Nomina_CalculoISRAnual : ClsPaginas
{
using (ClsNominas onom = new ClsNominas())
{
if (onom.PersonalAplicaCalculoAnual(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, CvePersonal, 0, TxtMotivo.Text))
if (onom.PersonalAplicaCalculoAnual(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Ejercicio, CvePersonal, 0, TxtMotivo.Text))
{
Alert("El empleado sera omitido del calculo anual");
RegistraScript("$('#DModalcancelarEmpleado').modal('hide');");
@@ -345,4 +345,9 @@ public partial class Nomina_CalculoISRAnual : ClsPaginas
Response.End();
}
protected void ddldivision_SelectedIndexChanged(object sender, EventArgs e)
{
divnumeropagos.Visible=(ddldivision.SelectedValue == "1");
}
}

View File

@@ -143,13 +143,14 @@ Partial Class OC_PopUpBuscarReq
ViewState("CveProveedor") = DdlProveedorMultiple.SelectedValue
tCveProveedor = DdlProveedorMultiple.SelectedValue.ToEntero
End If
Dim CveEstatus As Integer = GlobalDTOCEstatus(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatus", "Tipo = 'OC' and TipoTermino = 3").ToEntero
'Cargar Datos
Dim ObjOC As New ClsOC
ObjOC.GetOrdenesCompraVinculacion("OC", -1, -1, -1, MinFecha, MaxFecha, -1, tCveProveedor, -1, -1, UsuarioActual.CveEmpresa)
ObjOC.GetOrdenesCompraVinculacion("OC", -1, -1, CveEstatus, MinFecha, MaxFecha, -1, tCveProveedor, -1, -1, UsuarioActual.CveEmpresa)
Dim DtOC As Data.DataTable = ObjOC.DtResultados
ObjOC.Dispose()
If DtOC.Rows.Count > 0 Then ' tipotermino, esattus inicial
If DtOC.Rows.Count > 0 Then ' tipotermino, estatus inicial
BtnVincularOC.Visible = True
End If

View File

@@ -34,7 +34,7 @@
<asp:TextBox ID="TxtCodigo" runat="server" MaxLength="12" Width="100px"></asp:TextBox></td>
<td class="text-right"><b>Nombre:</b></td>
<td colspan="3">
<asp:TextBox ID="TxtNombre" runat="server" MaxLength="100" Width="362px" autofocus></asp:TextBox></td>
<asp:TextBox ID="TxtNombre" runat="server" MaxLength="100" Width="362px" autofocus="autofocus"></asp:TextBox></td>
</tr>
<tr align="left">
<td class="text-right"><b>NSS:</b></td>
@@ -43,7 +43,7 @@
<td class="text-right"><b>Puesto:</b></td>
<td>
<asp:DropDownList ID="DdlPuestos" runat="server" AppendDataBoundItems="true" DataTextField="Puesto" DataValueField="CvePuesto" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td class="text-right"><b>RFC:</b></td>
@@ -54,19 +54,19 @@
<td class="text-right"><b>Tipo de Período:</b></td>
<td>
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" AppendDataBoundItems="true" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td class="text-right"><b>Tipo de Contrato:</b></td>
<td>
<asp:DropDownList ID="DdlTipoContrato" runat="server" AppendDataBoundItems="true" DataTextField="TipoContrato" DataValueField="CveTipoContrato" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td class="text-right"><b>Departamento:</b></td>
<td>
<asp:DropDownList ID="DdlDepartamentos" runat="server" AppendDataBoundItems="true" DataTextField="Departamento" DataValueField="CveDepartamento" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
@@ -74,19 +74,19 @@
<td class="text-right"><b>Género:</b></td>
<td>
<asp:DropDownList ID="DdlGenero" runat="server" AppendDataBoundItems="true" DataTextField="Genero" DataValueField="CveGenero" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td class="text-right"><b>Estado Civil:</b></td>
<td>
<asp:DropDownList ID="DdlEstadoCivil" runat="server" AppendDataBoundItems="true" DataTextField="EstadoCivil" DataValueField="CveEstadoCivil" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td class="text-right"><b>Escolaridad:</b></td>
<td>
<asp:DropDownList ID="DdlEscolaridad" runat="server" AppendDataBoundItems="true" DataTextField="Escolaridad" DataValueField="CveEscolaridad" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
@@ -101,13 +101,13 @@
<td class="text-right"><b>Turno:</b></td>
<td>
<asp:DropDownList ID="DdlTurnos" runat="server" AppendDataBoundItems="true" DataTextField="Turno" DataValueField="CveTurno" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td class="text-right"><b>Cliente:</b></td>
<td>
<asp:DropDownList ID="DdlClienteAsignado" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
@@ -115,19 +115,19 @@
<td class="text-right"><b>Proyecto:</b></td>
<td>
<asp:DropDownList ID="DdlProyecto" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td class="text-right"><b>Sub Proyecto:</b></td>
<td>
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td class="text-right"><b>Ruta:</b></td>
<td>
<asp:DropDownList ID="DdlRuta" runat="server" AppendDataBoundItems="true" DataTextField="Ruta" DataValueField="CveRuta" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
@@ -135,7 +135,7 @@
<td class="text-right"><b>Estatus:</b></td>
<td>
<asp:DropDownList ID="DdlEstatus" runat="server" AppendDataBoundItems="true" DataTextField="EstatusPersonal" DataValueField="CveEstatusPersonal" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td class="text-right"><b>clasificación:</b></td>
@@ -175,8 +175,6 @@
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
<td colspan="2">
<asp:GridView ID="GvCrt2" runat="server" GridLines="None" BorderWidth="0" CssClass="table table-hover table-advance Widthall" AutoGenerateColumns="False"

View File

@@ -387,7 +387,7 @@
</div>
<div style="text-align: center; padding-top: 20px;">
<asp:Button runat="server" Text="Guardar Cambios" ValidationGroup="GrpGuardar"
<asp:Button runat="server" Text="Guardar Cambios" ValidationGroup="GrpGuardar" ID="BtnGuardar"
CssClass="btn btn-primary" OnClick="UpdateContrato" />
<asp:Button runat="server" Text="Eliminar" CssClass="btn btn-danger"
data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro de eliminar el contrato?(Si es contrato masivo, se eliminarán todos)"

View File

@@ -140,6 +140,18 @@ Partial Class RepContratoDetalle
ViewState("CveMonedaOriginal") = value
End Set
End Property
Private Property CveClienteOriginal As Integer
Get
If ViewState("CveClienteOriginal") Is Nothing Then
ViewState("CveClienteOriginal") = -1
End If
Return ViewState("CveClienteOriginal").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveClienteOriginal") = value
End Set
End Property
Private Property ImporteOrigial As Decimal
@@ -357,6 +369,7 @@ Partial Class RepContratoDetalle
CveSubProyectoOriginal = drc("CveSubProyecto").ToString.ToEntero
CveMonedaOriginal = drc("CveMoneda").ToString.ToEntero
CveClienteOriginal = drc("CveCliente").ToString.ToEntero
ImporteOrigial = Importe
DescripcionOriginal = drc("DescripcionContrato").ToString
TipoAFOriginal = DdlTipoAF.SelectedItem.Text
@@ -601,10 +614,11 @@ Partial Class RepContratoDetalle
ImporteOrigial <> TxtImporte.Text.ToDecimal OrElse
DescripcionOriginal <> TxtDescripcion.Text OrElse
TipoAFOriginal <> DdlTipoAF.SelectedItem.Text OrElse
FolioOriginal <> TxtFolio.Text.Trim) Then
FolioOriginal <> TxtFolio.Text.Trim OrElse
CveClienteOriginal <> DdlClientes.SelectedValue.ToEntero) Then
Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{TxtFolio.Text}"
If Not UpdateRemision(ObjContratos.IniciaTransacSQL(), DdlSubProyecto.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal, ObsRemisionPartida) Then
If Not UpdateRemision(ObjContratos.IniciaTransacSQL(), DdlSubProyecto.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal, ObsRemisionPartida, DdlClientes.SelectedValue.ToEntero) Then
ErrorProceso = True
End If
End If
@@ -653,7 +667,7 @@ Partial Class RepContratoDetalle
End Sub
Private Function UpdateRemision(ByRef transaccionSql As SqlTransaction, CveSubProyectoNew As Integer, CveMonedaNew As Integer, TotalNew As Decimal, DescripcionNew As String) As Boolean
Private Function UpdateRemision(ByRef transaccionSql As SqlTransaction, CveSubProyectoNew As Integer, CveMonedaNew As Integer, TotalNew As Decimal, DescripcionNew As String, CveClienteNew As Integer) As Boolean
Dim Respuesta As Boolean = False
Dim TmpDT As DataTable = New DataTable
@@ -675,12 +689,9 @@ Partial Class RepContratoDetalle
PorcentajeIVA = ObjVentas.DtResultados.MAX("PorcentajeIVA").ToDecimal
If PorcentajeIVA > 0 Then
IVANew = (TotalNew * (PorcentajeIVA * 100)) / (100 + (PorcentajeIVA * 100))
SubTotalNew = TotalNew - IVANew
End If
End If
If TmpDT Is Nothing OrElse TmpDT.Rows.Count = 0 Or FechaVenta = MinFecha Then
@@ -697,7 +708,7 @@ Partial Class RepContratoDetalle
UsuarioActual.CveEmpresa, CveVentaRemision,
Vigencia:=FechaVenta, CondicionesPago:=-1,
PedidoContrato:="-1", AtencionA:="-1", CveMetodoPago33:=-1,
CveFormaPago33:=-1, TipoDocto:="Rem", CveCliente:=-1, CveClienteSucursal:=-1,
CveFormaPago33:=-1, TipoDocto:="Rem", CveCliente:=CveClienteNew, CveClienteSucursal:=-1,
OrdenCompra:="-1", RetIVA:=0, RetISR:=0, Kilometraje:=0D, CveUsoCFDi:=-1,
CveVendedor:=-1, ServicioDomicilio:=False, CveMedico:=-1, CveProcedimiento:=-1,
FechaParaSurtir:=MinFecha, Paciente:="-1", Episodio:="-1", CveCondicionEntrega:=-1, FolioRemision:="-1") Then
@@ -721,7 +732,6 @@ Partial Class RepContratoDetalle
If Not OcurrioError Then
Dim DTPrePoliza As New DataTable
If ObjConta.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) Then
DTPrePoliza = ObjConta.DtResultados
If DTPrePoliza.Rows.Count = 0 Then
@@ -733,8 +743,7 @@ Partial Class RepContratoDetalle
End If
For Each dRow As DataRow In DTPrePoliza.Rows
If Not ObjConta.UpdatePrePolizasDetalle(dRow("CvePrePolizaDetalle").ToString.ToEntero, dRow("Concepto").ToString, dRow("CveSubProyecto").ToString.ToEntero, -1, Boolean.Parse(dRow("TipoMovto").ToString), ImporteMN:=TotalNew, Importe:=TotalNew, TipoCambio:=TC) Then
If Not ObjConta.UpdatePrePolizasDetalle(dRow("CvePrePolizaDetalle").ToString.ToEntero, dRow("Concepto").ToString, dRow("CveSubProyecto").ToString.ToEntero, -1, Boolean.Parse(dRow("TipoMovto").ToString), ImporteMN:=TotalNew, Importe:=TotalNew, TipoCambio:=TC, CveCliente:=CveClienteNew) Then
OcurrioError = True
Exit For
End If
@@ -759,6 +768,13 @@ Partial Class RepContratoDetalle
Return False
Else
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, JSBtnAceptar:="BtnRefrescarPagina();")
CveSubProyectoOriginal = DdlSubProyecto.SelectedValue.ToEntero
CveMonedaOriginal = DdlMoneda.SelectedValue.ToEntero
ImporteOrigial = TxtImporte.Text.ToDecimal
DescripcionOriginal = TxtDescripcion.Text
TipoAFOriginal = DdlTipoAF.SelectedItem.Text
FolioOriginal = TxtFolio.Text.Trim
CveClienteOriginal = DdlClientes.SelectedValue.ToEntero
Return True
End If
End Function

View File

@@ -247,7 +247,7 @@ Partial Class Ventas_CatAutorizacionLimites
Dim DiasVencidosAutorizacion As Integer = gvRow.DataKey("DiasVencidosAutorizacion").ToEntero()
If DiasVencidos > DiasVencidosAutorizacion Then
Alert($"No se puede autorizar, los días vencidos del cliente son mayores a la autorización. Dias Vencidos: {DiasVencidos:N0} . Dias autorizados. {DiasVencidosAutorizacion:N0}", TipoMensaje.MsgAdvertencia)
Alert($"No se puede autorizar, los días vencidos del cliente son mayores a la autorización. <br/> Dias Vencidos: {DiasVencidos:N0} . Dias autorizados. {DiasVencidosAutorizacion:N0}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If

View File

@@ -57,16 +57,16 @@
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" CssClass="table table-striped table-hover" runat="server" AutoGenerateColumns="False" GridLines="None">
<asp:GridView ID="GvDatos" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" runat="server" AutoGenerateColumns="False" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Promoción" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:HyperLink runat="server" ID="HLPromocion" Text='<%# Eval("Promocion").ToString %>' CssClass="Texto"></asp:HyperLink>
<asp:HyperLink runat="server" ID="HLPromocion" Text='<%# Eval("Promocion").ToString %>' NavigateUrl ='<%# Eval("CvePromocion", "/Ventas/Promociones.aspx?CvePromocion={0}") %>' CssClass="Texto"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaInicio" DataFormatString="{0:d}" HeaderText="F. Inicio" ItemStyle-Width="70px" />
<asp:BoundField DataField="FechaFin" DataFormatString="{0:d}" HeaderText="F. Fin" ItemStyle-Width="70px" />
<asp:BoundField DataField="SubProyecto" HeaderText="SubProyecto" ItemStyle-Width="100px" />
<asp:BoundField DataField="FechaInicio" DataFormatString="{0:d}" HeaderText="F. Inicio" ItemStyle-Width="80px" />
<asp:BoundField DataField="FechaFin" DataFormatString="{0:d}" HeaderText="F. Fin" ItemStyle-Width="80px" />
<asp:BoundField DataField="SubProyecto" HeaderText="Sucursal" ItemStyle-Width="125px" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="70px">
<ItemTemplate>
<asp:Label runat="server" ID="LbEstatus" Text='<%#If(Eval("Estatus").ToString = "True", "Activo", "Inactivo") %>' />
@@ -82,25 +82,6 @@
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function pageLoad() {
$(document).ready(function () {
gridviewScroll();
});
function gridviewScroll() {
var Tam = TamañoVentana();
var Alto = Tam.height - 210;
$('#<%=GvDatos.ClientID%>').gridviewScroll({
width: 995,
height: Alto,
freezesize: 1,
headerrowcount: 1
});
}
}
</script>
</asp:Content>

View File

@@ -36,7 +36,7 @@ Partial Class Ventas_CatPromociones
Private Sub CargaDatos()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromociones(-1, "-1", -1, -1, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero) Then
If ObjVentas.GetPromociones(-1, MinFecha, -1, -1, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, CveUsuario:=UsuarioActual.CveUsuario) Then
DtDatos = ObjVentas.DtResultados
Else
DtDatos = Nothing
@@ -58,12 +58,5 @@ Partial Class Ventas_CatPromociones
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCHyperLink("HLPromocion").NavigateUrl = String.Format("/Ventas/Promociones.aspx?CvePromocion={0}", e.Row.DBCampo("CvePromocion"))
End If
End Sub
End Class

View File

@@ -1108,7 +1108,7 @@
<div id="DivAnticipos" class="modal ADS fade" role="dialog">
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<div class="modal-dialog">
<div class="modal-dialog" style ="width: 700px;">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
@@ -1189,7 +1189,7 @@
</div>
<br />
<asp:GridView ID="GVAnticipos" runat="server" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="No se encontraron Anticipos del Cliente"
ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall mysmallbtn" data-height="300" Style="text-align: center;" GridLines="None"
ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall mysmallbtn" data-height="300" GridLines="None"
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo,IEPS, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, FolioFiscal, CveClasificacionNC, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal,SaldoConImpuestos,RegresarImpuesto,DevolucionImportePagado,CveCliente,Descuentos">
<Columns>
<asp:TemplateField>

View File

@@ -300,8 +300,8 @@ Partial Class Ventas_PVCobranza
Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario})")
'si hay ya asignado, solo la mostrará
Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario}")
If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta
'Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario}")
'If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta
GvDatos.DataSource = dtt
End If
@@ -1740,19 +1740,19 @@ Partial Class Ventas_PVCobranza
Me.TmpDTAnticiposNCIxCCliente = ObjMovtos.DtResultados.Copy()
End If
'AGREGAR LOS ANTICIPOS, DEV, IxC QUE ESTEN EN PUBLICO GENERAL
If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing AndAlso UsuarioActual.CveEmpresa.Contiene(189, 190, 192, 195, 197) Then
Dim CveClientePublicoGeneral = UsuarioActual.Empresa.Funcionalidad(714).ToEntero()
If CveClientePublicoGeneral > 0 Then
If CveCliente <> CveClientePublicoGeneral Then
If ObjMovtos.GetAnticiposNCIxCCliente(CveClientePublicoGeneral) Then
For Each DrGeneral As DataRow In ObjMovtos.DtResultados.Rows
Me.TmpDTAnticiposNCIxCCliente.Rows.Add(DrGeneral.ItemArray)
Next
End If
End If
End If
End If
''AGREGAR LOS ANTICIPOS, DEV, IxC QUE ESTEN EN PUBLICO GENERAL
'If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing AndAlso UsuarioActual.CveEmpresa.Contiene(189, 190, 192, 195, 197) Then
' Dim CveClientePublicoGeneral = UsuarioActual.Empresa.Funcionalidad(714).ToEntero()
' If CveClientePublicoGeneral > 0 Then
' If CveCliente <> CveClientePublicoGeneral Then
' If ObjMovtos.GetAnticiposNCIxCCliente(CveClientePublicoGeneral) Then
' For Each DrGeneral As DataRow In ObjMovtos.DtResultados.Rows
' Me.TmpDTAnticiposNCIxCCliente.Rows.Add(DrGeneral.ItemArray)
' Next
' End If
' End If
' End If
'End If
ObjMovtos.Dispose()
If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing Then
@@ -1850,11 +1850,11 @@ Partial Class Ventas_PVCobranza
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
For Each dr As DataRow In dtt.Rows
Dim NumeroTelefono = "526621143532"
'If EsProduccion Then
' NumeroTelefono = String.Format("52{0}", dr("Celular").ToString())
'End If
If EsProduccion Then
NumeroTelefono = String.Format("52{0}", dr("Celular").ToString())
End If
EnvioMsg = ModExtensiones.EnviarNotificacionWhatsApp2(NumeroTelefono, "", $"Solicitud de activación de anticipo.\\nFolio: {Folio}.\\nCliente: {NombreCliente}.")
'ClsSisNotificaciones.EnviarAlerta("Solicitud de Anticipo", $"Solicitud de activación de anticipo Folio: {Folio} <br/><a href='/Ventas/Clientes.aspx?CveCliente={CveCliente}&op=ant'>Ir Activar</a>", dr("CveUsuario").ToString, Tipo:=TipoNotificacion.ToastInformacionB)
ClsSisNotificaciones.EnviarAlerta("Solicitud de Anticipo", $"Solicitud de activación de anticipo Folio: {Folio} <br/><a href='/Ventas/Clientes.aspx?CveCliente={CveCliente}&op=ant'>Ir Activar</a>", dr("CveUsuario").ToString, Tipo:=TipoNotificacion.ToastInformacionB)
Next
End If

View File

@@ -164,6 +164,18 @@
<asp:TextBox ID="TxtOrdenCompra" runat="server" CssClass="form-control" Width="230px" Height="30px" style="padding: 0px"></asp:TextBox>
</td>
</tr>
<tr align="left" runat="server" id="TRVendedores" >
<td class="text-right"><b>Vendedor:</b></td>
<td>
<asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="228px" >
<asp:ListItem Selected="true" Text="Todos" Value="-1" ></asp:ListItem>
</asp:DropDownList>
</td>
<td class="text-right"></td>
<td>
</td>
</tr>
<tr>
<td style="text-align: center;" colspan="4">

View File

@@ -30,6 +30,9 @@ Partial Class PopUpBuscarFolio
CargaPS(-1)
'CargaCodigoCliente()
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros("VendedorTipo = 1")
DdlVendedor.DataBind()
RegistraScript($"$('#{TxtFolio.ClientID}').focus();", "A1")
End If
End Sub
@@ -138,7 +141,7 @@ Partial Class PopUpBuscarFolio
Dim ObjVentas As New ClsVentas()
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Serie, Folio, Codigo, Cliente.ToEntero, DdlSubProyecto.SelectedValue.ToEntero,
DdlEstatusFactura.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, FechaI, FechaF, FolioFiscal, If(DdlSucursalCliente.Visible, DdlSucursalCliente.SelectedValue.ToEntero, -1),
DdlPS.SelectedValue.ToEntero, PedidoContrato:=PeidoContrato, OrdenCompra:=OrdenCompra, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TopSelect:=100) Then
DdlPS.SelectedValue.ToEntero, PedidoContrato:=PeidoContrato, OrdenCompra:=OrdenCompra, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TopSelect:=100, CveVendedor:=DdlVendedor.SelectedValue.ToEntero) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
LtlTotalRegistros.Text = ObjVentas.DtResultados.Rows.Count.ToString.FormatoNumero(0)
GV.DataSource = ObjVentas.DtResultados

View File

@@ -3345,12 +3345,10 @@ Partial Class ProductosyServicios
End If
Else
If ObjPS.GetPS(-1, -1, CveEmpresaFranquicia, Codigo:=TxtCodigo.Text.Trim.ToUpper) Then
If ObjPS.DtResultados IsNot Nothing AndAlso ObjPS.DtResultados.Rows.Count = 1 Then
Dim CvePS As Integer = ObjPS.DtResultados.FiltroPrimeroValor("CvePS", String.Format(" Codigo = '{0}'", TxtCodigo.Text.Trim.ToUpper)).ToEntero()
If Not ObjPS.UpdatePS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtNumeroParte.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble,
Dim CvePS As Integer = GlobalDTPSSimplificado(CveEmpresaFranquicia, Codigo:=TxtCodigo.Text.Trim.ToUpper).FiltroPrimeroValor("CvePS").ToEntero
If CvePS > 0 Then
'Dim CvePS As Integer = ObjPS.DtResultados.FiltroPrimeroValor("CvePS", String.Format(" Codigo = '{0}'", TxtCodigo.Text.Trim.ToUpper)).ToEntero()
If Not ObjPS.UpdatePS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtNumeroParte.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble,
(TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, -1, True, ChkAplicaParaVenta.Checked, ChkEstado.Checked, UsuarioActual.CveUsuario, CvePS, CveMetodoInv,
EsPaquete, DdlSATPS.SelectedValue.ToEntero, CveEmpresaFranquicia, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarcaFranquicia,
AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim, AplicaIEPS:=ChkAplicaIeps.Checked, IEPSPorcentaje:=DdlIEPSPorcentaje.SelectedValue.ToDecimal,
@@ -3363,15 +3361,8 @@ Partial Class ProductosyServicios
ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString,
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked,
TiempoCaducidad:=TxtTiempoCaducidad.Text.ToEntero()) Then
Return True
End If
Else
Alert(String.Format("El producto no existe en la franquicia: '{0}'", GlobalDTEmpresas(CveEmpresaFranquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
Return True
End If
Else
Alert(String.Format("Se presento un error al consultar la existencia en la franquicia: '{0}'", GlobalDTEmpresas(CveEmpresaFranquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
Return True

View File

@@ -217,23 +217,23 @@
<asp:BoundField HeaderText="Promoción" DataField="Promocion" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" />
<%--5--%>
<asp:BoundField HeaderText="P.U. Promoción" DataField="PUPromocion" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Ultimo Costo" DataField="UltimoCosto" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" Visible="false" />
<asp:BoundField HeaderText="% Utilidad" DataField="UtilidadPorcentaje" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00}" ItemStyle-Width="10%" Visible="false" />
<%--6--%>
<asp:BoundField HeaderText="Condiciones" ItemStyle-HorizontalAlign="Center" DataField="AplicaRestriccionTexto" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Ultimo Costo" DataField="UltimoCosto" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" Visible="false" />
<%--7--%>
<asp:BoundField HeaderText="Clasificacion" ItemStyle-HorizontalAlign="Left" DataField="Clasificacion"/>
<asp:BoundField HeaderText="% Utilidad" DataField="UtilidadPorcentaje" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00}" ItemStyle-Width="10%" Visible="false" />
<%--8--%>
<asp:BoundField HeaderText="Rin" ItemStyle-HorizontalAlign="Left" DataField="RinTamaño" Visible="false"/>
<asp:BoundField HeaderText="Condiciones" ItemStyle-HorizontalAlign="Center" DataField="AplicaRestriccionTexto" ItemStyle-Width="15%" />
<%--9--%>
<asp:BoundField HeaderText="Clasificacion" ItemStyle-HorizontalAlign="Left" DataField="Clasificacion"/>
<%--10--%>
<asp:BoundField HeaderText="Rin" ItemStyle-HorizontalAlign="Left" DataField="RinTamaño" Visible="false"/>
<%--11--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
<ItemTemplate>
<asp:LinkButton ID="LnkGvDetalleEditar" runat="server" AlternateText="Editar" CausesValidation="False" CommandArgument='<%# Container.DataItemIndex%>' CommandName="Editar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<%--10--%>
<%--12--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
<ItemTemplate>
<asp:LinkButton ID="LnkGvDetalleEliminar" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
@@ -333,7 +333,7 @@
<asp:Label Text="" ID="LbPUActual" runat="server" />
</div>
</div>
<div class="row">
<div class="row" runat="server" visible ="true" id="DVUltimoCostoCostoPromedio">
<label class="col-md-3 truncate">Ultimo Costo:</label>
<div class="col-md-3">
<asp:Label Text="" ID="LblUltimoCosto" runat="server" />

View File

@@ -20,12 +20,12 @@ Partial Class Ventas_Promociones
End Set
End Property
Private Property TempDTOrigial As DataTable
Private Property TempDTOriginal As DataTable
Get
Return CType(ViewState("TempDTOrigial"), DataTable)
Return CType(ViewState("TempDTOriginal"), DataTable)
End Get
Set(value As DataTable)
ViewState("TempDTOrigial") = value
ViewState("TempDTOriginal") = value
End Set
End Property
@@ -146,8 +146,6 @@ Partial Class Ventas_Promociones
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -176,8 +174,7 @@ Partial Class Ventas_Promociones
CargaDatos()
LnkAgrgarPlantillaPS.Visible = False
ValidaPromosiones(False)
'ValidaPromociones(False)
If EmpresaGrupoDiaz Then
If ChkEstatus.Checked = False AndAlso BloqueadoPromocionPorcentaje AndAlso Not PermisoAutorizPromocionPorcentaje Then
@@ -187,7 +184,6 @@ Partial Class Ventas_Promociones
If ChkEstatus.Checked = True And Not PermisoAutorizPromocionPorcentaje Then
BtnGuardar.Visible = False
ButBtnEliminar.Visible = False
'UpBotones.Update()
End If
End If
@@ -198,6 +194,12 @@ Partial Class Ventas_Promociones
CreaDT()
End If
If EmpresaGrupoDiaz AndAlso Not PermisoAutorizPromocionPorcentaje Then
DVUltimoCostoCostoPromedio.Visible = False
GvDatos.Columns(6).Visible = False
GvDatos.Columns(7).Visible = False
End If
CargaGvBitacora()
@@ -346,7 +348,7 @@ Partial Class Ventas_Promociones
TempDT.Columns.Add("UtilidadPorcentaje", GetType(Decimal))
TempDTOrigial = TempDT.Copy
TempDTOriginal = TempDT.Copy
'366 Estatus
'367 CvePS
@@ -419,7 +421,7 @@ Partial Class Ventas_Promociones
Private Sub CargaDatos()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromociones(CvePromocion, "-1", -1, -1, -1, UsuarioActual.CveEmpresa, -1) AndAlso ObjVentas.DtResultados.Rows.Count = 1 Then
If ObjVentas.GetPromociones(CvePromocion, MinFecha, -1, -1, -1, UsuarioActual.CveEmpresa, -1) AndAlso ObjVentas.DtResultados.Rows.Count = 1 Then
Dim Dr As DataRow = ObjVentas.DtResultados.Rows(0)
TxtPromocion.Text = Dr("Promocion").ToString
TxtFechaI.Text = Dr("FechaInicio").ToString.ToDate.ToShortDateString
@@ -438,11 +440,6 @@ Partial Class Ventas_Promociones
Else
DdlClientes.SelectedValue = Dr("CveCliente").ToString
End If
End If
ChkEstatus.Checked = If(Dr("Estatus").ToString = "True", True, False)
@@ -455,12 +452,12 @@ Partial Class Ventas_Promociones
If ObjVentas.GetPromocionesDetalle(CvePromocion, UsuarioActual.CveEmpresa) Then
TempDT = ObjVentas.DtResultados.Copy
TempDTOrigial = ObjVentas.DtResultados.Copy
TempDTOriginal = ObjVentas.DtResultados.Copy
CargaGrid()
Else
Alert("Ocurrió un error al consultar los detalles de la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
CargaGvBitacora()
Else
Alert("Ocurrió un error al consultar la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
@@ -480,7 +477,6 @@ Partial Class Ventas_Promociones
UpDatos.Update()
End Sub
Private Sub CargaMonedas()
DdlMoneda.DataSource = GlobalDTMonedas
DdlMoneda.DataBind()
@@ -633,8 +629,6 @@ Partial Class Ventas_Promociones
Dr("UltimoCosto") = UltimoCosto
Dr("CostoPromedio") = CostoPromedio
If UltimoCosto > 0 Then
Dim Promocion As Decimal = TxtPromocionConcepto.Text.ToDecimal
@@ -654,12 +648,6 @@ Partial Class Ventas_Promociones
Dr("UtilidadPorcentaje") = 0.0D
End If
If CveConsecutivo >= 0 Then
Dr.AcceptChanges()
Else
@@ -669,20 +657,18 @@ Partial Class Ventas_Promociones
CargaGrid()
RegistraScript("$('#DivAgregar').modal('hide')")
ValidaPromosiones(True)
ValidaPromociones(True)
End Sub
Private Sub ValidaPromosiones(Bloquear As Boolean)
Private Sub ValidaPromociones(Bloquear As Boolean)
If Not EmpresaGrupoDiaz Then
BloqueadoPromocionPorcentaje = False
Exit Sub
End If
Dim DTPSUltimoCosto = New DataTable
Dim ObjInv As New ClsInventarios
@@ -691,8 +677,6 @@ Partial Class Ventas_Promociones
End If
ObjInv.Dispose()
If PorMinMasCostoVentaFnc129 > 0 Then
For Each dRow As DataRow In TempDT.Rows
@@ -724,11 +708,9 @@ Partial Class Ventas_Promociones
Exit For
End If
End If
Else
BloqueadoPromocionPorcentaje = True
End If
Next
End If
@@ -736,7 +718,6 @@ Partial Class Ventas_Promociones
ChkEstatus.Checked = False
ChkEstatus.Enabled = False
End If
UpGenerales.Update()
End Sub
@@ -751,7 +732,6 @@ Partial Class Ventas_Promociones
#End Region
#Region " GV PS "
Private Sub GvDatos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvDatos.RowCommand
@@ -835,7 +815,7 @@ Partial Class Ventas_Promociones
End If
ValidaPromosiones(True)
ValidaPromociones(True)
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
Dim ObjVentas As New ClsVentas
@@ -950,7 +930,7 @@ Partial Class Ventas_Promociones
Dim Dr2 As DataRow = TempDTOrigial.FiltraParametros($"CvePromocionDetalle = {Dr("CvePromocionDetalle").ToString}").Rows(0)
Dim Dr2 As DataRow = TempDTOriginal.FiltraParametros($"CvePromocionDetalle = {Dr("CvePromocionDetalle").ToString}").Rows(0)
If Not TieneError And Dr("CvePS").ToString <> Dr2("CvePS").ToString Then
If Not ObjGral.AddHistorialBitacora(367, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("CodigoPS").ToString, Dr2("CodigoPS").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
@@ -1271,14 +1251,12 @@ Partial Class Ventas_Promociones
Dim contenido As Byte() = System.IO.File.ReadAllBytes(rutaArchivoPlantilla)
Response.BinaryWrite(contenido)
Response.Flush()
Response.End()
End Sub
Protected Sub BrnAgregarPlantilla_Click(sender As Object, e As EventArgs)
If TxtExcel.getfiles().Archivos.Count > 0 Then
@@ -1374,15 +1352,13 @@ Partial Class Ventas_Promociones
CargaGrid()
RegistraScript("$('#DivAgregarPlantilla').modal('hide')")
ValidaPromosiones(True)
ValidaPromociones(True)
End Sub
Private Function ValidaDTPlantilla(ByRef DTPlantilla As DataTable) As Boolean
Dim Errores As New StringBuilder
DTPlantilla.Columns.Add("CveClasificacion", GetType(Integer))
DTPlantilla.Columns.Add("CvePS", GetType(Integer))
DTPlantilla.Columns.Add("CveTipoPromosicion", GetType(Integer))
@@ -1396,13 +1372,13 @@ Partial Class Ventas_Promociones
Dim DTPS As DataTable = New DataTable
Dim DTRines As DataTable = New DataTable
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then
DTPS = ObjPS.DtResultados
End If
ObjPS.Dispose()
'Dim ObjPS As New ClsProductosServicios
'If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then
' DTPS = ObjPS.DtResultados
'End If
'ObjPS.Dispose()
DTPS = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
DTRines = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa)
Dim RegistroActual As Integer = 1
@@ -1436,7 +1412,6 @@ Partial Class Ventas_Promociones
If ClasificacionStr.Length > 0 And CodigoStr.Length > 0 Then
SBErrorRegistro.Append($"No se puede agregar Clasificación y codigo en un mismo registro. ")
Else
If ClasificacionStr.Length > 0 Then
SBErrorRegistro.Append(If(CveClasificacion > 0, "", $"No se encontro Clasificación '{ClasificacionStr}'. </br>"))
Else
@@ -1513,9 +1488,7 @@ Partial Class Ventas_Promociones
LblCostoPromedio.Text = DTPSUltimoCosto.FiltroPrimeroValor("CostoPromedio", "").FormatoNumero(4)
LbPUActual.Text = DTPSUltimoCosto.FiltroPrimeroValor("Importe", "").FormatoNumero(4)
UpAgregar.Update()
End Sub
End Class