This commit is contained in:
Hector
2021-07-27 18:39:31 -07:00
22 changed files with 868 additions and 370 deletions

View File

@@ -5852,6 +5852,71 @@ Public Class ClsContabilidad
Return Retorno Return Retorno
End Function End Function
#Region "Globales"
Public Function GetCuentasGlobales(CveEmpresa As Integer) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_CuentasGlobalesGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
Me.OnError("Ocurrió un error al obtener el catálogo de cuentas globales", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function AddCuentasGlobales(CveConceptoContable As Integer, CveCuenta As Integer, TipoGlobal As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_CuentasGlobalesAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@TipoGlobal", SqlDbType.Int).Value = TipoGlobal
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
Me.OnError("Ocurrió un error al eliminar el catálogo de cuentas asignación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function RemoveCuentasGlobales(CveConceptoContable As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_CuentasGlobalesDelete")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
Me.OnError("Ocurrió un error al eliminar el catálogo de globales", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
Public Function GetContaEjercicio(CveEmpresa As Integer) As Boolean Public Function GetContaEjercicio(CveEmpresa As Integer) As Boolean
Dim Retorno = False Dim Retorno = False

View File

@@ -1084,12 +1084,14 @@ Public Class ClsContratos
End Function End Function
Public Function GetContratosDetalle(CveContrato As Integer) As Boolean Public Function GetContratosDetalle(CveContrato As Integer, CveEmpresa As Integer, Optional Grupo As Integer = 1) As Boolean
Dim Retorno = False Dim Retorno = False
DataAdapter("PA_Con_ContratosDetalleGet") DataAdapter("PA_Con_ContratosDetalleGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato .Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Grupo", SqlDbType.Int).Value = Grupo
End With End With
Try Try

View File

@@ -1961,7 +1961,7 @@ Public Class E141 : Implements IHttpHandler
End If End If
End If End If
Threading.Thread.Sleep(3000) Threading.Thread.Sleep(1000)
End While End While
End If End If
@@ -2219,8 +2219,7 @@ Public Class E141 : Implements IHttpHandler
CountPeticionesExitosas += 1 CountPeticionesExitosas += 1
End If End If
End If End If
Threading.Thread.Sleep(1000)
Threading.Thread.Sleep(3000)
End While End While
End If End If
End If End If

View File

@@ -4281,10 +4281,12 @@ Partial Class Compras_Compras
Next Next
If ErrorValidacion Then Exit Sub If ErrorValidacion Then Exit Sub
Dim dtPSInvalidos As String = ValidarPSContrato(TmpDT.FiltraParametros("", "", {"CveSubProyecto", "CvePS", "Cantidad", "PU"})) If UsuarioActual.Empresa.Funcionalidad(545) = "1" Then
If dtPSInvalidos <> "" Then Dim dtPSInvalidos As String = ValidarPSContrato(TmpDT.FiltraParametros("", "", {"CveSubProyecto", "CvePS", "Cantidad", "PU"}))
Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia) If dtPSInvalidos <> "" Then
Exit Sub Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If End If
'RECORRO LOS PRODUCTOS O SERVICIOS PARA REGISTRARLOS LOS QUE NO EXISTEN EN EL CATÁLOGO 'RECORRO LOS PRODUCTOS O SERVICIOS PARA REGISTRARLOS LOS QUE NO EXISTEN EN EL CATÁLOGO
@@ -18106,25 +18108,31 @@ Partial Class Compras_Compras
End If End If
ActualizaTotales = True ActualizaTotales = True
Dim ObjContratos As New ClsContratos
Dim TieneError As Boolean = False
Dim dttemp As New DataTable ' GlobalDTContratos().FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString))
dttemp.Columns.Add("CveSubProyecto", GetType(Integer))
dttemp.Columns.Add("CvePS", GetType(Integer))
dttemp.Columns.Add("Cantidad", GetType(Decimal))
dttemp.Columns.Add("PU", GetType(Decimal))
Dim DrPS = dttemp.NewRow If UsuarioActual.Empresa.Funcionalidad(545) = "1" Then
DrPS("CveSubProyecto") = DdlSubProyecto.SelectedValue.ToString.ToEntero Dim TieneError As Boolean = False
DrPS("CvePS") = DdlPS.SelectedValue.ToString.ToEntero Dim dttemp As New DataTable '= GlobalDTContratos().FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString))
DrPS("Cantidad") = TxtCantidad.Text.Trim.ToDecimal dttemp.Columns.Add("CveSubProyecto", GetType(Integer))
DrPS("PU") = TxtPrecio.Text.Trim.ToDecimal dttemp.Columns.Add("CvePS", GetType(Integer))
dttemp.Rows.Add(DrPS) dttemp.Columns.Add("Cantidad", GetType(Decimal))
dttemp.Columns.Add("PU", GetType(Decimal))
Dim dtPSInvalidos As String = ValidarPSContrato(dttemp) Dim DrPS = dttemp.NewRow
If dtPSInvalidos <> "" Then DrPS("CveSubProyecto") = DdlSubProyecto.SelectedValue.ToString.ToEntero
TieneError = True DrPS("CvePS") = DdlPS.SelectedValue.ToString.ToEntero
DrPS("Cantidad") = TxtCantidad.Text.Trim.ToDecimal
DrPS("PU") = TxtPrecio.Text.Trim.ToDecimal
dttemp.Rows.Add(DrPS)
Dim dtPSInvalidos As String = ValidarPSContrato(dttemp)
If dtPSInvalidos <> "" Then
TieneError = True
Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If End If
'If dttemp IsNot Nothing AndAlso dttemp.Rows.Count > 0 Then 'If dttemp IsNot Nothing AndAlso dttemp.Rows.Count > 0 Then
' Dim drContrato As DataRow = dttemp.Rows(0) ' Dim drContrato As DataRow = dttemp.Rows(0)
' If ObjContratos.GetContratosDetalle(drContrato("CveContrato").ToString.ToEntero) Then ' If ObjContratos.GetContratosDetalle(drContrato("CveContrato").ToString.ToEntero) Then
@@ -18157,75 +18165,52 @@ Partial Class Compras_Compras
' End If ' End If
'End If 'End If
ObjContratos.Dispose()
If Not TieneError Then
Select Case Modalidad
Case "A" 'ADD
Dim SATClavePS = -1
Dim PSRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("")
If PSRow IsNot Nothing Then Select Case Modalidad
SATClavePS = PSRow("SATClavePS").ToString.ToEntero Case "A" 'ADD
End If
Dim IVA As Double Dim SATClavePS = -1
If chkImportacion.Checked Then Dim PSRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("")
IVA = (txtImportacion.Text.Trim.ToDouble / (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.Trim.ToDouble)) If PSRow IsNot Nothing Then
Else SATClavePS = PSRow("SATClavePS").ToString.ToEntero
IVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2) End If
End If Dim IVA As Double
AddPS(TxtCantidad.Text.Trim.ToDouble, ddlUM.SelectedValue.ToEntero, ddlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, HdnTipoPS.Value.ToEntero, If chkImportacion.Checked Then
IVA = (txtImportacion.Text.Trim.ToDouble / (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.Trim.ToDouble))
Else
IVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2)
End If
AddPS(TxtCantidad.Text.Trim.ToDouble, ddlUM.SelectedValue.ToEntero, ddlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, HdnTipoPS.Value.ToEntero,
DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDouble, Total, IVA, DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDouble, Total, IVA,
TxtRetIVAModal.Text.ToDouble / 100, TxtRetISRModal.Text.ToDouble / 100, TxtIEPSModal.Text.ToDouble / 100, 0, TxtDescuentoModal.Text.ToDouble, OtrosGastos:=TxtOtrosGastos.Text.ToDouble, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text, TxtRetIVAModal.Text.ToDouble / 100, TxtRetISRModal.Text.ToDouble / 100, TxtIEPSModal.Text.ToDouble / 100, 0, TxtDescuentoModal.Text.ToDouble, OtrosGastos:=TxtOtrosGastos.Text.ToDouble, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text,
NoDeducible:=ChkEsNoDeduciblePS.Checked, CveSATPS:=SATClavePS) NoDeducible:=ChkEsNoDeduciblePS.Checked, CveSATPS:=SATClavePS)
AddPS2() AddPS2()
LimpiaAgregar() LimpiaAgregar()
If ChkAgregar.Checked = True And Modalidad = "A" Then If ChkAgregar.Checked = True And Modalidad = "A" Then
RegistraScript("displayToastr(1);", "display") RegistraScript("displayToastr(1);", "display")
Else
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddProducto"))
End If
Case "U" 'UPDATE
UpdatePS()
Alert("Concepto actualizado Correctamente.", TipoMensaje.MsgInformacion)
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddProducto"))
End Select
ActualizaTotales = False
If UsuarioActual.Empresa.Funcionalidad(562).ToEntero > 0 Then CargaGastosServicios(UsuarioActual.Empresa.Funcionalidad(562).ToEntero)
If UsuarioActual.Empresa.UsaAC Then
CompruebaAgregar()
GuardaAC()
End If
Else Else
Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia) RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddProducto"))
End If End If
Case "U" 'UPDATE
UpdatePS()
Alert("Concepto actualizado Correctamente.", TipoMensaje.MsgInformacion)
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddProducto"))
End Select
ActualizaTotales = False
'If UsuarioActual.Empresa.Funcionalidad(577).ToString = "1" Then If UsuarioActual.Empresa.Funcionalidad(562).ToEntero > 0 Then CargaGastosServicios(UsuarioActual.Empresa.Funcionalidad(562).ToEntero)
' 'If UsuarioActual.CveRol = 1 Then If UsuarioActual.Empresa.UsaAC Then
' ' Alert($"Ok funcionalidad 577 RetencionIVA { RetencionIVA} IVAOriginal {IVAOriginal}") CompruebaAgregar()
' 'End If GuardaAC()
End If
' If RetencionIVA = 0 And IVAOriginal > 0 Then UpPS.Update()
' For Each dRow As DataRow In TmpDT.Rows
' If dRow("CveTipoPS").ToString.ToEntero = 1 Then
' 'Comnetado para reubicar el boton
' 'tdIVA6.Visible = True
' Exit For
' End If
' Next
' End If
'End If
UpPS.Update()
CargaGvPersonal() CargaGvPersonal()
End Sub End Sub
''' <summary> ''' <summary>
@@ -20938,6 +20923,7 @@ Partial Class Compras_Compras
Next Next
End If End If
End If End If
objContratos.Dispose()
If MensajeProducto.Length <> 64 Then If MensajeProducto.Length <> 64 Then
Retorno = MensajeProducto Retorno = MensajeProducto

