This commit is contained in:
2025-01-13 06:59:57 -07:00
17 changed files with 759 additions and 163 deletions

View File

@@ -521,6 +521,27 @@ Public Class ClsMovimientos
OnError("Ocurrió un error al consultar los Anticipos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) OnError("Ocurrió un error al consultar los Anticipos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try End Try
Return Retorno
End Function
Public Function GetAnticiposNCIxCAutorizaciones(CveCliente As Integer, CveEmpresa As Integer, FechaI As DateTime, FechaF As DateTime) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ClienteAnticiposNCIxCAutorizaciones")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@FechaI", SqlDbType.DateTime).Value = FechaI
.Add("@FechaF", SqlDbType.DateTime).Value = FechaF
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar los autorizaciones de anticipos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno Return Retorno
End Function End Function
Public Function GetRemisionesNCCliente(CveCliente As Integer, MostarDetalle As Boolean, Optional CveMoneda As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean Public Function GetRemisionesNCCliente(CveCliente As Integer, MostarDetalle As Boolean, Optional CveMoneda As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean

View File

@@ -2241,7 +2241,7 @@ Public Class ClsOC
#End Region #End Region
#Region " OC X VINCULAR COMPRA " #Region " OC X VINCULAR COMPRA "
Public Function GetPendietePorSurtirOC(FechaI As String, FechaF As String, CveProveedor As Integer, Folio As Integer, CveSubProyecto As Integer, CveCliente As Integer, CveEmpresa As Integer, Optional CveOC As Integer = -1) As Boolean Public Function GetPendietePorSurtirOC(FechaI As String, FechaF As String, CveProveedor As Integer, Folio As Integer, CveSubProyecto As Integer, CveCliente As Integer, CveEmpresa As Integer, Optional CveOC As Integer = -1, Optional Gpo As Integer = 1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OC_ComprasPendientesPorSurtirGet") DataAdapter("PA_OC_ComprasPendientesPorSurtirGet")
@@ -2255,6 +2255,7 @@ Public Class ClsOC
.Add("@FechaF", SqlDbType.VarChar).Value = FechaF .Add("@FechaF", SqlDbType.VarChar).Value = FechaF
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveOC", SqlDbType.Int).Value = CveOC .Add("@CveOC", SqlDbType.Int).Value = CveOC
.Add("@Gpo", SqlDbType.Int).Value = Gpo
End With End With
Try Try

View File

@@ -602,7 +602,7 @@ Public Class ClsVentas
Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Decimal = -1, Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Decimal = -1,
Optional RetISR As Decimal = -1, Optional Kilometraje As Decimal = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1, Optional RetISR As Decimal = -1, Optional Kilometraje As Decimal = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1,
Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional FechaParaSurtir As DateTime = MinFecha, Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional FechaParaSurtir As DateTime = MinFecha,
Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional CveCondicionEntrega As Integer = -1, Optional FolioRemision As String = "-1") As Boolean Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional CveCondicionEntrega As Integer = -1, Optional FolioRemision As String = "-1", Optional CveUsuarioModifico As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUpdate") DataAdapter("PA_Vta_VentasUpdate")
@@ -643,6 +643,7 @@ Public Class ClsVentas
.Add("@Episodio", SqlDbType.VarChar).Value = Episodio .Add("@Episodio", SqlDbType.VarChar).Value = Episodio
.Add("@CveCondicionEntrega", SqlDbType.Int).Value = CveCondicionEntrega .Add("@CveCondicionEntrega", SqlDbType.Int).Value = CveCondicionEntrega
.Add("@FolioRemision", SqlDbType.VarChar).Value = FolioRemision .Add("@FolioRemision", SqlDbType.VarChar).Value = FolioRemision
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
End With End With
Try Try
@@ -657,7 +658,7 @@ Public Class ClsVentas
Public Function UpdateObservacionesVenta(CveVenta As Integer, CveEmpresa As Integer, CveVendedor As Integer, Observaciones As String, FormaPaqueteria As Integer, CorreoNotificaciones As String, ObservacionesAlm As String, Public Function UpdateObservacionesVenta(CveVenta As Integer, CveEmpresa As Integer, CveVendedor As Integer, Observaciones As String, FormaPaqueteria As Integer, CorreoNotificaciones As String, ObservacionesAlm As String,
Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer, Optional DescripcionVenta As String = "-1", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Pedido As String, OrdenCompra As String, FechaPago As String, CveUsoCFDI As Integer, Optional DescripcionVenta As String = "-1", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1,
Optional FechaParaSurtir As DateTime = MinFecha, Optional Paciente As String = "-1", Optional Episodio As String = "-1") As Boolean Optional FechaParaSurtir As DateTime = MinFecha, Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional CveUsuarioModifico As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasObservacionesUpdate") DataAdapter("PA_Vta_VentasObservacionesUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -678,6 +679,8 @@ Public Class ClsVentas
.Add("@FechaParaSurtir", SqlDbType.DateTime).Value = FechaParaSurtir .Add("@FechaParaSurtir", SqlDbType.DateTime).Value = FechaParaSurtir
.Add("@Paciente", SqlDbType.VarChar).Value = Paciente .Add("@Paciente", SqlDbType.VarChar).Value = Paciente
.Add("@Episodio", SqlDbType.VarChar).Value = Episodio .Add("@Episodio", SqlDbType.VarChar).Value = Episodio
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
End With End With
Try Try
@@ -835,12 +838,13 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function UpdateFechaVencimientoVenta(CveVenta As Integer, FechaVencimiento As Date) As Boolean Public Function UpdateFechaVencimientoVenta(CveVenta As Integer, FechaVencimiento As Date, CveUsuarioModifico As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasFechaVencimientoUpdate") DataAdapter("PA_Vta_VentasFechaVencimientoUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento .Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -3069,7 +3069,7 @@ Namespace Modelos
Try Try
Dim AplicaCancelacionConPagos As Boolean = (CancelacionPagos = OpcionesCancelacionPagos.ConPagos_CancelarIE OrElse CancelacionPagos = OpcionesCancelacionPagos.ConPagos_GenerarIxC) Dim AplicaCancelacionConPagos As Boolean = (CancelacionPagos = OpcionesCancelacionPagos.ConPagos_CancelarIE OrElse CancelacionPagos = OpcionesCancelacionPagos.ConPagos_GenerarIxC)
If ObjFactura.TipoDocto.Contiene("Ing", "Rem") AndAlso AplicaCancelacionConPagos AndAlso ValorMultiplicador = -1 Then If ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant") AndAlso AplicaCancelacionConPagos AndAlso ValorMultiplicador = -1 Then
Dim DtPagosVenta As DataTable = Nothing Dim DtPagosVenta As DataTable = Nothing
If ObjClientes IsNot Nothing Then If ObjClientes IsNot Nothing Then

View File

@@ -512,40 +512,46 @@ Partial Class Bancos_DepositosCaja
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
Dim ObjMovtos As New ClsMovimientos() If DdlTipoDeposito.SelectedValue <> "8" Then
Dim FechaI, FechaF As Date Dim ObjMovtos As New ClsMovimientos()
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha) Dim FechaI, FechaF As Date
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1) FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha)
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1)
Dim CveSubProyecto As Integer = -1 Dim CveSubProyecto As Integer = -1
If DdlSubProyectos.SelectedValue.ToEntero > 0 Then If DdlSubProyectos.SelectedValue.ToEntero > 0 Then
CveSubProyecto = DdlSubProyectos.SelectedValue.ToEntero CveSubProyecto = DdlSubProyectos.SelectedValue.ToEntero
End If
Dim CveSubProyectoCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCajaChica.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero()
If CveSubProyectoCuenta > 0 Then
CveSubProyecto = CveSubProyectoCuenta
End If
If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, CveSubProyecto, FechaI, FechaF, UsuarioActual.CveUsuario) Then
Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario}) AND TipoDocto IN ('Ing','Rem') AND RemisionEspecial = 0")
'Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario} ")
'If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta
If dtt.Rows.Count = 0 Then
Respuesta = True
Else
Respuesta = False
Alert("No se puede realizar el depósito, ya que hay cobros pendientes por aplicar.", TipoMensaje.MsgAdvertencia)
End If End If
Dim CveSubProyectoCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCajaChica.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero()
If CveSubProyectoCuenta > 0 Then
CveSubProyecto = CveSubProyectoCuenta
End If
If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, CveSubProyecto, FechaI, FechaF, UsuarioActual.CveUsuario) Then
Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario}) AND TipoDocto IN ('Ing','Rem') AND RemisionEspecial = 0")
'Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario} ")
'If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta
If dtt.Rows.Count = 0 Then
Respuesta = True
Else
Respuesta = False
Alert("No se puede realizar el depósito, ya que hay cobros pendientes por aplicar.", TipoMensaje.MsgAdvertencia)
End If
Else
Alert("Error al consultarcobros pendientes.", TipoMensaje.MsgAdvertencia)
Respuesta = False
End If
ObjMovtos.Dispose()
Else Else
Alert("Error al consultarcobros pendientes.", TipoMensaje.MsgAdvertencia) 'SI ES TRANSFERENCIA PERMITIR CERRAR
Respuesta = False Respuesta = True
End If End If
ObjMovtos.Dispose()
Else Else
Respuesta = True Respuesta = True
End If End If