View File

@@ -14,7 +14,10 @@
<asp:UpdatePanel runat="server" ID="UpAgregar"> <asp:UpdatePanel runat="server" ID="UpAgregar">
<ContentTemplate> <ContentTemplate>
<li> <li>
<asp:LinkButton runat="server" ID="BtnAgregarMotivoD" data-toggle="tooltip" data-placement="left" title="Agregar un Defecto" Text="<i class='fa fa-plus'></i>Agregar Cuenta Asignación"></asp:LinkButton> <asp:LinkButton runat="server" ID="BtnAgregarAsignacion" data-toggle="tooltip" data-placement="left" title="Agregar Cuenta" Text="<i class='fa fa-plus'></i>Agregar Cuenta Asignación"></asp:LinkButton>
</li>
<li>
<asp:LinkButton runat="server" ID="BtnAgregarGlobal" data-toggle="tooltip" data-placement="left" title="Agregar Global" Text="<i class='fa fa-plus'></i>Agregar Global"></asp:LinkButton>
</li> </li>
</ContentTemplate> </ContentTemplate>
@@ -86,6 +89,27 @@
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<br />
<asp:GridView runat="server" ID="GvGlobal" EmptyDataText="" ToolTip="" CssClass="table table-striped table-advance table-hover ScrollAD"
DataKeyNames="CveEmpresa,CveCuenta,CveConceptoContable" AutoGenerateColumns="False"
Style=" width:100%" GridLines="None">
<Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-Width="150px" HeaderText="Concepto Contable" ItemStyle-HorizontalAlign="Left"/>
<asp:BoundField DataField="CuentaCodigo" ItemStyle-Width="100px" HeaderText="Código Cuenta" ItemStyle-HorizontalAlign="Left"/>
<asp:BoundField DataField="CuentaNombre" HeaderText="Nombre Cuenta" ItemStyle-HorizontalAlign="Left"/>
<asp:TemplateField ItemStyle-Width="49px">
<ItemTemplate>
<asp:LinkButton ID="ImgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="ActualizaModulo" CssClass="btn btn-circle btn-xs green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="49px">
<ItemTemplate>
<asp:LinkButton ID="ImgEliminar" runat="server" AlternateText="Eliminar" CausesValidation="False" OnClick="EliminarRowGlobal" CommandName="Delete" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpModal"> <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpModal">
@@ -171,6 +195,53 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UppModalGlobal">
<ContentTemplate>
<div id="ModalGlobal" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UppGlobal2" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="Literal1" runat="server">Cuentas Globales</asp:Literal>
</h4>
</div>
<div class="modal-body" style="text-align:center">
<div class="row">
<div class="col-md-1" style="width:50%;text-align:left">
<div class="form-group form-md-line-input input-iconright">
<asp:HiddenField ID="HiddenField1" runat="server" />
<asp:DropDownList ID="DdlConceptoGlobal" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="ConceptoContable" DataValueField="CveConceptoContable" Width="240px" ValidationGroup="GrpModulo2" ></asp:DropDownList>
<label for="<%= DdlConceptoGlobal.ClientID.ToString()%>">Concepto Contable: </label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlCuentaGlobal" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="CveCuenta" Width="240px" ValidationGroup="GrpModulo2"></asp:DropDownList>
<label for="<%= DdlCuentaGlobal.ClientID.ToString()%>">Cuenta Contable: </label>
</div>
<div class="form-group form-md-line-input input-iconright" id="div3" runat="server" >
<asp:DropDownList ID="DdlTipoGlobal" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" Width="240px" ValidationGroup="GrpModulo2" >
<asp:ListItem Text="Mayor" Value="1"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlTipoGlobal.ClientID.ToString()%>">Tipo Global: </label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:LinkButton ID="LBAgregaGlobal" runat="server" class="btn btn-success" Text="Agregar" OnClick="LBAgregaGlobal_Click" ValidationGroup="GrpModulo2" />
<button id="Button1" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
<asp:CheckBox ID="CheckBox1" Checked="true" Text="Seguir Registrando" runat="server" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content> </asp:Content>

View File

@@ -40,8 +40,14 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
If ObjConta.GetCuentasAsignacionesSistema(UsuarioActual.CveEmpresa, DdlTipo.SelectedValue.ToEntero, DdlOpcion.SelectedValue.ToEntero) Then If ObjConta.GetCuentasAsignacionesSistema(UsuarioActual.CveEmpresa, DdlTipo.SelectedValue.ToEntero, DdlOpcion.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjConta.DtResultados GvDatos.DataSource = ObjConta.DtResultados
End If End If
If ObjConta.GetCuentasGlobales(UsuarioActual.CveEmpresa) Then
GvGlobal.DataSource = ObjConta.DtResultados
End If
ObjConta.Dispose() ObjConta.Dispose()
GvDatos.DataBind() GvDatos.DataBind()
GvGlobal.DataBind()
UpDatos.Update() UpDatos.Update()
End Sub End Sub
@@ -53,10 +59,12 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
If ObjConta.GetConta_ConceptosContables() Then If ObjConta.GetConta_ConceptosContables() Then
DdlCconceptosContables.DataSource = ObjConta.DtResultados DdlCconceptosContables.DataSource = ObjConta.DtResultados
DdlConceptoGlobal.DataSource = ObjConta.DtResultados.FiltraParametros("EsCuentaUnica = false AND EsSistema = True AND EsGlobal = True")
End If End If
If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
DdlCuenta.DataSource = ObjConta.DtResultados DdlCuenta.DataSource = ObjConta.DtResultados
DdlCuentaGlobal.DataSource = ObjConta.DtResultados
End If End If
ObjConta.Dispose() ObjConta.Dispose()
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
@@ -79,7 +87,9 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
DdlCuentaBancaria.DataBind() DdlCuentaBancaria.DataBind()
DdlCconceptosContables.DataBind() DdlCconceptosContables.DataBind()
DdlConceptoGlobal.DataBind()
DdlCuenta.DataBind() DdlCuenta.DataBind()
DdlCuentaGlobal.DataBind()
DdlProveedor.DataBind() DdlProveedor.DataBind()
'DdlPersonal.DataBind() 'DdlPersonal.DataBind()
DdlClasificacion.DataBind() DdlClasificacion.DataBind()
@@ -145,6 +155,11 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
End If End If
End If End If
If Dr("AplicaImpuesto").ToString = "True" Then
divPorcentajeIVA.Visible = True
End If
If Dr("AplicaClasificacion").ToString = "True" Then If Dr("AplicaClasificacion").ToString = "True" Then
divClasificacion.Visible = True divClasificacion.Visible = True
End If End If
@@ -184,7 +199,24 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
ObjConta.Dispose() ObjConta.Dispose()
End Sub End Sub
Protected Sub BtnAgregarMotivoD_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click Protected Sub BtnAgregarGlobal_Click(sender As Object, e As EventArgs) Handles BtnAgregarGlobal.Click
UppModalGlobal.Update()
RegistraScript("$('#ModalGlobal').modal();")
End Sub
Protected Sub EliminarRowGlobal(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim ObjConta As New ClsContabilidad
If ObjConta.RemoveCuentasGlobales(GvRow.DataKey("CveConceptoContable").ToEntero, GvRow.DataKey("CveEmpresa").ToEntero) Then
Alert("se elimino correctamente")
End If
CargaDatosSistema()
UpDatos.Update()
ObjConta.Dispose()
End Sub
Protected Sub BtnAgregarAsignacion_Click(sender As Object, e As EventArgs) Handles BtnAgregarAsignacion.Click
LimpiarDatos() LimpiarDatos()
LbAgregar.Text = "Agregar" LbAgregar.Text = "Agregar"
@@ -238,4 +270,22 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
CargaDatosSistema() CargaDatosSistema()
UpDatos.Update() UpDatos.Update()
End Sub End Sub
Protected Sub LBAgregaGlobal_Click(sender As Object, e As EventArgs)
Dim ErrorString As String = ""
Dim ObjConta As New ClsContabilidad
If Not ObjConta.AddCuentasGlobales(DdlConceptoGlobal.SelectedValue.ToEntero, DdlCuentaGlobal.SelectedValue.ToEntero, DdlTipoGlobal.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
ErrorString = "Error al agregar"
End If
ObjConta.Dispose()
If ErrorString.Length > 0 Then
Alert(ErrorString)
Else
Alert("Agregado correctamente")
End If
CargaDatosSistema()
UpDatos.Update()
End Sub
End Class End Class

View File

@@ -1182,7 +1182,7 @@ Partial Class Contratos_Default
If TipoContrato = 4 Then If TipoContrato = 4 Then
TabPI.Visible = True TabPI.Visible = True
End If End If
If ObjContratos.GetContratosDetalle(CveContrato) Then If ObjContratos.GetContratosDetalle(CveContrato, UsuarioActual.CveEmpresa) Then
TmpDT = ObjContratos.DtResultados TmpDT = ObjContratos.DtResultados
If TmpDT.MAX("Cantidad_Original").ToString.ToEntero > 0 OrElse TmpDT.MAX("PU_Original").ToString.ToEntero > 0 Then If TmpDT.MAX("Cantidad_Original").ToString.ToEntero > 0 OrElse TmpDT.MAX("PU_Original").ToString.ToEntero > 0 Then
BtnAutorizar.Visible = False BtnAutorizar.Visible = False

View File

@@ -529,7 +529,7 @@ Partial Class Contratos_Default
If TipoContrato = 4 Then If TipoContrato = 4 Then
TabPI.Visible = True TabPI.Visible = True
End If End If
If ObjContratos.GetContratosDetalle(CveContrato) Then If ObjContratos.GetContratosDetalle(CveContrato, UsuarioActual.CveEmpresa) Then
TmpDT = ObjContratos.DtResultados TmpDT = ObjContratos.DtResultados
If TmpDT.MAX("Cantidad_Original").ToString.ToEntero > 0 OrElse TmpDT.MAX("PU_Original").ToString.ToEntero > 0 Then If TmpDT.MAX("Cantidad_Original").ToString.ToEntero > 0 OrElse TmpDT.MAX("PU_Original").ToString.ToEntero > 0 Then
BtnAutorizar.Visible = False BtnAutorizar.Visible = False

View File

@@ -902,7 +902,7 @@ Partial Class Contratos_ContratoObra
If TipoContrato = 4 Then If TipoContrato = 4 Then
TabPI.Visible = True TabPI.Visible = True
End If End If
If ObjContratos.GetContratosDetalle(CveContrato) Then If ObjContratos.GetContratosDetalle(CveContrato, UsuarioActual.CveEmpresa) Then
TmpDT = ObjContratos.DtResultados TmpDT = ObjContratos.DtResultados
If TmpDT.MAX("Cantidad_Original").ToString.ToEntero > 0 OrElse TmpDT.MAX("PU_Original").ToString.ToEntero > 0 Then If TmpDT.MAX("Cantidad_Original").ToString.ToEntero > 0 OrElse TmpDT.MAX("PU_Original").ToString.ToEntero > 0 Then
BtnAutorizar.Visible = False BtnAutorizar.Visible = False

View File

@@ -467,7 +467,7 @@ Partial Class Contratos_FacturacionMasiva
SubProyecto = DR("SubProyectoContrato").ToString SubProyecto = DR("SubProyectoContrato").ToString
Dim objContratos As New ClsContratos Dim objContratos As New ClsContratos
If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero) Then If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
DTDetalle = objContratos.DtResultados.FiltraParametros("CveTipoPresupuesto=2") DTDetalle = objContratos.DtResultados.FiltraParametros("CveTipoPresupuesto=2")
Else Else
DTDetalle = Nothing DTDetalle = Nothing

View File

@@ -548,7 +548,7 @@ Partial Class Contratos_FacturacionMasiva
End If End If
ObjFolios.Dispose() ObjFolios.Dispose()
If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero) Then If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
DTDetalle = objContratos.DtResultados DTDetalle = objContratos.DtResultados
Else Else
DTDetalle = Nothing DTDetalle = Nothing

View File

@@ -1,126 +1,139 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepIgnicion.aspx.cs" Inherits="GPS_RepIgnicion" %> <%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepIgnicion.aspx.cs" Inherits="GPS_RepIgnicion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Ignición Reporte de Ignición
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li> <li>
<asp:UpdatePanel runat="server"> <asp:UpdatePanel runat="server">
<ContentTemplate> <ContentTemplate>
<asp:LinkButton ID="LnkImprimirPDF" Visible="false" OnClick="LnkImprimirPDF_Click" runat="server"><i class="fa fa-file-pdf-o"></i> Imprimir PDF</asp:LinkButton> <asp:LinkButton ID="LnkImprimirPDF" Visible="false" OnClick="LnkImprimirPDF_Click" runat="server"><i class="fa fa-file-pdf-o"></i> Imprimir PDF</asp:LinkButton>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="LnkImprimirPDF" /> <asp:PostBackTrigger ControlID="LnkImprimirPDF" />
</Triggers> </Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>
</li> </li>
</asp:Content> <li>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server"> <asp:UpdatePanel runat="server">
</asp:Content> <ContentTemplate>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server"> <asp:LinkButton ID="LnkImprimirEXCEL" Visible="false" OnClick="LnkImprimirEXCEL_Click" runat="server"><i class="fa fa-file-excel-o"></i> Imprimir EXCEL</asp:LinkButton>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional"> </ContentTemplate>
<ContentTemplate> <Triggers>
<div class="portlet solid grey-cascade portlet-filter" style=""> <asp:PostBackTrigger ControlID="LnkImprimirEXCEL" />
<div class="portlet-title portlet-filterT smalltitle " style=""> </Triggers>
<div class="tools"> </asp:UpdatePanel>
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" /> </li>
</div> </asp:Content>
<div class="titlefiltros caption" style="margin-top: -8px;"> <asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
<ul class="list-inline" style="font-size: 12px;"> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT smalltitle " style="">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" />
</div>
<div class="titlefiltros caption" style="margin-top: -8px;">
<ul class="list-inline" style="font-size: 12px;">
<li>Vehículo: <li>Vehículo:
<asp:DropDownList AppendDataBoundItems="true" ID="DdlDispositivo" runat="server" Width="200px" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
<asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem> <asp:DropDownList AppendDataBoundItems="true" ID="DdlDispositivo" runat="server" Width="200px" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
</asp:DropDownList> <asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem>
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlDispositivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator> </asp:DropDownList>
<ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender> <asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlDispositivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</li> <ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender>
</li>
<li>Fecha Inicio: <li>Fecha Inicio:
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox> <div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator> <asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender> <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</div> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
</li> </div>
</li>
<li>Fecha Fin: <li>Fecha Fin:
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox> <div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator> <asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender> <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</div> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
</li> </div>
</ul> </li>
</div> </ul>
</div> </div>
</div> </div>
</ContentTemplate> </div>
</asp:UpdatePanel> </ContentTemplate>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional"> </asp:UpdatePanel>
<ContentTemplate> <asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<div class="portlet light smmallpadding traspasorow bordered"> <ContentTemplate>
<div class="portlet-title"> <div class="portlet light smmallpadding traspasorow bordered">
<div class="caption font-green"> <div class="portlet-title">
<i class="icon-pin font-green"></i> <div class="caption font-green">
<span class="caption-subject bold uppercase">Igniciones</span> <i class="icon-pin font-green"></i>
</div> <span class="caption-subject bold uppercase">Igniciones</span>
<div class="actions"> </div>
<div class="btn-group"> <div class="actions">
</div> <div class="btn-group">
</div> </div>
<div class="tools"> </div>
<a href="javascript:;" class="collapse"></a> <div class="tools">
</div> <a href="javascript:;" class="collapse"></a>
</div> </div>
<div class="portlet-body rowpadding"> </div>
<asp:GridView ID="GvIgnicion" runat="server" GridLines="None" OnRowDataBound="GvIgnicion_RowDataBound" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows ="1" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Numero de Vueltas Realizadas"> <div class="portlet-body rowpadding">
<Columns> <asp:GridView ID="GvIgnicion" runat="server" GridLines="None" OnRowDataBound="GvIgnicion_RowDataBound" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows="1" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Numero de Vueltas Realizadas">
<asp:BoundField DataField="Vehiculo" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" /> <Columns>
<asp:BoundField DataField="FechaEncendido" ItemStyle-Width="12.5%" HeaderText="Fecha Encendido" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="Vehiculo" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaApagado" ItemStyle-Width="12.5%" HeaderText="Fecha Apagado" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="FechaEncendido" ItemStyle-Width="12.5%" HeaderText="Fecha Encendido" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="VMedia" DataFormatString="{0:N2} Km/hr." ItemStyle-Width="12.5%" HeaderText="Velocidad Media" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="FechaApagado" ItemStyle-Width="12.5%" HeaderText="Fecha Apagado" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="VMax" DataFormatString="{0:N2} Km/hr." ItemStyle-Width="12.5%" HeaderText="Velocidad Máxima" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="VMedia" DataFormatString="{0:N2} Km/hr." ItemStyle-Width="12.5%" HeaderText="Velocidad Media" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Kilometraje" DataFormatString="{0:N2} Km." ItemStyle-Width="12.5%" HeaderText="Kilometraje" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="VMax" DataFormatString="{0:N2} Km/hr." ItemStyle-Width="12.5%" HeaderText="Velocidad Máxima" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Duracion" ItemStyle-Width="12.5%" HeaderText="Duración" ItemStyle-HorizontalAlign="Center" /> <asp:BoundField DataField="Kilometraje" DataFormatString="{0:N2} Km." ItemStyle-Width="12.5%" HeaderText="Kilometraje" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Dirección Inicial" ItemStyle-HorizontalAlign="Center"> <asp:BoundField DataField="Duracion" ItemStyle-Width="12.5%" HeaderText="Duración" ItemStyle-HorizontalAlign="Center" />
<ItemTemplate> <asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Dirección Inicial" ItemStyle-HorizontalAlign="Center">
<asp:Literal ID="LtlDireccionInicial" runat="server"></asp:Literal> <ItemTemplate>
</ItemTemplate> <asp:Literal ID="LtlDireccionInicial" runat="server"></asp:Literal>
</asp:TemplateField> </ItemTemplate>
<asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Dirección Final" ItemStyle-HorizontalAlign="Center"> </asp:TemplateField>
<ItemTemplate> <asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Dirección Final" ItemStyle-HorizontalAlign="Center">
<asp:Literal ID="LtlDireccionFinal" runat="server"></asp:Literal> <ItemTemplate>
</ItemTemplate> <asp:Literal ID="LtlDireccionFinal" runat="server"></asp:Literal>
</asp:TemplateField> </ItemTemplate>
</Columns> </asp:TemplateField>
</asp:GridView> </Columns>
</div> </asp:GridView>
</div> </div>
</ContentTemplate> </div>
</asp:UpdatePanel> </ContentTemplate>
<div id="DivModalGrafica" class="modal ADS fade" role="dialog"> </asp:UpdatePanel>
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpGraficaEventos" UpdateMode="Conditional"> <div id="DivModalGrafica" class="modal ADS fade" role="dialog">
<ContentTemplate> <asp:UpdatePanel class="modal-dialog" runat="server" ID="UpGraficaEventos" UpdateMode="Conditional">
<div class="modal-content"> <ContentTemplate>
<div class="modal-body"> <div class="modal-content">
<asp:HiddenField ID="HdnImagen" ClientIDMode="Static" Value="[]" runat="server" /> <div class="modal-body">
<asp:HiddenField ID="HdnGrafica" ClientIDMode="Static" Value="[]" runat="server" /> <asp:HiddenField ID="HdnImagen" ClientIDMode="Static" Value="[]" runat="server" />
<div id="DvGrafica" style="min-width: 900px; height: 500px; margin: 0 auto"></div> <asp:HiddenField ID="HdnGrafica" ClientIDMode="Static" Value="[]" runat="server" />
</div> <div id="DvGrafica" style="min-width: 900px; height: 500px; margin: 0 auto"></div>
<div class="modal-footer"> </div>
<div class="modal-btn"> <div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button> <div class="modal-btn">
</div> <button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
</div> </div>
</div> </div>
</ContentTemplate> </div>
</asp:UpdatePanel> </ContentTemplate>
</div> </asp:UpdatePanel>
</asp:Content> </div>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server"> </asp:Content>
</asp:Content> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -58,7 +58,8 @@ public partial class GPS_RepIgnicion : ClsPaginas
DtIgniciones = ObjGPS.DtResultados; DtIgniciones = ObjGPS.DtResultados;
GvIgnicion.DataSource = DtIgniciones; GvIgnicion.DataSource = DtIgniciones;
GvIgnicion.DataBind(); GvIgnicion.DataBind();
LnkImprimirPDF.Visible = true; LnkImprimirPDF.Visible = true;
LnkImprimirEXCEL.Visible = true;
} }
} }
UpDatos.Update(); UpDatos.Update();
@@ -104,14 +105,18 @@ public partial class GPS_RepIgnicion : ClsPaginas
protected void LnkImprimirPDF_Click(object sender, EventArgs e) protected void LnkImprimirPDF_Click(object sender, EventArgs e)
{ {
EnviarReporteProgramado(); EnviarReporteProgramado("PDF");
}
protected void LnkImprimirEXCEL_Click(object sender, EventArgs e)
{
EnviarReporteProgramado("EXCEL");
} }
public void EnviarReporteProgramado() public void EnviarReporteProgramado(string Formato = "PDF")
{ {
if (DtIgniciones != null) if (DtIgniciones != null)
{ {
byte[] retorno; byte[] retorno;
string RutaReporte = "Empresas/Grales/ReportesProgramados/RPIgnicion.rdlc"; string RutaReporte = ModExtensiones.DirectorioBaseEmpresas + "Empresas/Grales/ReportesProgramados/RPIgnicion.rdlc";
try try
{ {
@@ -121,10 +126,10 @@ public partial class GPS_RepIgnicion : ClsPaginas
RptParametro.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Usuario)); RptParametro.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Usuario));
RptParametro.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy HH:mm tt"))); RptParametro.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy HH:mm tt")));
retorno = StreamPDF(RutaReporte, DtIgniciones, RptParametro, "ReporteEventos", "PDF", "DsOC"); retorno = StreamPDF(RutaReporte, DtIgniciones, RptParametro, "ReporteEventos", Formato, "DsOC");
// TODO: Labeled Arguments not supported. Argument: 6 := 'MR' // TODO: Labeled Arguments not supported. Argument: 6 := 'MR'
// TODO: Labeled Arguments not supported. Argument: 7 := 'RDSName' // TODO: Labeled Arguments not supported. Argument: 7 := 'RDSName'
ImprimirbytesPDF(retorno, "ReporteEventos"); ImprimirbytesPDF(retorno, "ReporteEventos", Formato: Formato);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -89,8 +89,11 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="Estatus" HeaderText="Estatus" /> <asp:BoundField DataField="Estatus" HeaderText="Estatus" />
<asp:HyperLinkField DataNavigateUrlFields="CveInventarioFisico" DataNavigateUrlFormatString="~/Inventarios/RepAnomalias.aspx?CveInventarioFisico={0}" <asp:TemplateField HeaderText="">
Target="_blank" Text="Dif."></asp:HyperLinkField> <ItemTemplate>
<asp:HyperLink ID="HplDif" runat="server" NavigateUrl='<%# Eval("CveInventarioFisico", "~/Inventarios/RepAnomalias.aspx?CveInventarioFisico={0}") %>' Text="Dif."></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos"> <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" /> <asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" />