View File

@@ -342,7 +342,9 @@
<asp:CheckBox Text=" No Validar ante SAT" ID="ChkNoValidaSAT" CssClass="md-checksd" runat="server" Checked="false" Visible="false" /> <asp:CheckBox Text=" No Validar ante SAT" ID="ChkNoValidaSAT" CssClass="md-checksd" runat="server" Checked="false" Visible="false" />
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" /> <asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
<asp:CheckBox Text="Descuento" ID="chkaplicaDescuento" CssClass="md-checksd" runat="server" Checked="false" OnCheckedChanged="chkaplicaDescuento_CheckedChanged" AutoPostBack="true" Visible="false" /> <asp:CheckBox Text="Descuento" ID="chkaplicaDescuento" CssClass="md-checksd" runat="server" Checked="false" OnCheckedChanged="chkaplicaDescuento_CheckedChanged" AutoPostBack="true" Visible="false" />
<asp:CheckBox Text="Descuento Masivo" ID="chkaplicaDescuentoMasivo" CssClass="md-checksd" runat="server" Checked="false" OnCheckedChanged="chkaplicaDescuentoMasivo_CheckedChanged" AutoPostBack="true" Visible="false" />
<asp:TextBox runat="server" ID="TxtDescuenoMasivo" ClientIDMode="Static" onkeyup ="DescuenoMasivo(this)" Visible="false" Width="60px"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuenoMasivo" FilterType="Custom" ValidChars="1234567890+" />
</td> </td>
</tr> </tr>
@@ -453,7 +455,7 @@
<asp:TemplateField Visible="false" ItemStyle-Width="60px"> <asp:TemplateField Visible="false" ItemStyle-Width="60px">
<HeaderTemplate>% Desc.</HeaderTemplate> <HeaderTemplate>% Desc.</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtDescuento" Width="60px" runat="server" Style="text-align: right;" MaxLength="15"></asp:TextBox> <asp:TextBox ID="TxtDescuento" Width="60px" runat="server" Style="text-align: right;" MaxLength="15" CssClass="selDescuento"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuento" ValidChars="1234567890+." FilterType="Custom" /> <ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuento" ValidChars="1234567890+." FilterType="Custom" />
</ItemTemplate> </ItemTemplate>
@@ -789,6 +791,10 @@
} }
function DescuenoMasivo(txt) {
$(".selDescuento").val(txt.value);
$(".selDescuento").trigger("keyup");
}
</script> </script>
</asp:Content> </asp:Content>

View File

@@ -324,6 +324,7 @@ Partial Class Bancos_ProveedoresAbonar
If UsuarioActual.TienePermisoProceso(361) Then If UsuarioActual.TienePermisoProceso(361) Then
'GvCxP.Columns(11).Visible = True 'GvCxP.Columns(11).Visible = True
chkaplicaDescuento.Visible = True chkaplicaDescuento.Visible = True
chkaplicaDescuentoMasivo.Visible = True
End If End If
@@ -1673,10 +1674,15 @@ Partial Class Bancos_ProveedoresAbonar
GvCxP.Columns(11).Visible = chkaplicaDescuento.Checked GvCxP.Columns(11).Visible = chkaplicaDescuento.Checked
UPCompras.Update() UPCompras.Update()
End Sub End Sub
Protected Sub chkaplicaDescuentoMasivo_CheckedChanged(sender As Object, e As EventArgs)
GvCxP.Columns(11).Visible = chkaplicaDescuentoMasivo.Checked
TxtDescuenoMasivo.Visible = chkaplicaDescuentoMasivo.Checked
UPCompras.Update()
End Sub
Private Sub tmpValida() Private Sub tmpValida()

View File

@@ -315,7 +315,7 @@ Partial Class Inventarios_Kardex
End If End If
Dim ObjOC As New ClsOC Dim ObjOC As New ClsOC
If ObjOC.PendientesCompra(ddlProducto2.SelectedValue.ToEntero, tCveSubProyectos, UsuarioActual.CveEmpresa) Then If ObjOC.PendientesCompra(ddlProducto2.SelectedValue.ToEntero, tCveSubProyectos, UsuarioActual.CveEmpresa) Then
GvOC.DataSource = ObjOC.DtResultados.Copy GvOC.DataSource = ObjOC.DtResultados.Copy.FiltraParametros("", "Fecha Desc")
LnkIndicador_OC.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString() LnkIndicador_OC.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString()
End If End If
ObjOC.Dispose() ObjOC.Dispose()

View File

@@ -9,9 +9,23 @@ Imports Telerik.Web.UI
Partial Class Inventarios_KardexAlmacenHorizontal Partial Class Inventarios_KardexAlmacenHorizontal
Inherits ClsPaginas Inherits ClsPaginas
Private Property TienePermisoKardex As Boolean
Get
If ViewState("TienePermisoKardex") Is Nothing Then
ViewState("TienePermisoKardex") = False
End If
Return Boolean.Parse(ViewState("TienePermisoKardex").ToString)
End Get
Set(value As Boolean)
ViewState("TienePermisoKardex") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
'TxtFechaI.Text = NowADS().AddMonths(-1).ToShortDateString 'TxtFechaI.Text = NowADS().AddMonths(-1).ToShortDateString
TienePermisoKardex = If(UsuarioActual.TienePermisoPagina(224), True, False)
TxtFechaF.Text = NowADS().ToShortDateString TxtFechaF.Text = NowADS().ToShortDateString
CargaCombos() CargaCombos()
ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
@@ -241,7 +255,7 @@ Partial Class Inventarios_KardexAlmacenHorizontal
Dim Celda As String = Cells.Text Dim Celda As String = Cells.Text
If IsNumeric(Celda) Then If IsNumeric(Celda) Then
Dim CveAlmacen2 As Integer = -1 Dim CveAlmacen2 As Integer = -1
If Index >= 5 Then If Index >= 4 Then
Dim Array As String() = GvDatos.HeaderRow.Cells(Index).Text.Split("|"c) Dim Array As String() = GvDatos.HeaderRow.Cells(Index).Text.Split("|"c)
If Array.Length > 1 Then If Array.Length > 1 Then
CveAlmacen2 = Array(1).ToEntero CveAlmacen2 = Array(1).ToEntero
@@ -270,7 +284,7 @@ Partial Class Inventarios_KardexAlmacenHorizontal
Cells.Text = String.Format("{0:#,###.##}", Cells.Text.ToDecimal) Cells.Text = String.Format("{0:#,###.##}", Cells.Text.ToDecimal)
Else Else
Cells.Text = String.Format("{0:#,###.##}", Cells.Text.ToDecimal) Cells.Text = String.Format("{0:#,###.##}", Cells.Text.ToDecimal)
If Not e.Row.RowIndex = 0 And Ddlgrupo.SelectedValue.ToEntero = 1 Then If Not e.Row.RowIndex = 0 And Ddlgrupo.SelectedValue.ToEntero = 1 AndAlso TienePermisoKardex Then
Dim Liga2 As String = String.Format($"/Inventarios/Kardex.aspx?CvePS={e.Row.DataKey("CvePS")}&CveAlmacen={CveAlmacen2}&CveUM={DdlUnidadMedida.SelectedValue.ToEntero}&FechaI={txtFechaI.Text}&FechaF={TxtFechaF.Text}") Dim Liga2 As String = String.Format($"/Inventarios/Kardex.aspx?CvePS={e.Row.DataKey("CvePS")}&CveAlmacen={CveAlmacen2}&CveUM={DdlUnidadMedida.SelectedValue.ToEntero}&FechaI={txtFechaI.Text}&FechaF={TxtFechaF.Text}")
Cells.Text = String.Format("<a target='_blank' href=""{1}"">{0}</a>", Celda.FormatoNumero(), Liga2) Cells.Text = String.Format("<a target='_blank' href=""{1}"">{0}</a>", Celda.FormatoNumero(), Liga2)
End If End If