View File

@@ -759,6 +759,10 @@ Partial Class Inventarios_InventarioFisico
If e.Row.DBCampo("CveEstatus") = "3" Then If e.Row.DBCampo("CveEstatus") = "3" Then
e.Row.FCLinkButton("imgE").Visible = False e.Row.FCLinkButton("imgE").Visible = False
e.Row.FCLinkButton("imgD").Visible = False e.Row.FCLinkButton("imgD").Visible = False
ElseIf e.Row.DBCampo("CveEstatus") = "1" Then ' cuando es en proceso
e.Row.FCHyperLink("HplDif").NavigateUrl = String.Format("/Inventarios/RepAnomalias.aspx?CveInventarioFisico={0}&EsAvance=1", e.Row.DBCampo("CveInventarioFisico"))
ElseIf e.Row.DBCampo("CveEstatus") = "0" Then ' Nuevo
e.Row.FCHyperLink("HplDif").Visible = False
End If End If
End If End If

View File

@@ -207,22 +207,23 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<br /> <br />
<div class="row">
<div class="col-md-12">
<label style="font-size: 16px"><b>Productos que Faltan</b></label>
<div class="row">
<div class="col-md-4" align="left" id="divRegistradosFaltan" runat="server">
<asp:Label runat="server">Número de registros: <b><asp:Literal ID="LtlTotalRegistrosFaltan" runat="server"></asp:Literal></b></asp:Label>
</div>
<div class="col-md-8" align="right" id="DivBuscadorFaltan" runat="server">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvF.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvF.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
</div>
<asp:UpdatePanel ID="UPAnomalias" UpdateMode="Conditional" runat="server"> <asp:UpdatePanel ID="UPAnomalias" UpdateMode="Conditional" runat="server">
<ContentTemplate> <ContentTemplate>
<div class="row">
<div class="col-md-12">
<label style="font-size: 16px"><b>Productos que Faltan</b></label>
<div class="row">
<div class="col-md-4" align="left" id="divRegistradosFaltan" runat="server">
<asp:Label runat="server">Número de registros: <b><asp:Literal ID="LtlTotalRegistrosFaltan" runat="server"></asp:Literal></b></asp:Label>
</div>
<div class="col-md-8" align="right" id="DivBuscadorFaltan" runat="server">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvF.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvF.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
</div>
<asp:GridView ID="GvF" data-sort="true" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" <asp:GridView ID="GvF" data-sort="true" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False"
CssClass="table table-striped table-hover Widthall ScrollAD" Style="text-align: center;" CssClass="table table-striped table-hover Widthall ScrollAD" Style="text-align: center;"
GridLines="None" DataKeyNames="CvePS"> GridLines="None" DataKeyNames="CvePS">
@@ -256,22 +257,23 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<br /> <br />
<div class="row">
<div class="col-md-12">
<label style="font-size: 16px"><b>Productos que Sobran</b></label>
<div class="row">
<div class="col-md-4" align="left" id="divRegistradosSobran" runat="server">
<asp:Label runat="server">Número de registros: <b><asp:Literal ID="LtlTotalRegistrosSobran" runat="server"></asp:Literal></b></asp:Label>
</div>
<div class="col-md-8" align="right" id="DivBuscadorSobran" runat="server">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvS.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvS.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
</div>
<asp:UpdatePanel ID="UpdateGvS" UpdateMode="Conditional" runat="server"> <asp:UpdatePanel ID="UpdateGvS" UpdateMode="Conditional" runat="server">
<ContentTemplate> <ContentTemplate>
<div class="row">
<div class="col-md-12">
<label style="font-size: 16px"><b>Productos que Sobran</b></label>
<div class="row">
<div class="col-md-4" align="left" id="divRegistradosSobran" runat="server">
<asp:Label runat="server">Número de registros: <b><asp:Literal ID="LtlTotalRegistrosSobran" runat="server"></asp:Literal></b></asp:Label>
</div>
<div class="col-md-8" align="right" id="DivBuscadorSobran" runat="server">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvS.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvS.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
</div>
<asp:GridView ID="GvS" data-sort="true" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" <asp:GridView ID="GvS" data-sort="true" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False"
CssClass="table table-striped table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None" DataKeyNames="CvePS"> CssClass="table table-striped table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None" DataKeyNames="CvePS">
<Columns> <Columns>

View File

@@ -547,7 +547,7 @@ Partial Class Inventarios_TrasladoSolicitud
End Sub End Sub
Private Sub DdlContratos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlContratos.SelectedIndexChanged Private Sub DdlContratos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlContratos.SelectedIndexChanged
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratosDetalle(DdlContratos.SelectedValue.ToEntero) Then If ObjContratos.GetContratosDetalle(DdlContratos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvContratos.DataSource = ObjContratos.DtResultados GvContratos.DataSource = ObjContratos.DtResultados
GvContratos.DataBind() GvContratos.DataBind()
If ObjContratos.DtResultados.Rows.Count > 0 Then If ObjContratos.DtResultados.Rows.Count > 0 Then
@@ -974,7 +974,7 @@ Partial Class Inventarios_TrasladoSolicitud
Dim DTContratosTemporal As New DataTable Dim DTContratosTemporal As New DataTable
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratosDetalle(DdlContratos.SelectedValue.ToEntero) Then If ObjContratos.GetContratosDetalle(DdlContratos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
DTContratosTemporal = ObjContratos.DtResultados DTContratosTemporal = ObjContratos.DtResultados
End If End If
ObjContratos.Dispose() ObjContratos.Dispose()

View File

@@ -7435,7 +7435,7 @@ Partial Class OC
Private Sub CargaContratos() Private Sub CargaContratos()
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratosDetalle(DdlContratos.SelectedValue.ToEntero) Then If ObjContratos.GetContratosDetalle(DdlContratos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvContratos.DataSource = ObjContratos.DtResultados GvContratos.DataSource = ObjContratos.DtResultados
End If End If
ObjContratos.Dispose() ObjContratos.Dispose()
@@ -7465,7 +7465,7 @@ Partial Class OC
Private Sub DdlContratos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlContratos.SelectedIndexChanged Private Sub DdlContratos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlContratos.SelectedIndexChanged
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratosDetalle(DdlContratos.SelectedValue.ToEntero) Then If ObjContratos.GetContratosDetalle(DdlContratos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvContratos.DataSource = ObjContratos.DtResultados GvContratos.DataSource = ObjContratos.DtResultados
GvContratos.DataBind() GvContratos.DataBind()
End If End If

View File

@@ -1571,6 +1571,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<asp:HiddenField ID="HdnDescuento" runat="server" ClientIDMode="Static" Value="0" /> <asp:HiddenField ID="HdnDescuento" runat="server" ClientIDMode="Static" Value="0" />
<asp:HiddenField ID="HdnPorcentajeDescuentoMaximo" runat="server" ClientIDMode="Static" Value="0" />
<asp:HiddenField ID="HdnDescuentoGeneral" runat="server" ClientIDMode="Static" Value="-1" /> <asp:HiddenField ID="HdnDescuentoGeneral" runat="server" ClientIDMode="Static" Value="-1" />
<asp:HiddenField ID="HdnTipoDescuento" runat="server" ClientIDMode="Static" Value="-1" /> <asp:HiddenField ID="HdnTipoDescuento" runat="server" ClientIDMode="Static" Value="-1" />
<table> <table>
@@ -3344,6 +3345,15 @@
} }
var Descuento = parseFloat($get("TxtPorDescP").value); var Descuento = parseFloat($get("TxtPorDescP").value);
var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value);
if (PorcentajeDescuentoMaximo > 0 && Descuento > PorcentajeDescuentoMaximo) {
$get("TxtDescP").value = "0";
$get("TxtPorDescP").value = "0";
Descuento = 0;
alert("No puede exceder el descuento maximo autorizado.");
}
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ','); $get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""));
@@ -3354,6 +3364,7 @@
if (TipoDescuento == 2) { if (TipoDescuento == 2) {
$get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ','); $get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ',');
} }
} }
else { else {
$get("LblPrecioFinal").innerText = "0.00"; $get("LblPrecioFinal").innerText = "0.00";
@@ -3383,6 +3394,17 @@
} }
var Descuento = parseFloat($get("TxtDescP").value); var Descuento = parseFloat($get("TxtDescP").value);
var PorcentajeDescuento = (Descuento * 100 / Monto)
var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value);
if (PorcentajeDescuentoMaximo > 0 && PorcentajeDescuento > PorcentajeDescuentoMaximo) {
$get("TxtDescP").value = "0";
$get("TxtPorDescP").value = "0";
Descuento = 0;
alert("No puede exceder el descuento maximo autorizado.");
}
$get("TxtPorDescP").value = formato_numero((Descuento * 100 / Monto), 2, '.', ','); $get("TxtPorDescP").value = formato_numero((Descuento * 100 / Monto), 2, '.', ',');
$get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ','); $get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');

View File