View File

@@ -734,6 +734,7 @@ Partial Class OC_OC
DdlSubProyectoGral.DataBind() DdlSubProyectoGral.DataBind()
DdlSubProyectoGral.Items.Insert(0, New ListItem("-", "-1")) DdlSubProyectoGral.Items.Insert(0, New ListItem("-", "-1"))
DdlSubProyectoGral.SelectedValueExist(UsuarioActual.CveSubProyecto) DdlSubProyectoGral.SelectedValueExist(UsuarioActual.CveSubProyecto)
DdlSubProyectoEntrega.SelectedValueExist(UsuarioActual.CveSubProyecto)
ModalidadSubProyectoGeneral = True ModalidadSubProyectoGeneral = True
TdProyectoSubPrpyectoDdl.Visible = False TdProyectoSubPrpyectoDdl.Visible = False
TdProyectoSubPrpyecto.Visible = False TdProyectoSubPrpyecto.Visible = False
@@ -4117,7 +4118,8 @@ Partial Class OC_OC
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
If TienePermisoKardex AndAlso e.Row.RowState = DataControlRowState.Normal Then 'If TienePermisoKardex AndAlso e.Row.RowState = DataControlRowState.Normal Then
If TienePermisoKardex AndAlso (e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate) Then
e.Row.FCLabel("LblPS").Visible = False e.Row.FCLabel("LblPS").Visible = False
e.Row.FCHyperLink("HlPS").Visible = True e.Row.FCHyperLink("HlPS").Visible = True
e.Row.FCHyperLink("HLPS").NavigateUrl = $"../Inventarios/Kardex.aspx?CvePS={e.Row.DBCampo("CvePS").ToString}" e.Row.FCHyperLink("HLPS").NavigateUrl = $"../Inventarios/Kardex.aspx?CvePS={e.Row.DBCampo("CvePS").ToString}"

View File

@@ -10,6 +10,22 @@
<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">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UppAcciones">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkExportar" runat="server"> <i class="fa fa-ad-excel"></i> Exportar Excel </asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkPdf" />
<asp:PostBackTrigger ControlID="LnkExportar" />
</Triggers>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content> </asp:Content>
@@ -57,6 +73,13 @@
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="select2me Widthall"></asp:DropDownList> <asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="select2me Widthall"></asp:DropDownList>
</div> </div>
<div class="col-md-1" style="max-width: 110px;">Grupo:</div>
<div class="col-md-1" >
<asp:DropDownList runat="server" ID="DdlGrupo" CssClass="select2me">
<asp:ListItem Value="1">Detallado</asp:ListItem>
<asp:ListItem Value="2">Por Orden de Compra</asp:ListItem>
</asp:DropDownList>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -84,6 +107,7 @@
<div class="col-md-12"> <div class="col-md-12">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" EmptyDataText="No se encontraron productos por surtir." CssClass="table table-striped table-hover Widthall ScrollAD" runat="server" AutoGenerateColumns="False" GridLines="None"> <asp:GridView ID="GvDatos" EmptyDataText="No se encontraron productos por surtir." CssClass="table table-striped table-hover Widthall ScrollAD" runat="server" AutoGenerateColumns="False" GridLines="None">
<Columns> <Columns>
<asp:HyperLinkField DataTextField="Folio" HeaderText="Folio" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" DataNavigateUrlFields="CveOrdenCompra" Target="_blank" /> <asp:HyperLinkField DataTextField="Folio" HeaderText="Folio" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" DataNavigateUrlFields="CveOrdenCompra" Target="_blank" />
@@ -95,6 +119,18 @@
<asp:BoundField DataField="Pendiente" HeaderText="Pendiente" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.####}" /> <asp:BoundField DataField="Pendiente" HeaderText="Pendiente" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.####}" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<asp:GridView ID="GvDatosPorOC" EmptyDataText="No se encontraron productos por surtir." CssClass="table table-striped table-hover Widthall ScrollAD" runat="server" AutoGenerateColumns="False" GridLines="None">
<Columns>
<asp:HyperLinkField DataTextField="Folio" HeaderText="Folio" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/OC/OC.aspx?OC={0}" DataNavigateUrlFields="CveOrdenCompra" Target="_blank" />
<asp:BoundField DataField="FechaIng" HeaderText="Fecha" DataFormatString="{0:d}" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" />
<asp:BoundField DataField="CantidadOC" HeaderText="CantidadOC" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.####}" />
<asp:BoundField DataField="CantidadCompra" HeaderText="Cantidad Compra" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.####}" />
<asp:BoundField DataField="Pendiente" HeaderText="Pendiente" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.####}" />
</Columns>
</asp:GridView>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>

View File