@@ -1062,6 +1062,7 @@ Partial Class PV
ViewState("ClienteRetIVA") = 0 ViewState("ClienteRetIVA") = 0
ViewState("ClienteRetISR") = 0 ViewState("ClienteRetISR") = 0
ViewState("EnviarCorreoCliente") = False ViewState("EnviarCorreoCliente") = False
HdnPorcentajeDescuentoMaximo.Value = UsuarioActual.DescuentoAutorizado.ToString()
CveVentaDetalle = -1 CveVentaDetalle = -1
EstablecioFolio = False EstablecioFolio = False
EstatusCliente = False EstatusCliente = False
@@ -5102,52 +5103,52 @@ Partial Class PV
End Sub End Sub
Protected Sub BtnAplicarDescG_Click(sender As Object, e As System.EventArgs) Handles BtnAplicarDescG.Click Protected Sub BtnAplicarDescG_Click(sender As Object, e As System.EventArgs) Handles BtnAplicarDescG.Click
If HdnTipoDescuento.Value = "2" Then 'If HdnTipoDescuento.Value = "2" Then
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then ' If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
Dim IVAPromedio As Double = Math.Round(TmpDT.SUM("IVA") / TmpDT.COUNT("Consec"), 2) ' Dim IVAPromedio As Double = Math.Round(TmpDT.SUM("IVA") / TmpDT.COUNT("Consec"), 2)
Dim IVA As Double = TmpDT.Rows(0)("IVA").ToString.ToDouble ' Dim IVA As Double = TmpDT.Rows(0)("IVA").ToString.ToDouble
If IVAPromedio <> IVA Then ' If IVAPromedio <> IVA Then
Alert("No se puede aplicar descuento general a la factura ya tiene conceptos con diferente tasa de IVA", TipoMensaje.MsgError) ' Alert("No se puede aplicar descuento general a la factura ya tiene conceptos con diferente tasa de IVA", TipoMensaje.MsgError)
Else ' Else
AplicarDescuentos() ' AplicarDescuentos()
'Dim Descuento As Double = HdnDescuento.Value.Trim.Replace(",", "").ToDouble ' 'Dim Descuento As Double = HdnDescuento.Value.Trim.Replace(",", "").ToDouble
CalculaTotalesVenta() ' CalculaTotalesVenta()
'LblDescuentos.Text = Descuento.FormatoNumero(2) ' 'LblDescuentos.Text = Descuento.FormatoNumero(2)
'TxtIVA.Text = ((TxtSubTotal.Text.Trim.Replace(",", "").ToDouble - Descuento - LblAmortizacion.Text.Trim.Replace(",", "").ToDouble) * IVAPromedio).FormatoNumero(2) ' 'TxtIVA.Text = ((TxtSubTotal.Text.Trim.Replace(",", "").ToDouble - Descuento - LblAmortizacion.Text.Trim.Replace(",", "").ToDouble) * IVAPromedio).FormatoNumero(2)
'HdnIVAOriginal.Value = TxtIVA.Text ' 'HdnIVAOriginal.Value = TxtIVA.Text
'CalculaTotales(True) ' 'CalculaTotales(True)
HdnTipoDescuento.Value = "-1" ' HdnTipoDescuento.Value = "-1"
HdnDescuento.Value = "0" ' HdnDescuento.Value = "0"
RegistraScript("BorraDescuentos();") ' RegistraScript("BorraDescuentos();")
End If ' End If
End If ' End If
UpPS.Update() ' UpPS.Update()
ElseIf HdnTipoDescuento.Value = "3" Then 'ElseIf HdnTipoDescuento.Value = "3" Then
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then ' If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then
Dim IVAPromedio As Double = Math.Round(TmpDT.SUM("IVA") / TmpDT.COUNT("Consec"), 2) ' Dim IVAPromedio As Double = Math.Round(TmpDT.SUM("IVA") / TmpDT.COUNT("Consec"), 2)
Dim IVA As Double = TmpDT.Rows(0)("IVA").ToString.ToDouble ' Dim IVA As Double = TmpDT.Rows(0)("IVA").ToString.ToDouble
If IVAPromedio <> IVA Then ' If IVAPromedio <> IVA Then
Alert("No se puede aplicar descuento general a la factura ya tiene conceptos con diferente tasa de IVA", TipoMensaje.MsgError) ' Alert("No se puede aplicar descuento general a la factura ya tiene conceptos con diferente tasa de IVA", TipoMensaje.MsgError)
Else ' Else
AplicarDescuentos() ' AplicarDescuentos()
'Dim Amortizacion As Decimal = HdnDescuento.Value.Trim.Replace(",", "").ToDecimal ' 'Dim Amortizacion As Decimal = HdnDescuento.Value.Trim.Replace(",", "").ToDecimal
'LblAmortizacion.Text = Amortizacion.FormatoNumero(2) ' 'LblAmortizacion.Text = Amortizacion.FormatoNumero(2)
'TxtIVA.Text = ((TxtSubTotal.Text.Trim.Replace(",", "").ToDouble - Amortizacion - LblDescuentos.Text.Trim.Replace(",", "").ToDouble) * IVAPromedio).FormatoNumero(2) ' 'TxtIVA.Text = ((TxtSubTotal.Text.Trim.Replace(",", "").ToDouble - Amortizacion - LblDescuentos.Text.Trim.Replace(",", "").ToDouble) * IVAPromedio).FormatoNumero(2)
'HdnIVAOriginal.Value = TxtIVA.Text ' 'HdnIVAOriginal.Value = TxtIVA.Text
'CalculaTotales(True) ' 'CalculaTotales(True)
CalculaTotalesVenta() ' CalculaTotalesVenta()
HdnTipoDescuento.Value = "-1" ' HdnTipoDescuento.Value = "-1"
HdnDescuento.Value = "0" ' HdnDescuento.Value = "0"
RegistraScript("BorraDescuentos();") ' RegistraScript("BorraDescuentos();")
End If ' End If
End If ' End If
UpPS.Update() ' UpPS.Update()
End If 'End If
RegistraScript("$('#ModalDescuento').modal('hide')", "hidemodal") RegistraScript("$('#ModalDescuento').modal('hide')", "hidemodal")
End Sub End Sub
@@ -6463,7 +6464,7 @@ Partial Class PV
Else Else
'TxtPUFactura.Enabled = True 'TxtPUFactura.Enabled = True
'TxtPUFactura.Text = "" 'TxtPUFactura.Text = ""
DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, AplicaParaVenta:=1) DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
End If End If
DdlPSAjuste.DataBind() DdlPSAjuste.DataBind()
' DdlPSAjuste.Items.Insert(0, New ListItem("Seleccione", "-1")) ' DdlPSAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))

View File