@@ -1,10 +1,41 @@
Option Explicit On Option Explicit On
Option Strict On Option Strict On
Imports System.Activities.Expressions
Imports System.Data
Imports Extensiones Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class OC_RepOCxSurtir Partial Class OC_RepOCxSurtir
Inherits ClsPaginas Inherits ClsPaginas
Property DtDatos As DataTable
Get
If ViewState("DtDatos") Is Nothing Then
ViewState("DtDatos") = New DataTable
End If
Return DirectCast(ViewState("DtDatos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
Property DtDatosPorOC As DataTable
Get
If ViewState("DtDatosPorOC") Is Nothing Then
ViewState("DtDatosPorOC") = New DataTable
End If
Return DirectCast(ViewState("DtDatosPorOC"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtDatosPorOC") = value
End Set
End Property
Protected Sub OC_RepOCxSurtir_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub OC_RepOCxSurtir_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
InicializaValores() InicializaValores()
@@ -71,20 +102,44 @@ Partial Class OC_RepOCxSurtir
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
Dim ObjOC As New ClsOC Dim ObjOC As New ClsOC
GvDatos.DataSource = Nothing
GvDatosPorOC.DataSource = Nothing
GvDatos.Visible = False
GvDatosPorOC.Visible = False
DtDatos = New DataTable
DtDatosPorOC = New DataTable
Dim FechaI, FechaF As String Dim FechaI, FechaF As String
FechaI = If(IsDate(TxtFechaI.Text.Trim()), TxtFechaI.Text.Trim(), "-1") FechaI = If(IsDate(TxtFechaI.Text.Trim()), TxtFechaI.Text.Trim(), "-1")
FechaF = If(IsDate(TxtFechaF.Text.Trim()), TxtFechaF.Text.Trim(), "-1") FechaF = If(IsDate(TxtFechaF.Text.Trim()), TxtFechaF.Text.Trim(), "-1")
If ObjOC.GetPendietePorSurtirOC(FechaI, FechaF, DdlProveedor.SelectedValue.ToEntero, If(TxtFolio.Text = "", -1, TxtFolio.Text.ToEntero), DdlSubProyecto.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then If ObjOC.GetPendietePorSurtirOC(FechaI, FechaF, DdlProveedor.SelectedValue.ToEntero, If(TxtFolio.Text = "", -1, TxtFolio.Text.ToEntero), DdlSubProyecto.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, UsuarioActual.CveEmpresa,
GvDatos.DataSource = ObjOC.DtResultados Gpo:=DdlGrupo.SelectedValue.ToEntero) Then
Else
GvDatos.DataSource = Nothing If DdlGrupo.SelectedValue.ToEntero = 1 Then
GvDatos.DataSource = ObjOC.DtResultados
DtDatos = ObjOC.DtResultados
GvDatos.Visible = True
Else
GvDatosPorOC.DataSource = ObjOC.DtResultados
DtDatosPorOC = ObjOC.DtResultados
GvDatosPorOC.Visible = True
End If
End If End If
GvDatos.DataBind()
ObjOC.Dispose() ObjOC.Dispose()
If DdlGrupo.SelectedValue.ToEntero = 1 Then
GvDatos.DataBind()
Else
GvDatosPorOC.DataBind()
End If
UpDatos.Update() UpDatos.Update()
End Sub End Sub
Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
@@ -103,7 +158,105 @@ Partial Class OC_RepOCxSurtir
End If End If
End Sub End Sub
Private Sub GvDatosPorOC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosPorOC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveOrdenCompra") = "" Then
e.Row.CssClass = "Totales"
'e.Row.Cells(3).Visible = False
'e.Row.Cells(2).ColumnSpan = 2
'ElseIf e.Row.DBCampo("CodigoPS") = "" Then
' e.Row.CssClass = "SubTotales2"
Else
'e.Row.Cells(0).Text = ""
'e.Row.Cells(1).Text = ""
'e.Row.Cells(2).Text = ""
End If
End If
End Sub
#End Region #End Region
#Region " IMPRIMIR "
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
'GvDatos.ExportToExcel("ReporteComprasDetalles" & NowADS().ToShortDateString)
GenerarPDF("EXCEL")
End Sub
Protected Sub LnkPdf_Click(sender As Object, e As EventArgs)
GenerarPDF("PDF")
End Sub
Private Sub GenerarPDF(Opcion As String)
Dim FechaI = If(TxtFechaI.Text = "" Or TxtFechaI.Text = "__/__/____", "-1", TxtFechaI.Text)
Dim FechaF = If(TxtFechaF.Text = "" Or TxtFechaF.Text = "__/__/____", "-1", TxtFechaF.Text)
'Dim Proveedor = If(DdlProveedores.SelectedValue = "-1", "", $"&emsp;<b>Proveedor:</b> {DdlProveedores.SelectedText}")
'Dim Capturo = If(DDlUsuarioCaptura.SelectedValue = "-1", "", $"&emsp;<b>Capturó:</b> {DDlUsuarioCaptura.SelectedItem.Text}")
Dim Grupo = DdlGrupo.SelectedItem.Text
Dim FechaIn As String = $"&emsp;<b>Fecha Inicio:</b> {TxtFechaI.Text}"
Dim FechaFn As String = $"&emsp;<b>Fecha Fin:</b> {TxtFechaF.Text}"
If TxtFechaI.Text = "" Then FechaIn = ""
If TxtFechaF.Text = "" Then FechaFn = ""
'Dim Proyecto = If(DdlProyecto.SelectedValue = "-1", "", $"&emsp;<b>Proyecto:</b> {DdlProyecto.SelectedItem.Text}")
'Dim SubProyecto = If(DdlSubProyecto.GetSelectedText = "", "", $"&emsp;<b>SubProyecto:</b> {DdlSubProyecto.GetSelectedText}")
'Dim TipoGasto = If(DdlTipoGasto.GetSelectedText = "", "", $"&emsp;<b>Tipo Gasto:</b> {DdlTipoGasto.GetSelectedText}")
'Dim TipoProveedor = If(DdlTipoProveedor.SelectedValue = "-1", "", $"&emsp;<b>Tipo de Proveedor:</b> {DdlTipoProveedor.SelectedItem.Text}")
'Dim TipoDocto = If(DdlTipoDocto.SelectedValue = "-1", "", $"&emsp;<b>Tipo de Documento:</b> {DdlTipoDocto.SelectedItem.Text}")
Dim FechaIF, FechaFF As String
FechaIF = If(IsDate(TxtFechaI.Text.Trim()), TxtFechaI.Text.Trim(), "-1")
FechaFF = If(IsDate(TxtFechaF.Text.Trim()), TxtFechaF.Text.Trim(), "-1")
Dim FechaICapturaF, FechaFCapturaF As String
'FechaICapturaF = If(IsDate(TxtFechaICaptura.Text.Trim()), TxtFechaICaptura.Text.Trim(), "-1")
'FechaFCapturaF = If(IsDate(TxtFechaFCaptura.Text.Trim()), TxtFechaFCaptura.Text.Trim(), "-1")
'Dim FechaCIn As String = $"&emsp;<b>Fecha Inicio Captura:</b> {TxtFechaICaptura.Text.Trim()}"
'Dim FechaCFn As String = $"&emsp;<b>Fecha Fin Captura:</b> {TxtFechaFCaptura.Text.Trim()}"
'If Not IsDate(TxtFechaICaptura.Text.Trim()) Then FechaCIn = ""
'If Not IsDate(TxtFechaFCaptura.Text.Trim()) Then FechaCFn = ""
If DdlGrupo.SelectedValue.ToEntero = 1 Then
Else
End If
If (DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 AndAlso DdlGrupo.SelectedValue.ToEntero = 1) Or (DtDatosPorOC IsNot Nothing AndAlso DtDatosPorOC.Rows.Count > 0 AndAlso DdlGrupo.SelectedValue.ToEntero = 2) Then
'For Each Dr As DataRow In DtDatos.Rows
' Dr("Fecha") = Dr("Fecha").ToString.ToDate.ToShortDateString
'Next
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("FechaImpresion", NowADS().ToString))
params.Add(New ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {Grupo}{FechaIn}{FechaFn}"))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
Dim NombreArchivo As String = If(DdlGrupo.SelectedValue.ToEntero = 1, "RepOCxSurtir.rdlc", "RepOCxSurtirPorOC.rdlc")
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo))
If Archivo.Exists Then
ImprimirPDF(Archivo.FullName, If(DdlGrupo.SelectedValue.ToEntero = 1, DtDatos, DtDatosPorOC), params, "OrdenesdeCompraporvincular ", Opcion)
Else
ImprimirPDF($"Empresas/Grales/Formatos/{NombreArchivo}", If(DdlGrupo.SelectedValue.ToEntero = 1, DtDatos, DtDatosPorOC), params, "OrdenesdeCompraporvincular", Opcion)
End If
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
End Sub
#End Region
End Class End Class

View File

@@ -104,48 +104,119 @@
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAutorizacion,CveCliente,CveVendedor,Importe,TipoAutorizacion,Saldo,LimiteCredito,DiasVencidos,DiasVencidosAutorizacion" <div class="portlet light xspadding traspasorow bordered">
EmptyDataText="No se encontraron autorizaciones" ToolTip="" <div class="portlet-title">
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None"> <div class="caption font-green">
<Columns> <span class="caption-subject bold uppercase" style="line-height: 1; color: #ff6000;">Solicitudes de autorizaciones</span>
<asp:TemplateField HeaderText="Tipo " ItemStyle-Width="3%"> </div>
<ItemTemplate> <div class="actions">
<asp:Label ID="LblTipo" Text='<%# Eval("TipoDocumento") %>' runat="server"></asp:Label> <div class="btn-group">
</ItemTemplate> <div class="row" style="margin-left: 0px; text-align: right" align="left">
</asp:TemplateField> <div style="margin-right: 15px">
<asp:TemplateField HeaderText="Tipo" ItemStyle-Width="3%"> <input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<ItemTemplate> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
<asp:Label ID="LblTipoAuto" Text='<%# Eval("TipoAutorizacionTexto") %>' runat="server"></asp:Label> </div>
</ItemTemplate> </div>
</asp:TemplateField> </div>
<asp:HyperLinkField DataTextField="NombreComercial" Target="_blank" HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" /> </div>
<asp:BoundField DataField="Vendedor" HeaderText="Vendedor" ItemStyle-Width="9%" /> </div>
<%-- 30--%> <div class="portlet-body rowpadding">
<asp:BoundField DataField="Importe" ItemStyle-Width="7%" HeaderText="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" /> <div class="row">
<asp:BoundField DataField="PorcentajeDescuento" ItemStyle-Width="5%" HeaderText="% Desc" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" /> <div class="col-md-12">
<asp:BoundField DataField="LimiteCredito" ItemStyle-Width="7%" HeaderText="L.Créd" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" /> <asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAutorizacion,CveCliente,CveVendedor,Importe,TipoAutorizacion,Saldo,LimiteCredito,DiasVencidos,DiasVencidosAutorizacion"
<asp:BoundField DataField="Saldo" ItemStyle-Width="7%" HeaderText="Saldo" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" /> EmptyDataText="No se encontraron autorizaciones" ToolTip=""
<asp:BoundField DataField="FechaIng" ItemStyle-Width="7%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" /> CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="3%" HeaderText="D.Ven" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" /> <Columns>
<asp:HyperLinkField DataTextField="FacturaAplicada" ItemStyle-Width="7%" Target="_blank" HeaderText="Factura" DataNavigateUrlFields="CveVentaAplicada" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Left" /> <asp:TemplateField HeaderText="Tipo " ItemStyle-Width="3%">
<%-- 45--%> <ItemTemplate>
<asp:BoundField DataField="Usuario" HeaderText="Solicitó" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" /> <asp:Label ID="LblTipo" Text='<%# Eval("TipoDocumento") %>' runat="server"></asp:Label>
<asp:BoundField DataField="Motivo" HeaderText="Motivo" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" /> </ItemTemplate>
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" > </asp:TemplateField>
<ItemTemplate> <asp:TemplateField HeaderText="Tipo" ItemStyle-Width="3%">
<asp:Label ID="LblEstatus" Text='<%# Eval("Estatus") %>' runat="server"></asp:Label> <ItemTemplate>
</ItemTemplate> <asp:Label ID="LblTipoAuto" Text='<%# Eval("TipoAutorizacionTexto") %>' runat="server"></asp:Label>
</asp:TemplateField> </ItemTemplate>
<asp:BoundField DataField="UsuarioAutorizo" HeaderText="Autorizó" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" /> </asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7%" HeaderText="Acciones"> <asp:HyperLinkField DataTextField="NombreComercial" Target="_blank" HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" />
<ItemTemplate> <asp:BoundField DataField="Vendedor" HeaderText="Vendedor" ItemStyle-Width="9%" />
<asp:LinkButton data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea autorizar el limite?" data-btn-ok-label="si" ID="LnkAutorizar" OnClick="LnkAutorizar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-check'></i>"></asp:LinkButton> <%-- 30--%>
<asp:LinkButton data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea rechazar el limite?" data-btn-ok-label="si" ID="LnkRechazar" OnClick="LnkRechazar_Click" CssClass="btn btn-circle btn-sm red" runat="server" Text="<i class='fa fa-times'></i>"></asp:LinkButton> <asp:BoundField DataField="Importe" ItemStyle-Width="7%" HeaderText="Importe" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" Visible='<%# Eval("CveEstatus").ToString = "0" OrElse Eval("CveEstatus").ToString = "1" %>' runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el limite?" data-btn-ok-label="si" /> <asp:BoundField DataField="PorcentajeDescuento" ItemStyle-Width="5%" HeaderText="% Desc" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
</ItemTemplate> <asp:BoundField DataField="LimiteCredito" ItemStyle-Width="7%" HeaderText="L.Créd" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
</asp:TemplateField> <asp:BoundField DataField="Saldo" ItemStyle-Width="7%" HeaderText="Saldo" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
</Columns> <asp:BoundField DataField="FechaIng" ItemStyle-Width="7%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
</asp:GridView> <asp:BoundField DataField="DiasVencidos" ItemStyle-Width="3%" HeaderText="D.Ven" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" />
<asp:HyperLinkField DataTextField="FacturaAplicada" ItemStyle-Width="7%" Target="_blank" HeaderText="Factura" DataNavigateUrlFields="CveVentaAplicada" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Left" />
<%-- 45--%>
<asp:BoundField DataField="Usuario" HeaderText="Solicitó" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Motivo" HeaderText="Motivo" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblEstatus" Text='<%# Eval("Estatus") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UsuarioAutorizo" HeaderText="Autorizó" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7%" HeaderText="Acciones">
<ItemTemplate>
<asp:LinkButton data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea autorizar el limite?" data-btn-ok-label="si" ID="LnkAutorizar" OnClick="LnkAutorizar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-check'></i>"></asp:LinkButton>
<asp:LinkButton data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea rechazar el limite?" data-btn-ok-label="si" ID="LnkRechazar" OnClick="LnkRechazar_Click" CssClass="btn btn-circle btn-sm red" runat="server" Text="<i class='fa fa-times'></i>"></asp:LinkButton>
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" Visible='<%# Eval("CveEstatus").ToString = "0" OrElse Eval("CveEstatus").ToString = "1" %>' runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el limite?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
<br />
<div class="portlet light xspadding traspasorow bordered" id="DivAntNCIxC" runat="server" visible="false">
<div class="portlet-title">
<div class="caption font-green">
<span class="caption-subject bold uppercase" style="line-height: 1; color: #ff6000;">Anticipos, notas de crédito e ingresos por comprobar</span>
</div>
<div class="actions">
<div class="btn-group">
<div class="row" style="margin-left: 0px; text-align: right" align="left">
<div style="margin-right: 15px">
<input type="text" id="TxtBusquedaAnt" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnt','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnt','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GVAnticipos" runat="server" ClientIDMode="Static" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall mysmallbtn" GridLines="None" DataKeyNames="CveIE,Folio,Tipo,CveVenta,CveCliente" Style="text-align: center; min-width: 783px; width: 100%;">
<Columns>
<asp:BoundField HeaderText="Cliente" DataField="NombreComercial" DataFormatString="{0}" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="40%" />
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%">
<ItemTemplate>
<asp:Literal ID="LtlFactura" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Tipo" DataField="Tipo" DataFormatString="{0}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="15%" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblEstatus" Text='<%# Eval("EstatusTexto") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Acciones" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
<ItemTemplate>
<asp:LinkButton ID="LnkAutorizar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ToolTip="Autorizar Anticipo" runat="server" OnClick="LnkAutorizarAnticipo_Click" />
<asp:LinkButton ID="LnkCancelar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-ban'></i>" ToolTip="Bloquear Anticipo" runat="server" OnClick="LnkCancelarAnticipo_Click" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div id="DModal" class="modal ADS fade" role="dialog"> <div id="DModal" class="modal ADS fade" role="dialog">

View File

@@ -62,6 +62,10 @@ Partial Class Ventas_CatAutorizacionLimites
DdlEstatus.SelectedValue = "0" DdlEstatus.SelectedValue = "0"
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
DivAntNCIxC.Visible = True
End If
UpModal.Update() UpModal.Update()
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
@@ -82,6 +86,11 @@ Partial Class Ventas_CatAutorizacionLimites
End If End If
ObjGral.Dispose() ObjGral.Dispose()
GvDatos.DataBind() GvDatos.DataBind()
If DivAntNCIxC.Visible Then
CargaAnticipos(CveCliente, FechaI, FechaF)
End If
UpDatos.Update() UpDatos.Update()
End Sub End Sub
@@ -367,4 +376,130 @@ Partial Class Ventas_CatAutorizacionLimites
Public Overrides Sub VerifyRenderingInServerForm(control As Control) Public Overrides Sub VerifyRenderingInServerForm(control As Control)
End Sub End Sub
#End Region #End Region
Private Sub CargaAnticipos(CveCliente As Integer, FechaI As DateTime, FechaF As DateTime)
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetAnticiposNCIxCAutorizaciones(CveCliente, UsuarioActual.CveEmpresa, FechaI, FechaF) Then
GVAnticipos.DataSource = ObjMovtos.DtResultados
End If
ObjMovtos.Dispose()
GVAnticipos.DataBind()
End Sub
Protected Sub LnkAutorizarAnticipo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
Dim CveCliente = GvRow.DataKey("CveCliente").ToEntero()
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
Using ObjVentas As New ClsVentas
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
Alert("El anticipo se autorizó correctamente")
Actualizo = True
End If
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then
Alert("El anticipo se autorizó correctamente")
Actualizo = True
End If
End If
End Using
If Actualizo Then
Dim ObjEventoBitacora As New ClsOIEventos
ObjEventoBitacora.AddEventoBitacora($"El anticipo se autorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1)
ObjEventoBitacora.Dispose()
End If
CargaDatos()
End If
UpDatos.Update()
End Sub
Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
Dim CveCliente = GvRow.DataKey("CveCliente").ToEntero()
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
Using ObjVentas As New ClsVentas
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
End If
End Using
If Actualizo Then
Dim ObjEventoBitacora As New ClsOIEventos
ObjEventoBitacora.AddEventoBitacora($"El anticipo se desautorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1)
ObjEventoBitacora.Dispose()
End If
CargaDatos()
End If
UpDatos.Update()
End Sub
Protected Sub GVAnticipos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAnticipos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim AnticipoAutorizado = CBool(e.Row.DBCampo("AnticipoAutorizado"))
If AnticipoAutorizado Then
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-success"
Else
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-danger"
End If
If e.Row.DataKey("CveIE").ToString().ToEntero() > 0 Then
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" href=""/Bancos/IE.aspx?CveIE={0}"">{1}</a>", e.Row.DataKey("CveIE"), e.Row.DataKey("Folio"))
Else
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a>", e.Row.DataKey("CveVenta"), e.Row.DataKey("Folio"))
End If
If UsuarioActual.TienePermisoProceso(379) Then
If e.Row.DBCampo("CveVenta").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant") Then
If Not AnticipoAutorizado Then
e.Row.FCLinkButton("LnkAutorizar").Visible = True
e.Row.FCLinkButton("LnkCancelar").Visible = False
Else
e.Row.FCLinkButton("LnkAutorizar").Visible = False
e.Row.FCLinkButton("LnkCancelar").Visible = True
End If
End If
If e.Row.DBCampo("CveIE").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString().Contiene("IxC") Then
If Not AnticipoAutorizado Then
e.Row.FCLinkButton("LnkAutorizar").Visible = True
e.Row.FCLinkButton("LnkCancelar").Visible = False
Else
e.Row.FCLinkButton("LnkAutorizar").Visible = False
e.Row.FCLinkButton("LnkCancelar").Visible = True
End If
End If
End If
End If
End Sub
End Class End Class

View File

@@ -10759,17 +10759,34 @@ Partial Class Clientes
Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero() Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
If CveVenta > 0 OrElse CveIE > 0 Then If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
Using ObjVentas As New ClsVentas Using ObjVentas As New ClsVentas
If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
Alert("El anticipo se autorizó correctamente") Alert("El anticipo se autorizó correctamente")
Actualizo = True
End If End If
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, True) Then
Alert("El anticipo se autorizó correctamente") Alert("El anticipo se autorizó correctamente")
Actualizo = True
End If End If
End If End If
End Using End Using
If Actualizo Then
Dim ObjEventoBitacora As New ClsOIEventos
If ObjEventoBitacora.AddEventoBitacora($"El anticipo se autorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1) Then
GvEB.DataSource = ObjEventoBitacora.DtResultados
End If
ObjEventoBitacora.Dispose()
GvEB.DataBind()
UPEventoBitacora.Update()
CargaEventoBitacora()
End If
End If End If
CargaAnticipos() CargaAnticipos()
@@ -10778,13 +10795,38 @@ Partial Class Clientes
Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs) Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero() Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
If CveVenta > 0 Then Dim CveIE As Integer = GvRow.DataKey("CveIE").ToEntero()
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
Using ObjVentas As New ClsVentas Using ObjVentas As New ClsVentas
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then If GvRow.DataKey("Tipo").Contiene("NC", "Ant") Then
Alert("El anticipo se desautorizó correctamente") If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
ElseIf GvRow.DataKey("Tipo").Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
End If End If
End Using End Using
CargaAnticipos() CargaAnticipos()
If Actualizo Then
Dim ObjEventoBitacora As New ClsOIEventos
If ObjEventoBitacora.AddEventoBitacora($"El anticipo se desautorizó correctamente. Folio: <b>{GvRow.DataKey("Folio")}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveCliente, -1, -1, -1, -1, -1) Then
GvEB.DataSource = ObjEventoBitacora.DtResultados
End If
ObjEventoBitacora.Dispose()
GvEB.DataBind()
UPEventoBitacora.Update()
CargaEventoBitacora()
End If
End If End If
End Sub End Sub
End Class End Class

View File

@@ -589,11 +589,11 @@ Partial Class Ventas_PVCobranza
Dim CveVentaRemision As Integer = -1 Dim CveVentaRemision As Integer = -1
Dim DbRowVenta As DataRow = Nothing Dim DbRowVenta As DataRow = Nothing
Dim ObjVentas As New ClsVentas Dim ObjVtaRemision As New ClsVentas
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then If ObjVtaRemision.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("") DbRowVenta = ObjVtaRemision.DtResultados.Copy().FiltroPrimero("")
End If End If
ObjVentas.Dispose() ObjVtaRemision.Dispose()
If DbRowVenta IsNot Nothing Then If DbRowVenta IsNot Nothing Then
Dim VentaActual As New Venta(UsuarioActual) Dim VentaActual As New Venta(UsuarioActual)
@@ -635,6 +635,7 @@ Partial Class Ventas_PVCobranza
Dim ObjIE As New ClsBancos(ObjVentas2.IniciaTransacSQL()) Dim ObjIE As New ClsBancos(ObjVentas2.IniciaTransacSQL())
Dim ObjConta As New ClsContabilidad(ObjVentas2.IniciaTransacSQL()) Dim ObjConta As New ClsContabilidad(ObjVentas2.IniciaTransacSQL())
Dim ObjClientes As New ClsClientes(ObjVentas2.IniciaTransacSQL()) Dim ObjClientes As New ClsClientes(ObjVentas2.IniciaTransacSQL())
Dim ObjOIEventos As New ClsOIEventos(ObjVentas2.IniciaTransacSQL())
Dim respFactura As Modelos.Factura.MMensajeFactura = Nothing Dim respFactura As Modelos.Factura.MMensajeFactura = Nothing
Dim respNC As Modelos.Factura.MMensajeFactura = Nothing Dim respNC As Modelos.Factura.MMensajeFactura = Nothing
@@ -661,6 +662,14 @@ Partial Class Ventas_PVCobranza
If respFactura.Factura.DtAnticiposAplicados IsNot Nothing Then If respFactura.Factura.DtAnticiposAplicados IsNot Nothing Then
PagoAplicado += respFactura.Factura.DtAnticiposAplicados.SUM("Importe") PagoAplicado += respFactura.Factura.DtAnticiposAplicados.SUM("Importe")
SaldoPendiente = SaldoPendiente - PagoAplicado SaldoPendiente = SaldoPendiente - PagoAplicado
For Each RowAnt As DataRow In respFactura.Factura.DtAnticiposAplicados.Rows
If Not ActualizaAnticipos(RowAnt("CveIE").ToString().ToEntero(), RowAnt("CveVenta").ToString().ToEntero(), RowAnt("Tipo").ToString(), RowAnt("Folio").ToString(), ObjVentas2, ObjOIEventos) Then
MsgError = "Ocurrió un error al actualizar los anticipos"
Exit For
End If
Next
End If End If
End If End If
@@ -683,6 +692,14 @@ Partial Class Ventas_PVCobranza
Else Else
PagoAplicado += respNC.Factura.Total PagoAplicado += respNC.Factura.Total
SaldoPendiente = SaldoPendiente - PagoAplicado SaldoPendiente = SaldoPendiente - PagoAplicado
For Each RowAnt As DataRow In respNC.Factura.DtAnticiposAplicados.Rows
If Not ActualizaAnticipos(RowAnt("CveIE").ToString().ToEntero(), RowAnt("CveVenta").ToString().ToEntero(), RowAnt("Tipo").ToString(), RowAnt("Folio").ToString(), ObjVentas2, ObjOIEventos) Then
MsgError = "Ocurrió un error al actualizar los anticipos"
Exit For
End If
Next
End If End If
Else Else
MsgError = "Ocurrió un error al generar la nota de crédito" MsgError = "Ocurrió un error al generar la nota de crédito"
@@ -885,6 +902,31 @@ Partial Class Ventas_PVCobranza
End Sub End Sub
Private Function ActualizaAnticipos(CveIE As Integer, CveVenta As Integer, Tipo As String, Folio As String, ByRef ObjVentas As ClsVentas, ByRef ObjEventoBitacora As ClsOIEventos) As Boolean
Dim Retorno As Boolean = True
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
If Tipo.Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
ElseIf Tipo.Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
Alert("El anticipo se desautorizó correctamente")
Actualizo = True
End If
End If
If Actualizo Then
Retorno = ObjEventoBitacora.AddEventoBitacora($"El anticipo se desautorizó correctamente. Folio: <b>{Folio}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveIE, -1, CveCliente, -1, -1, -1, -1, -1, CveVenta:=CveVenta)
End If
End If
Return Retorno
End Function
Private Sub LimpiarDatos() Private Sub LimpiarDatos()
PnlContado.Visible = False PnlContado.Visible = False
TxtImporteEfectivo.Text = "" TxtImporteEfectivo.Text = ""
@@ -1029,6 +1071,7 @@ Partial Class Ventas_PVCobranza
DtAnticipos.Columns.Add("Fecha", GetType(DateTime)) DtAnticipos.Columns.Add("Fecha", GetType(DateTime))
DtAnticipos.Columns.Add("TipoCambioPago", GetType(Decimal)) DtAnticipos.Columns.Add("TipoCambioPago", GetType(Decimal))
DtAnticipos.Columns.Add("Folio", GetType(String)) DtAnticipos.Columns.Add("Folio", GetType(String))
DtAnticipos.Columns.Add("Tipo", GetType(String))
For Each GvRow As GridViewRow In GVAnticipos.Rows For Each GvRow As GridViewRow In GVAnticipos.Rows
If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then
@@ -1045,8 +1088,9 @@ Partial Class Ventas_PVCobranza
Dim Fecha As DateTime = GvRow.DataKey("Fecha").ToDateTime() Dim Fecha As DateTime = GvRow.DataKey("Fecha").ToDateTime()
Dim TipoCambioPago As Decimal = GvRow.DataKey("TipoCambioPago").ToDecimal() Dim TipoCambioPago As Decimal = GvRow.DataKey("TipoCambioPago").ToDecimal()
Dim Folio = GvRow.DataKey("Folio") Dim Folio = GvRow.DataKey("Folio")
Dim Tipo = GvRow.DataKey("Tipo")
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio) DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio, Tipo)
End If End If
Next Next
@@ -1185,6 +1229,7 @@ Partial Class Ventas_PVCobranza
DtAnticipos.Columns.Add("Fecha", GetType(DateTime)) DtAnticipos.Columns.Add("Fecha", GetType(DateTime))
DtAnticipos.Columns.Add("TipoCambioPago", GetType(Decimal)) DtAnticipos.Columns.Add("TipoCambioPago", GetType(Decimal))
DtAnticipos.Columns.Add("Folio", GetType(String)) DtAnticipos.Columns.Add("Folio", GetType(String))
DtAnticipos.Columns.Add("Tipo", GetType(String))
For Each GvRow As GridViewRow In GVAnticipos.Rows For Each GvRow As GridViewRow In GVAnticipos.Rows
If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then
@@ -1201,8 +1246,10 @@ Partial Class Ventas_PVCobranza
Dim Fecha As DateTime = GvRow.DataKey("Fecha").ToDateTime() Dim Fecha As DateTime = GvRow.DataKey("Fecha").ToDateTime()
Dim TipoCambioPago As Decimal = GvRow.DataKey("TipoCambioPago").ToDecimal() Dim TipoCambioPago As Decimal = GvRow.DataKey("TipoCambioPago").ToDecimal()
Dim Folio = GvRow.DataKey("Folio") Dim Folio = GvRow.DataKey("Folio")
Dim Tipo = GvRow.DataKey("Tipo")
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio)
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda, Fecha, TipoCambioPago, Folio, Tipo)
End If End If
Next Next

View File

@@ -9006,13 +9006,16 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso Not UsuarioActual.Empresa.Funcionalidad(382) = "1" Then If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso Not UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
e.Row.FCLinkButton("LnkDescuentos").Visible = True e.Row.FCLinkButton("LnkDescuentos").Visible = True
If e.Row.DBCampo("TipoDocto") = "Cot" AndAlso CveVenta > 0 AndAlso Not EsCreaApartirDe Then If e.Row.DBCampo("TipoDocto").Contiene("Cot") AndAlso (CveVenta > 0 AndAlso Not EsCreaApartirDe) Then
e.Row.FCLinkButton("imgClone").Visible = False e.Row.FCLinkButton("imgClone").Visible = False
End If End If
End If End If
If UsuarioActual.CveEmpresa = 189 Then If UsuarioActual.CveEmpresa = 189 Then
e.Row.FCLinkButton("LnkExistencias").Visible = True e.Row.FCLinkButton("LnkExistencias").Visible = True
If e.Row.DBCampo("TipoDocto").Contiene("Cot", "Rem") AndAlso (CveVenta > 0 AndAlso Not EsCreaApartirDe) Then
e.Row.FCLinkButton("imgClone").Visible = False
End If
End If End If
If CveVenta <= 0 Then If CveVenta <= 0 Then
@@ -9224,12 +9227,17 @@ Partial Class Ventas
End If End If
End If End If
If RecalcularPromociones Then If RecalcularPromociones Then
ObjDescuento = CalcularDescuentos(CvePSNuevo, Cantidad, PU) ObjDescuento = CalcularDescuentos(CvePSNuevo, Cantidad, PU)
Dim RegenerarPU As Boolean = False
If ObjDescuento.EsPUModificado Then If ObjDescuento.EsPUModificado Then
PU = ObjDescuento.PU 'SI ES IMPORTE ASIGNADO ES MAYOR, RESPETAR EL ORIGINAL
If GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Enabled AndAlso (GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal() > ObjDescuento.PU) Then
PU = GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal()
Else
PU = ObjDescuento.PU
End If
End If End If
End If End If
@@ -9244,7 +9252,7 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
If Not ValidaAgregarPS(Cantidad, CvePSNuevo, DdlUM.SelectedValue.ToEntero(), PU, DrProducto("CveTipoPS").ToString().ToEntero(), DdlCla.SelectedValue.ToEntero(), DdlSubProyectoDatos.SelectedValue.ToEntero(), ObjDescuento, CantidadOriginal:=CantidadOriginal) Then If Not ValidaAgregarPS(Cantidad, CvePSNuevo, DdlUM.SelectedValue.ToEntero(), PU, DrProducto("CveTipoPS").ToString().ToEntero(), DdlCla.SelectedValue.ToEntero(), DdlSubProyectoDatos.SelectedValue.ToEntero(), ObjDescuento, CantidadOriginal:=CantidadOriginal, EsEdicion:=True) Then
Exit Sub Exit Sub
End If End If
@@ -19503,7 +19511,7 @@ Partial Class Ventas
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
AgregarPS() AgregarPS()
End Sub End Sub
Private Function ValidaAgregarPS(Cantidad As Decimal, CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer, CveClasificacion As Integer, CveSubProyecto As Integer, ObjDescuento As Modelos.VentaDescuentos, Optional CantidadModal As Decimal = 0D, Optional PSValidarModal As String = "", Optional CantidadOriginal As Decimal = 0D) As Boolean 'NO TOCAR - IPP Private Function ValidaAgregarPS(Cantidad As Decimal, CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer, CveClasificacion As Integer, CveSubProyecto As Integer, ObjDescuento As Modelos.VentaDescuentos, Optional CantidadModal As Decimal = 0D, Optional PSValidarModal As String = "", Optional CantidadOriginal As Decimal = 0D, Optional EsEdicion As Boolean = False) As Boolean 'NO TOCAR - IPP
'VALIDA PARAMETROS 'VALIDA PARAMETROS
If CvePS <= 0 Or CveUM <= 0 Then If CvePS <= 0 Or CveUM <= 0 Then
@@ -19590,17 +19598,34 @@ Partial Class Ventas
' Return False ' Return False
'End If 'End If
Dim ValidarMonedas As Boolean = False
'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS 'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS
If UsuarioActual.Empresa.Funcionalidad(524) <> "" Then If UsuarioActual.Empresa.Funcionalidad(524) <> "" Then
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count >= 1 Then ValidarMonedas = True
Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
If DrPS IsNot Nothing Then 'MODALIDAD EDICION
If DrPS("CveMoneda").ToString.ToEntero() <> DdlMoneda.SelectedValue.ToEntero() Then If EsEdicion Then
Alert("No puede agregar un producto de diferente moneda a la ya seleccionada", TipoMensaje.MsgAdvertencia) ValidarMonedas = False
Return False End If
'REFACTURACION
If NuevaFactura = 1 Then
ValidarMonedas = False
End If
If ValidarMonedas Then
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count >= 1 Then
Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
If DrPS IsNot Nothing Then
If DrPS("CveMoneda").ToString.ToEntero() <> DdlMoneda.SelectedValue.ToEntero() Then
Alert("No puede agregar un producto de diferente moneda a la ya seleccionada", TipoMensaje.MsgAdvertencia)
Return False
End If
End If End If
End If End If
End If End If
End If End If
' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR ' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR
@@ -23989,22 +24014,33 @@ Partial Class Ventas
GvPS.Columns(21).Visible = True GvPS.Columns(21).Visible = True
thOrden.Visible = True thOrden.Visible = True
If GvPS.Columns(21).Visible Then Dim HabilitarExistencias As Boolean = False
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
End If
If GvRow.RowType = DataControlRowType.DataRow Then If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
GvRow.FCTextBox("TxtOrden").Visible = True HabilitarExistencias = True
GvPS.Columns(20).Visible = True
If GvRow.FCTextBox("TxtOrden").ToEntero() <= 0 Then
GvRow.FCTextBox("TxtOrden").Text = GvRow.DataKey("Consec")
End If
End If
Next
End If End If
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
End If
If GvRow.RowType = DataControlRowType.DataRow Then
GvRow.FCTextBox("TxtOrden").Visible = True
If GvRow.FCTextBox("TxtOrden").ToEntero() <= 0 Then
GvRow.FCTextBox("TxtOrden").Text = GvRow.DataKey("Consec")
End If
End If
If HabilitarExistencias Then
GvRow.FCLinkButton("LnkExistencias").Visible = True
GvRow.FCLinkButton("imgClone").Visible = False
GvRow.FCLinkButton("LnkDescuentos").Visible = False
End If
Next
OrdenarPS(True) OrdenarPS(True)
UpCliente.Update() UpCliente.Update()
@@ -24121,7 +24157,8 @@ Partial Class Ventas
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(),
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero,
FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveCondicionEntrega:=DdlFormaEntrega.SelectedValue.ToEntero(), FolioRemision:=TxtFolioRemision.Text.Trim) Then FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveCondicionEntrega:=DdlFormaEntrega.SelectedValue.ToEntero(), FolioRemision:=TxtFolioRemision.Text.Trim,
CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
OcurrioError = True OcurrioError = True
End If End If
@@ -27069,7 +27106,7 @@ Partial Class Ventas
Dim CancelacionPagos = OpcionesCancelacionPagos.SinPagos Dim CancelacionPagos = OpcionesCancelacionPagos.SinPagos
If (UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1") AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("Ing", "Rem") AndAlso Not EsRefacturacion AndAlso ObjFacturaCancelacion.Pagado > 0 Then If (UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1") AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("Ing", "Rem", "Ant") AndAlso Not EsRefacturacion AndAlso ObjFacturaCancelacion.Pagado > 0 Then
CancelacionPagos = OpcionesCancelacionPagos.ConPagos_CancelarIE CancelacionPagos = OpcionesCancelacionPagos.ConPagos_CancelarIE
End If End If
@@ -33184,22 +33221,33 @@ Partial Class Ventas
GvPS.Columns(21).Visible = True GvPS.Columns(21).Visible = True
thOrden.Visible = True thOrden.Visible = True
If GvPS.Columns(21).Visible Then Dim HabilitarExistencias As Boolean = False
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
End If
If GvRow.RowType = DataControlRowType.DataRow Then If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
GvRow.FCTextBox("TxtOrden").Visible = True HabilitarExistencias = True
GvPS.Columns(20).Visible = True
If GvRow.FCTextBox("TxtOrden").ToEntero() <= 0 Then
GvRow.FCTextBox("TxtOrden").Text = GvRow.DataKey("Consec")
End If
End If
Next
End If End If
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
End If
If GvRow.RowType = DataControlRowType.DataRow Then
GvRow.FCTextBox("TxtOrden").Visible = True
If GvRow.FCTextBox("TxtOrden").ToEntero() <= 0 Then
GvRow.FCTextBox("TxtOrden").Text = GvRow.DataKey("Consec")
End If
End If
If HabilitarExistencias Then
GvRow.FCLinkButton("LnkExistencias").Visible = True
GvRow.FCLinkButton("imgClone").Visible = False
GvRow.FCLinkButton("LnkDescuentos").Visible = False
End If
Next
OrdenarPS(True) OrdenarPS(True)
UpPS.Update() UpPS.Update()
@@ -33324,7 +33372,8 @@ Partial Class Ventas
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim.ToUpper(), CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim.ToUpper(), CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(),
CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal,
TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then TipoDocto:=DdlTipoComprobante.SelectedValue, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(),
CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
MensajeError = "Ocurrió un error al actualizar la información de la cotización" MensajeError = "Ocurrió un error al actualizar la información de la cotización"
OcurrioError = True OcurrioError = True
End If End If
@@ -35322,7 +35371,7 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
If Not ObjVentas.UpdateFechaVencimientoVenta(CveVenta, TxtFechaPago.Text.ToDate) Then If Not ObjVentas.UpdateFechaVencimientoVenta(CveVenta, TxtFechaPago.Text.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorTrans = True ErrorTrans = True
End If End If
@@ -36833,7 +36882,7 @@ Partial Class Ventas
If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text, If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text,
TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim, TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim,
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text,
Episodio:=TxtEpisodio.Text) Then Episodio:=TxtEpisodio.Text, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
TieneError = True TieneError = True
End If End If
@@ -37750,7 +37799,7 @@ Partial Class Ventas
If CveVenta > 0 Then If CveVenta > 0 Then
Dim ObjVta As New ClsVentas Dim ObjVta As New ClsVentas
If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtTotal.Text.ToDecimal(), 0, UsuarioActual.CveUsuario, 1, TipoDocumento:="Ing", DiasVencidos:=25, CveVenta:=CveVenta) Then If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtTotal.Text.ToDecimal(), 0, UsuarioActual.CveUsuario, 1, TipoDocumento:=DdlTipoComprobante.SelectedValue, DiasVencidos:=25, CveVenta:=CveVenta) Then
RegistraScript("$('#DivModalSolicitarCredito').modal('hide')") RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion) Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
'signal 'signal
@@ -37765,33 +37814,36 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
Else
Dim DiasVencidos As Integer = 0
Dim CveEstatus As Integer = 0
Dim TipoDocto As String = DdlSolCreditoTipoDocto.SelectedValue
Dim CveTipoAutorizacion As Integer = DdlTipoAutorizacion.SelectedValue.ToEntero()
If UsuarioActual.Empresa.Funcionalidad(595) <> "3" AndAlso CveTipoAutorizacion <= 0 Then
Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If CveTipoAutorizacion = 2 Then
DiasVencidos = TxtDiasVencidos.Text.ToEntero()
End If
Dim Motivo As String = TxtMotivoAutorizacion.Text
Dim ObjPS As New ClsVentas
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlSolCreditoTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos, Motivo:=Motivo) Then
RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
'signal
Dim mensaje = "<br/> <a target='_blank' href='https://www.w3schools.com'>La autorización se agregó correctamente.</a>"
ClsSisNotificaciones.EnviarAlerta("Autorización Crédito", mensaje, "100", Tipo:=TipoNotificacion.ToastInformacionB)
End If
ObjPS.Dispose()
End If End If
Dim DiasVencidos As Integer = 0
Dim CveEstatus As Integer = 0
Dim TipoDocto As String = DdlSolCreditoTipoDocto.SelectedValue
Dim CveTipoAutorizacion As Integer = DdlTipoAutorizacion.SelectedValue.ToEntero()
If UsuarioActual.Empresa.Funcionalidad(595) <> "3" AndAlso CveTipoAutorizacion <= 0 Then
Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If CveTipoAutorizacion = 2 Then
DiasVencidos = TxtDiasVencidos.Text.ToEntero()
End If
Dim Motivo As String = TxtMotivoAutorizacion.Text
Dim ObjPS As New ClsVentas
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlSolCreditoTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos, Motivo:=Motivo) Then
RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
'signal
Dim mensaje = "<br/> <a target='_blank' href='https://www.w3schools.com'>La autorización se agregó correctamente.</a>"
ClsSisNotificaciones.EnviarAlerta("Autorización Crédito", mensaje, "100", Tipo:=TipoNotificacion.ToastInformacionB)
End If
ObjPS.Dispose()
UpModalSolicitud.Update() UpModalSolicitud.Update()
End Sub End Sub
Protected Sub DdlTipoAutorizacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoAutorizacion.SelectedIndexChanged Protected Sub DdlTipoAutorizacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoAutorizacion.SelectedIndexChanged