@@ -6680,11 +6680,16 @@
</div> </div>
</div> </div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom"> <div class="portlet-body form-horizontal form-row-sepe formnombottom">
<div class="row">
<div class="col-md-12">
<asp:CheckBox ID="ChkMostarProductosRNCBon" runat="server" AutoPostBack="true" Text="Mostrar Productos" OnCheckedChanged="ChkMostarProductosRNCBon_CheckedChanged" />
</div>
</div>
<div class="row" style="margin-right: 10px;" align="right"> <div class="row" style="margin-right: 10px;" align="right">
<input type="text" id="TxtBusquedaNCBon" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaNCBon','{0}')", GvRemisionesNCBon.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusquedaNCBon" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaNCBon','{0}')", GvRemisionesNCBon.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaNCBon','{0}')", GvRemisionesNCBon.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaNCBon','{0}')", GvRemisionesNCBon.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<div class="row"> <div class="row" id="DivRNCBonificaciones" runat="server" visible="false">
<div class="col-md-12" style="max-height: 440px; overflow: auto"> <div class="col-md-12" style="max-height: 440px; overflow: auto">
<asp:GridView ID="GvRemisionesNCBon" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvRemisionesNCBon" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveVenta,CveVentaRNCCargo" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None"> DataKeyNames="CveVenta,CveVentaRNCCargo" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
@@ -6716,6 +6721,35 @@
</asp:GridView> </asp:GridView>
</div> </div>
</div> </div>
<div class="row" id="DivRNCBonificacionesDetalle" runat="server" visible="false">
<div class="col-md-12" style="max-height: 440px; overflow: auto">
<asp:GridView ID="GvRemisionesNCBonDetalle" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveVenta,CveVentaDetalleRNC,CvePS,PU,PorcentajeIVA" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkAplicar" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidadRNC" runat="server" Text='<%#Eval("CantidadPendiente").ToString%>' MaxLength="12" Width="46px" Height="24px"></asp:TextBox>
<asp:RangeValidator ID="RVCantRNC" runat="server" Type="Double" MinimumValue="0" MaximumValue='<%#Eval("CantidadPendiente").ToString%>' ErrorMessage="Cantidad Excedida" ControlToValidate="TxtCantidadRNC" Display="None" ValidationGroup="VGAplicarRNC"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidad3" runat="server" HighlightCssClass="vco" TargetControlID="RVCantRNC" Width="300px"></ajax:ValidatorCalloutExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="TtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@@ -7769,7 +7803,6 @@
} }
function CalculaSaldoRNCChkDetalleBonificacion(TxtCantidad, CantidadPendiente, ImporteTotal, Chk) { function CalculaSaldoRNCChkDetalleBonificacion(TxtCantidad, CantidadPendiente, ImporteTotal, Chk) {
//ImportesRNCCargo //ImportesRNCCargo
let Importe = 0; let Importe = 0;
@@ -7836,6 +7869,73 @@
} }
}
function CalculaSaldoRNCChkDetalleBon(TxtCantidad, CantidadPendiente, ImporteTotal, Chk) {
//ImportesRNCCargo
let Importe = 0;
if (Chk.checked) {
let SaldoMaximoUtilizable = ToDouble(HdnSMUBon.value);
let ImportesAsignados = 0;
$('.ImportesRNCDetalleBonificacion').each(function () {
if (Chk.id != $(this).find("td").eq(0).find(":checkbox").attr('id')) {
let seleccionado = $(this).find("td").eq(0).find(":checkbox").is(':checked');
if (seleccionado) {
let cantidad = ToDouble($(this).find("td").eq(1).find(":text").val());
let porcentajeIVA = ToDouble($(this).find("td").eq(0).find(":hidden").val());
let precio = ToDouble($(this).find("td").eq(5).find(":hidden").val());
let totalcalculableImpuestos = (cantidad * precio);
let iva = ToDouble((totalcalculableImpuestos * porcentajeIVA).toFixed(2));
ImportesAsignados += totalcalculableImpuestos + iva;
}
}
});
Importe = SaldoMaximoUtilizable - ImportesAsignados;
if (Importe > 0) {
} else {
if (SaldoMaximoUtilizable > 0) {
Importe = 0;
Chk.checked = false;
} else {
Importe = 0;
}
}
} else {
Importe = 0;
}
Importe = ToDouble(Importe.toFixed(2));
if (Importe > 0) {
let pu = (ImporteTotal / CantidadPendiente);
if (pu > 0) {
const cantidadSugerida = (Importe / pu);
if (cantidadSugerida > CantidadPendiente) {
TxtCantidad.value = CantidadPendiente.toString();
}else {
TxtCantidad.value = cantidadSugerida.toString();
}
}else {
TxtCantidad.value = "0";
}
}else {
TxtCantidad.value = "0";
}
} }
function LimitaSaldoRNCChk(TxtImporte, Saldo) { function LimitaSaldoRNCChk(TxtImporte, Saldo) {

View File

@@ -3359,7 +3359,7 @@ Partial Class Ventas
Dim ObjContrato As New ClsContratos Dim ObjContrato As New ClsContratos
Dim NoId As Integer = 0 Dim NoId As Integer = 0
If ObjContrato.GetContratosDetalle(DdlContratosModal.SelectedValue.ToEntero()) Then If ObjContrato.GetContratosDetalle(DdlContratosModal.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then
'SI ES CONTRATO DE CONSIGNACION DE VENTA AGARRA LAS EXISTENCIAS DEL ALMACEN 'SI ES CONTRATO DE CONSIGNACION DE VENTA AGARRA LAS EXISTENCIAS DEL ALMACEN
CreaConsignacionSerieDetalle() CreaConsignacionSerieDetalle()
@@ -25127,6 +25127,18 @@ Partial Class Ventas
End If End If
UpModalRemisionesNC.Update() UpModalRemisionesNC.Update()
End Sub End Sub
Protected Sub ChkMostarProductosRNCBon_CheckedChanged(sender As Object, e As EventArgs)
If ChkMostarProductosRNCBon.Checked Then
DivRNCBonificaciones.Visible = False
DivRNCBonificacionesDetalle.Visible = True
CargaRNCDetalleBonificacion(DdlVentaUsado.SelectedValue.ToEntero())
Else
DivRNCBonificaciones.Visible = True
DivRNCBonificacionesDetalle.Visible = False
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
End If
UpModalRemisionesNC.Update()
End Sub
Protected Sub ChkMostarProductosRNCDesc_CheckedChanged(sender As Object, e As EventArgs) Protected Sub ChkMostarProductosRNCDesc_CheckedChanged(sender As Object, e As EventArgs)
RblRNCTipoDesc_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty) RblRNCTipoDesc_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
@@ -25339,7 +25351,63 @@ Partial Class Ventas
UpDescNC.Update() UpDescNC.Update()
End Sub End Sub
Private Sub CargaRNCDetalleBonificacion(Optional CveVentaUsado As Integer = -1)
'Dim ObjMovtos As New ClsMovimientos()
'If ObjMovtos.GetRemisionesNCCliente(CveCliente, True, CveMoneda:=-1, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then
' Me.TmpDTRNCBonificacionDetalle = ObjMovtos.DtResultados.Copy()
'End If
'ObjMovtos.Dispose()
'Me.TmpDTRNCBonificacionDetalle.Columns.Add(New DataColumn("CveVentaDetalleNCGenerada", GetType(Integer)))
'Me.TmpDTRNCBonificacionDetalleSeleccionadas = Nothing
'Me.TmpDTRNCBonificacionDetalleSeleccionadas = TmpDTRNCBonificacionDetalle.Clone()
'Me.TmpDTRNCBonificacionDetalleSeleccionadas.Clear()
'GvRemisionesNCBonDetalle.DataSource = TmpDTRNCBonificacionDetalle.FiltraParametros("TipoRNC = 2")
'GvRemisionesNCBonDetalle.DataBind()
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetRemisionesNCCliente(CveCliente, True, CveMoneda:=-1, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then
Me.TmpDTRNCDetalle = ObjMovtos.DtResultados.Copy()
End If
ObjMovtos.Dispose()
Me.TmpDTRNCDetalle.Columns.Add(New DataColumn("CveVentaDetalleNCGenerada", GetType(Integer)))
Me.TmpDTRNCDetalleSelecciondas = Nothing
Me.TmpDTRNCDetalleSelecciondas = TmpDTRNCDetalle.Clone()
Me.TmpDTRNCDetalleSelecciondas.Clear()
GvRemisionesNCBonDetalle.DataSource = TmpDTRNCDetalle.FiltraParametros("TipoRNC = 2")
GvRemisionesNCBonDetalle.DataBind()
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(5)
DivSMU.Visible = True
HdnSMUBon.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMUBon.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else
'DivSMU.Visible = False
HdnSMUBon.Value = "0"
LtlSMUBon.Text = "0"
End If
ObjAcum.Dispose()
'Dim SaldoMaximoUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
'If SaldoMaximoUsados > 0 Then
' HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
' LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsados)
'Else
' HdnSaldoMaximoUsados.Value = "0"
' LblSaldoMaximoUsados.Text = "0"
'End If
UpModalRemisionesNC.Update()
End Sub
Private Sub CargaRNCDetalleDescBonificacion() Private Sub CargaRNCDetalleDescBonificacion()
Dim DtNC As DataTable = Nothing Dim DtNC As DataTable = Nothing
@@ -25375,74 +25443,95 @@ Partial Class Ventas
If TmpDTRNCBonificacionesSeleccionadas Is Nothing Then If TmpDTRNCBonificacionesSeleccionadas Is Nothing Then
TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone() TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone()
End If End If
If ChkMostarProductosRNCBon.Checked Then
DivRNCBonificaciones.Visible = False
DivRNCBonificacionesDetalle.Visible = True
Dim ListaBon As New List(Of VentasBonificaciones) CargaRNCDetalleBonificacion()
Dim DtBon As DataTable = Nothing
Dim SbFiltro As New StringBuilder()
SbFiltro.Append("CveVenta IN(")
Using ObjAcum As New ClsAcumuladores
If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=CveVentaRNCCargo) Then
DtBon = ObjAcum.DtResultados.Copy()
End If
End Using
If DtBon IsNot Nothing Then
Dim queryBonificacion = From dr In DtBon
Where dr("CveVentaBonificacion").ToString().ToEntero > 0
Group By CveVentaBonificacion = dr("CveVentaBonificacion").ToString().ToEntero, CveVenta = dr("CveVenta").ToString().ToEntero
Into x = Group
Select New With {
.CveVentaRNCCargo = CveVenta,
.CveVentaBonificacion = CveVentaBonificacion,
.ImporteBonificacion = x.Sum(Function(s) s("ImporteBonificacion").ToString().ToDecimal),
.IVABonificacion = x.Sum(Function(s) s("IVABonificacion").ToString().ToDecimal)
}
For Each bon In queryBonificacion
SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
Next
SbFiltro.Remove(SbFiltro.Length - 1, 1)
SbFiltro.Append(")")
End If
If ListaBon.Count > 0 Then
Dim Bonificaciones = Me.TmpDTRNCBonificacionesCliente.Select(SbFiltro.ToString())
For Each RowBonificacion As DataRow In Bonificaciones
Dim RNCBonificacion = ListaBon.Where(Function(x) x.CveVentaBonificacion = RowBonificacion("CveVenta").ToString().ToEntero())
RowBonificacion("ImporteBonificacion") = RNCBonificacion.Sum(Function(x) x.ImporteBonificacion)
RowBonificacion("IVABonificacion") = RNCBonificacion.Sum(Function(x) x.IVABonificacion)
RowBonificacion("CveVentaRNCCargo") = CveVentaRNCCargo
If AplicarRNC Then
TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray)
Else
For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString())
RowEliminar.Delete()
Next
End If
Next
End If
'VERIFICA SI TIENE BONIFICACIONES PARA AGREGARLAS
If TmpDTRNCBonificacionesSeleccionadas IsNot Nothing AndAlso TmpDTRNCBonificacionesSeleccionadas.Rows.Count > 0 Then
DivRNCBon.Visible = True
Else Else
DivRNCBon.Visible = False DivRNCBonificaciones.Visible = True
DivRNCBonificacionesDetalle.Visible = False
Dim ListaBon As New List(Of VentasBonificaciones)
Dim DtBon As DataTable = Nothing
Dim SbFiltro As New StringBuilder()
SbFiltro.Append("CveVenta IN(")
Using ObjAcum As New ClsAcumuladores
If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=CveVentaRNCCargo) Then
DtBon = ObjAcum.DtResultados.Copy()
End If
End Using
If DtBon IsNot Nothing Then
Dim queryBonificacion = From dr In DtBon
Where dr("CveVentaBonificacion").ToString().ToEntero > 0
Group By CveVentaBonificacion = dr("CveVentaBonificacion").ToString().ToEntero, CveVenta = dr("CveVenta").ToString().ToEntero
Into x = Group
Select New With {
.CveVentaRNCCargo = CveVenta,
.CveVentaBonificacion = CveVentaBonificacion,
.ImporteBonificacion = x.Sum(Function(s) s("ImporteBonificacion").ToString().ToDecimal),
.IVABonificacion = x.Sum(Function(s) s("IVABonificacion").ToString().ToDecimal)
}
For Each bon In queryBonificacion
SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
Next
SbFiltro.Remove(SbFiltro.Length - 1, 1)
SbFiltro.Append(")")
End If
If ListaBon.Count > 0 Then
Dim Bonificaciones = Me.TmpDTRNCBonificacionesCliente.Select(SbFiltro.ToString())
For Each RowBonificacion As DataRow In Bonificaciones
Dim RNCBonificacion = ListaBon.Where(Function(x) x.CveVentaBonificacion = RowBonificacion("CveVenta").ToString().ToEntero())
RowBonificacion("ImporteBonificacion") = RNCBonificacion.Sum(Function(x) x.ImporteBonificacion)
RowBonificacion("IVABonificacion") = RNCBonificacion.Sum(Function(x) x.IVABonificacion)
RowBonificacion("CveVentaRNCCargo") = CveVentaRNCCargo
If AplicarRNC Then
TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray)
Else
For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString())
RowEliminar.Delete()
Next
End If
Next
End If
'VERIFICA SI TIENE BONIFICACIONES PARA AGREGARLAS
If TmpDTRNCBonificacionesSeleccionadas IsNot Nothing AndAlso TmpDTRNCBonificacionesSeleccionadas.Rows.Count > 0 Then
DivRNCBon.Visible = True
Else
DivRNCBon.Visible = False
End If
GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas
GvRemisionesNCBon.DataBind()
'Dim SMUBon As Decimal = Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal()
'LtlSMUBon.Text = String.Format("{0:N2}", SMUBon)
'HdnSMUBon.Value = SMUBon.ToString()
Dim ObjAcum2 As New ClsAcumuladores
If ObjAcum2.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum2.DtResultados.Rows(5)
HdnSMUBon.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMUBon.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else
HdnSMUBon.Value = "0"
LtlSMUBon.Text = "0"
End If
ObjAcum2.Dispose()
UpModalRemisionesNC.Update()
End If End If
GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas
GvRemisionesNCBon.DataBind()
Dim SMUBon As Decimal = Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal()
LtlSMUBon.Text = String.Format("{0:N2}", SMUBon)
HdnSMUBon.Value = SMUBon.ToString()
UpModalRemisionesNC.Update()
End Sub End Sub
'Protected Sub ChkAplicarRNC_CheckedChanged(sender As Object, e As EventArgs) 'Protected Sub ChkAplicarRNC_CheckedChanged(sender As Object, e As EventArgs)
@@ -25623,6 +25712,22 @@ Partial Class Ventas
End If End If
End If End If
End Sub End Sub
Protected Sub GvRemisionesNCBonDetalle_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNCBonDetalle.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveVentaDetalleRNC").ToEntero() = 0 Then
e.Row.CssClass = "Totales"
e.Row.FCCheckBox("ChkAplicar").Visible = False
e.Row.FCTextBox("TxtCantidadRNC").Visible = False
Else
e.Row.CssClass = "ImportesRNCDetalle"
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCChkDetalleBon({e.Row.FCTextBox("TxtCantidadRNC").ClientID},{e.Row.DBCampo("CantidadPendiente").ToDouble},{e.Row.DBCampo("Total").ToDouble}, this);")
'e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});")
End If
End If
End Sub
Protected Sub GvRNCDevoluciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRNCDevoluciones.RowDataBound Protected Sub GvRNCDevoluciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRNCDevoluciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCBonChkDesc({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);") e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCBonChkDesc({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
@@ -30037,7 +30142,8 @@ Partial Class Ventas
NCConcepto = ArrayNC(1).ToEntero() NCConcepto = ArrayNC(1).ToEntero()
End Select End Select
If ChkMostarProductosRNC.Checked Then 'CARGOS/AJUSTES POR GARANTIA POR PRODUCTO
If RblRNCTipo.SelectedValue.Contiene("1", "3") AndAlso ChkMostarProductosRNC.Checked Then
Dim TotalAcumulado As Decimal = 0 Dim TotalAcumulado As Decimal = 0
Me.AplicaRNCXDetalle = True Me.AplicaRNCXDetalle = True
@@ -30105,8 +30211,8 @@ Partial Class Ventas
Exit For Exit For
End If End If
Next Next
'CARGOS/AJUSTES POR GARANTIA POR TOTAL
Else ElseIf RblRNCTipo.SelectedValue.Contiene("1", "3") AndAlso Not ChkMostarProductosRNC.Checked Then
For Each GvRow As GridViewRow In GvRemisionesNC.Rows For Each GvRow As GridViewRow In GvRemisionesNC.Rows
If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.RowType = DataControlRowType.DataRow Then
@@ -30156,7 +30262,77 @@ Partial Class Ventas
Else Else
DdlNCPS.Enabled = True DdlNCPS.Enabled = True
End If End If
'BONIFICACIONES POR PRODUCTO
ElseIf RblRNCTipo.SelectedValue.Contiene("2") AndAlso ChkMostarProductosRNCBon.Checked Then
Dim TotalAcumulado As Decimal = 0
Me.AplicaRNCXDetalle = True
For Each GvRow As GridViewRow In GvRemisionesNCBonDetalle.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim Rows = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}")
For Each row In Rows
row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray)
Next
End If
End If
Next
Dim TerminarCiclo As Boolean = False
For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa)
Dim TotalRNC As Decimal = 0
For Each GvRow As GridViewRow In GvRemisionesNCBonDetalle.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked AndAlso GvRow.DataKey("CveVenta").ToEntero() = Dr("CveVenta").ToString().ToEntero() Then
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
Dim PU = GvRow.DataKey("PU").ToDecimal()
Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal()
Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU)
Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * PorcentajeIVA).RoundSQL(2)
Dim TotalRNCDetalle As Decimal = (TotalCalculableImpuestos + ImporteIVA)
TotalRNC += TotalRNCDetalle
End If
End If
Next
TotalAcumulado += TotalRNC
'SI SE EXECE RESTA AL ULTIMO
If TotalAcumulado > LtlSMUBon.Text.ToDecimal() Then
TerminarCiclo = True
TotalAcumulado -= TotalRNC
TotalRNC = LtlSMUBon.Text.ToDecimal() - TotalAcumulado
End If
RemNC.TotalRemNCAplicado = TotalRNC
'MARCA LA VENTA QUE FUE USADA PARA EL FILTRO
RemNC.Num3 = DdlVentaUsado.SelectedValue.ToEntero()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaRemisionesNC.Clear()
Exit Sub
End If
ListaRemisionesNC.Add(RemNC)
If TerminarCiclo Then
Exit For
End If
Next
'BONIFICACIONES POR TOTAL
ElseIf RblRNCTipo.SelectedValue.Contiene("2") AndAlso Not ChkMostarProductosRNCBon.Checked Then
For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows
If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then If GvRow.FCCheckBox("ChkAplicar").Checked Then
@@ -30167,21 +30343,20 @@ Partial Class Ventas
If RemNC.TotalRemNCAplicado <= 0 Then If RemNC.TotalRemNCAplicado <= 0 Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia) Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaNCBonificacion.Clear() ListaRemisionesNC.Clear()
Exit Sub Exit Sub
End If End If
ListaNCBonificacion.Add(RemNC) ListaRemisionesNC.Add(RemNC)
End If End If
End If End If
Next Next
'SI SON SOLO BONIFICACIONES GENERA LA NC PRINCIPAL EN BASE A ESAS 'SI SON SOLO BONIFICACIONES GENERA LA NC PRINCIPAL EN BASE A ESAS
If RblRNCTipo.SelectedValue.ToString() = "2" AndAlso ListaRemisionesNC.Count = 0 Then 'If RblRNCTipo.SelectedValue.ToString() = "2" AndAlso ListaRemisionesNC.Count = 0 Then
ListaRemisionesNC.AddRange(ListaNCBonificacion) ' ListaRemisionesNC.AddRange(ListaNCBonificacion)
ListaNCBonificacion.Clear() ' ListaNCBonificacion.Clear()
End If 'End If
End If End If
Dim DrPSSeleccionado As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCConcepto).FiltroPrimero("") Dim DrPSSeleccionado As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCConcepto).FiltroPrimero("")