Cambios GlobalDTSubPoryecto
Cambio GlobalDTUsuario
This commit is contained in:
@@ -117,7 +117,13 @@
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4 bold text-primary">Folio</label>
|
||||
<asp:Label class="col-md-8" runat="server" ID="LbFolio" Text=""></asp:Label>
|
||||
<asp:Label class="col-md-2" runat="server" ID="LbFolio" Text=""></asp:Label>
|
||||
<div class="col-md-2">
|
||||
<asp:HyperLink runat="server" Text="" Target="_blank" id="HypRemision" CssClass="Texto"></asp:HyperLink>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label runat="server" ID="LblSaldo"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-1">
|
||||
|
||||
@@ -165,6 +165,16 @@ Partial Class RepContratoDetalle
|
||||
CveContratoEstatus = Contrato.Rows(0)("CveContratosEstatus").ToString.ToEntero
|
||||
DdlSubProyecto.SelectedValueExist(Contrato.Rows(0)("CveSubProyecto").ToString)
|
||||
|
||||
|
||||
HypRemision.Text = Contrato.Rows(0)("RemisionSerieFolio").ToString
|
||||
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={ Contrato.Rows(0)("CveVentaRemision").ToString}"
|
||||
|
||||
If Contrato.Rows(0)("RemisionSaldo").ToString.ToDecimal > 0 Then
|
||||
LblSaldo.Text = $"Saldo { Contrato.Rows(0)("RemisionSaldo").ToString.ToDecimal.ToString("###,###,###.00")}"
|
||||
Else
|
||||
LblSaldo.Text = ""
|
||||
End If
|
||||
|
||||
If Not IsDBNull(ObjContratos.Archivo) AndAlso ObjContratos.Archivo <> "" AndAlso ObjContratos.Archivo <> "-1" AndAlso ObjContratos.Archivo <> $"{ObjContratos.CveContrato}." Then
|
||||
ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "CONTRATOS", ObjContratos.Archivo)
|
||||
BtnDescargar.Visible = True
|
||||
|
||||
@@ -104,6 +104,9 @@ Partial Class ListadoContratos
|
||||
Dim Filename As String = ""
|
||||
Dim folderContratosPath As String = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos")
|
||||
|
||||
Dim CveVentaRemision As Integer = -1
|
||||
Dim SerieFolioRemision As String = ""
|
||||
|
||||
If Not Directory.Exists(folderContratosPath) Then
|
||||
Directory.CreateDirectory(folderContratosPath)
|
||||
End If
|
||||
@@ -163,6 +166,23 @@ Partial Class ListadoContratos
|
||||
End If
|
||||
Anexo.Text = ""
|
||||
|
||||
If ErrorProceso = False Then
|
||||
|
||||
Dim Respuesta As New RespuestaFacturacion()
|
||||
Dim CvePS As Integer = 907783
|
||||
Respuesta = GeneraRemision(CveContrato, LbFolio.Text, TxtImporte.Text.ToDecimal, CvePS, ObjContratos.IniciaTransacSQL)
|
||||
|
||||
If Respuesta.CveVenta > 0 Then
|
||||
CveVentaRemision = Respuesta.CveVenta
|
||||
SerieFolioRemision = Respuesta.SerieFolio
|
||||
ErrorProceso = False
|
||||
Else
|
||||
ErrorProceso = True
|
||||
Alert("se presento un error al generar la remisión", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
@@ -177,7 +197,7 @@ Partial Class ListadoContratos
|
||||
|
||||
If Not ErrorProceso Then
|
||||
ObjContratos.Commit()
|
||||
Alert("Agregado Correctamente.")
|
||||
Alert($"Agregado Correctamente.<br> Remisión Generada <a target='_blank' class='Texto' href='/Ventas/Ventas.aspx?CveVenta={CveVentaRemision}' ><b>{SerieFolioRemision}</b></a>")
|
||||
Else
|
||||
ObjContratos.RollBack()
|
||||
Alert("Se presento un error al guardar el contrato.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -287,4 +307,94 @@ Partial Class ListadoContratos
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "G E N E R A R E M I S O N"
|
||||
|
||||
|
||||
Private Function GeneraRemision(CveContrato As Integer, NumContrato As String, Importe As Decimal, CvePS As Integer, ByRef TransaccionSQL As SqlClient.SqlTransaction) As RespuestaFacturacion
|
||||
|
||||
Dim Respuesta As New RespuestaFacturacion()
|
||||
Dim CveRemisionGenerada As Integer = -1
|
||||
Dim ObjVentas As New ClsVentas(TransaccionSQL)
|
||||
Dim ProcesoOK As Boolean = True
|
||||
Dim CveSubProyecto As Integer = DdlSubProyectoModal.SelectedValue.ToEntero
|
||||
Dim CveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero
|
||||
|
||||
Dim ObjFactura As Modelos.Factura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyecto, DdlClientes.SelectedValue.ToEntero, CveMoneda, "Rem")
|
||||
|
||||
If ObjFactura IsNot Nothing AndAlso ProcesoOK Then
|
||||
|
||||
ObjFactura.CveContrato = CveContrato
|
||||
ObjFactura.Observaciones = NumContrato
|
||||
|
||||
Dim TmpDTMat As New DataTable
|
||||
TmpDTMat.Columns.Add("Consec", GetType(Integer))
|
||||
TmpDTMat.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDTMat.Columns.Add("CveUM", GetType(Integer))
|
||||
TmpDTMat.Columns.Add("Cantidad", GetType(Integer))
|
||||
TmpDTMat.Columns.Add("PU", GetType(Decimal))
|
||||
TmpDTMat.Columns.Add("Lote", GetType(String))
|
||||
TmpDTMat.Columns.Add("FechaCaducidad", GetType(Date))
|
||||
TmpDTMat.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||
|
||||
|
||||
Dim SubTotal As Decimal = (Importe / (1 + 0.16)).ToDecimal
|
||||
|
||||
'Dim CvePS As Integer = 907783
|
||||
Dim CantidadRegistro As Decimal = 1
|
||||
Dim PorcentajeIVA As Decimal = 0.16D
|
||||
|
||||
Dim PU As Decimal = SubTotal
|
||||
Dim Descuento As Decimal = 0
|
||||
Dim Obs As String = NumContrato
|
||||
|
||||
|
||||
If CantidadRegistro > 0 Then
|
||||
If ObjFactura.AgregarPS(CvePS, CantidadRegistro, PU, Descuento, Obs, CveSubProyecto:=CveSubProyecto, PorcentajeIVA:=PorcentajeIVA) Then
|
||||
Dim drp As DataRow = TmpDTMat.NewRow
|
||||
drp("CvePS") = CvePS
|
||||
drp("Cantidad") = CantidadRegistro
|
||||
drp("PU") = PU
|
||||
TmpDTMat.Rows.Add(drp)
|
||||
Else
|
||||
Alert("Error al agregar producto", TipoMensaje.MsgAdvertencia)
|
||||
ProcesoOK = False
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If ProcesoOK Then
|
||||
ObjFactura.CalculaTotales()
|
||||
Dim Resp As New Modelos.Factura.MMensajeFactura
|
||||
Resp = ObjFactura.EmitirFactura(False, Transac:=TransaccionSQL)
|
||||
|
||||
If Resp.CveVenta > 0 Then
|
||||
Respuesta.CveVenta = Resp.CveVenta
|
||||
Respuesta.SerieFolio = Resp.SerieFolio
|
||||
Respuesta.dtdetalle = TmpDTMat
|
||||
Else
|
||||
ProcesoOK = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
ProcesoOK = False
|
||||
End If
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
Friend Class RespuestaFacturacion
|
||||
Public Property CveVenta As Integer = -1
|
||||
Public Property SerieFolio As String = "-1"
|
||||
Public Property dtdetalle As DataTable = Nothing
|
||||
Public Sub New()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
@@ -207,8 +207,8 @@
|
||||
|
||||
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn miGrid"
|
||||
GridLines="None"
|
||||
data-sort="true" DataKeyNames="CveContrato, NumeroContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente, NombreComercial, CveTipoAF, Importe, ImporteMin, ImporteMax, Observaciones, CveAF, CveChofer, CveChofer2, CveContratosEstatus, CantidadPasajeros,CveMoneda,Moneda,CveSubProyecto">
|
||||
GridLines="None" data-sort="true"
|
||||
DataKeyNames="CveContrato,NumeroContrato,DescripcionContrato,Ubicacion,FechaInicial,FechaFinal,CveCliente,NombreComercial,CveTipoAF,Importe,ImporteMin,ImporteMax,Observaciones,CveAF,CveChofer,CveChofer2,CveContratosEstatus,CantidadPasajeros,CveMoneda,Moneda,CveSubProyecto,NumChoferes,CveVentaRemision,RemisionSerieFolio,RemisionSaldo,TipoEstatus">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Contrato">
|
||||
<ItemTemplate>
|
||||
@@ -336,9 +336,16 @@
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="row my-1">
|
||||
|
||||
<label class="col-md-4 bold text-primary">Folio:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtFolio" runat="server" Width="100%"></asp:TextBox>
|
||||
<div class="col-md-2">
|
||||
<asp:TextBox ID="TxtFolio" runat="server" Width="80px"></asp:TextBox>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:HyperLink runat="server" Text="" Target="_blank" id="HypRemision" CssClass="Texto"></asp:HyperLink>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label runat="server" ID="LblSaldo"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -421,7 +428,10 @@
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlTipoAF" DataValueField="CveTipoActivoFijo"
|
||||
DataTextField="TipoActivoFijo" Class="form-control input-inline"
|
||||
Width="100%" runat="server" Enabled="true">
|
||||
Width="100%" runat="server" Enabled="true"
|
||||
AutoPostBack="true"
|
||||
OnSelectedIndexChanged="DdlTipoAF_SelectedIndexChanged"
|
||||
>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
@@ -447,6 +457,13 @@
|
||||
</div>
|
||||
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4">Requiere Seguncdo Chofer</label>
|
||||
<div class="col-md-8" style="text-align:left!important">
|
||||
<asp:CheckBox runat="server" ID="chkSegundoChofer" AutoPostBack="true" OnCheckedChanged="chkSegundoChofer_CheckedChanged" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-1" runat="server" id="DVChofer2">
|
||||
<label class="col-md-4">Chofer 2</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlChofer2" AppendDataBoundItems="true" DataValueField="CvePersonal"
|
||||
@@ -506,7 +523,10 @@
|
||||
<asp:UpdatePanel ID="UpCommando" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button runat="server" ID="BtnModal" OnClick="MostrarModal"></asp:Button>
|
||||
<asp:HiddenField runat="server" ID="HdnCveContrato" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HdnCveContrato" Value="-1" ClientIDMode="Static" />
|
||||
|
||||
<asp:Button runat="server" ID="BtnDdlTipoAF" OnClick="BtnDdlTipoAF_Click" ClientIDMode="Static"></asp:Button>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
@@ -515,6 +535,18 @@
|
||||
|
||||
<asp:HiddenField runat="server" ID="HidCurrentMonth" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField runat="server" ID="HidCurrentYear" ClientIDMode="Static" Value="-1" />
|
||||
|
||||
|
||||
|
||||
<asp:HiddenField runat="server" ID="HidCveTipoAF" Value="-1" ClientIDMode="Static" />
|
||||
|
||||
<asp:HiddenField runat="server" ID="HidNumChoferes" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidRemisionSerieFolio" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidCveVentaRemision" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidRemisionSaldo" Value="-1" ClientIDMode="Static" />
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
|
||||
@@ -782,8 +814,18 @@
|
||||
$('#<%=DdlTipoAF.ClientID%>').val(event.CveTipoAF);
|
||||
$('#<%=DdlSubProyectoModal.ClientID%>').val(event.CveSubProyecto);
|
||||
|
||||
$('#<%= HidCveTipoAF.ClientID%>').val( $('#<%=DdlTipoAF.ClientID%>').val() );
|
||||
$('#<%=BtnDdlTipoAF.ClientID%>').click();
|
||||
|
||||
// alert(event.Moneda);
|
||||
$('#HidNumChoferes').val(event.NumChoferes);
|
||||
|
||||
$('#HidRemisionSerieFolio').val(event.RemisionSerieFolio);
|
||||
$('#HidCveVentaRemision').val(event.CveVentaRemision);
|
||||
$('#HidRemisionSaldo').val(event.RemisionSaldo);
|
||||
|
||||
<%-- $('#HidRemision').text(event.RemisionSerieFolio);
|
||||
$('#HypRemision').attr('href', '/Ventas/Ventas.aspx?CveVenta=' + event.CveVentaRemision);
|
||||
$('#LblSaldo').text(event.RemisionSaldo.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }));--%>
|
||||
|
||||
|
||||
if (event.NombreComercial !== null) {
|
||||
@@ -793,7 +835,9 @@
|
||||
}
|
||||
|
||||
$('#HidModCveCliente').val(event.CveCliente);
|
||||
|
||||
$('#<%=BtnModal.ClientID%>').click();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -941,6 +985,14 @@
|
||||
editable: true,
|
||||
minTime: "00:00:00",
|
||||
maxTime: "24:00:00",
|
||||
eventOverlap: false, // No permitir la superposición de eventos
|
||||
slotEventOverlap: false, // No permitir la superposición en vistas de agenda
|
||||
eventRender: function (event, element) {
|
||||
element.css({
|
||||
'margin-bottom': '1px', // Ajusta el valor según sea necesario
|
||||
'margin-left': '1px' // Ajusta el valor según sea necesario
|
||||
});
|
||||
},
|
||||
events: {
|
||||
url: '/Ashx/CargaEventos.ashx',
|
||||
type: 'GET',
|
||||
|
||||
@@ -202,30 +202,35 @@ Partial Class RepContratosCalendario
|
||||
End Sub
|
||||
|
||||
Private Sub OnRowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvContratos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim BackgroundColor As String = DataBinder.Eval(e.Row.DataItem, "BackgroundColor").ToString()
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Dim BackgroundColor As String = DataBinder.Eval(e.Row.DataItem, "BackgroundColor").ToString()
|
||||
e.Row.BackColor = Drawing.ColorTranslator.FromHtml(BackgroundColor)
|
||||
e.Row.Cells(1).Attributes.Add("data-order", e.Row.DBCampo("FechaInicial").ToDate.Ticks.ToString)
|
||||
|
||||
Dim BGC_Atencion As String = "#bc9b1b"
|
||||
Dim TipoEstatus As Integer = e.Row.DataKey("TipoEstatus").ToEntero
|
||||
|
||||
If TipoEstatus <> 4 AndAlso TipoEstatus <> 3 Then
|
||||
If e.Row.DataKey("CveChofer").ToEntero <= 0 Or (e.Row.DataKey("CveChofer2").ToEntero <= 0 And e.Row.DataKey("NumChoferes").ToEntero = 2) Or e.Row.DataKey("CveAF").ToEntero <= 0 Then
|
||||
e.Row.BackColor = Drawing.ColorTranslator.FromHtml(BGC_Atencion)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub MostrarModal(sender As Object, e As System.EventArgs)
|
||||
|
||||
|
||||
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
||||
|
||||
If HidModClienteNombre.Value = "" Then
|
||||
HidModClienteNombre.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, HidModCveCliente.Value.ToEntero).FiltroPrimeroValor("NombreComercial")
|
||||
Dim NumChoferes As Integer = If(chkSegundoChofer.Checked, 2, 1)
|
||||
|
||||
If NumChoferes = 2 AndAlso DdlChofer2.SelectedValue.ToEntero <= 0 Then
|
||||
Alert("Debe de seleccionar un segundo chofer.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
DdlClientes.SelectedText = HidModClienteNombre.Value
|
||||
DdlClientes.SelectedValue = HidModCveCliente.Value
|
||||
|
||||
DdlClientes.txtText.Value = HidModClienteNombre.Value
|
||||
DdlClientes.txtValue.Value = HidModCveCliente.Value
|
||||
|
||||
UpModal.Update()
|
||||
|
||||
RegistraScript("$('#ModalActualizar').modal('show');")
|
||||
End Sub
|
||||
|
||||
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
||||
Dim ObjContratos As New ClsContratos
|
||||
|
||||
Dim DTAgendadados As New DataTable
|
||||
@@ -250,8 +255,12 @@ Partial Class RepContratosCalendario
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
If ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", DdlSubProyectoModal.SelectedValue.ToEntero,
|
||||
-1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34, CveContratosEstatus:=DdlEstatusContrato.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text.Trim) Then
|
||||
-1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34,
|
||||
CveContratosEstatus:=DdlEstatusContrato.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero,
|
||||
CveAF:=DdlAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text.Trim, NumChoferes:=NumChoferes) Then
|
||||
RegistraScript("$('#ModalActualizar').modal('hide');")
|
||||
Alert("Actualizado Correctamente.")
|
||||
End If
|
||||
@@ -263,8 +272,11 @@ Partial Class RepContratosCalendario
|
||||
InicializaCalendar()
|
||||
|
||||
End Sub
|
||||
Protected Sub UpdateModal(sender As Object, e As EventArgs)
|
||||
Protected Sub UpdateModal(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim NumChoferes As Integer = GvRow.DataKey("NumChoferes").ToEntero
|
||||
|
||||
TxtFolio.Text = GvRow.DataKey("NumeroContrato")
|
||||
TxtCantidadPasajeros.Text = GvRow.DataKey("CantidadPasajeros")
|
||||
DdlClientes.SelectedValue = GvRow.DataKey("CveCliente")
|
||||
@@ -274,18 +286,142 @@ Partial Class RepContratosCalendario
|
||||
TxtUbicacion.Text = GvRow.DataKey("Ubicacion")
|
||||
TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy HH:mm:ss")
|
||||
TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy HH:mm:ss ")
|
||||
TxtMoneda.Text = GvRow.DataKey("Moneda")
|
||||
'Requeridos
|
||||
DdlAF.SelectedValueExist(GvRow.DataKey("CveAF"))
|
||||
TxtMoneda.Text = GvRow.DataKey("Moneda")
|
||||
'Requeridos
|
||||
|
||||
DdlChofer.SelectedValueExist(GvRow.DataKey("CveChofer"))
|
||||
DdlChofer2.SelectedValueExist(GvRow.DataKey("CveChofer2"))
|
||||
DdlChofer2.SelectedValueExist(GvRow.DataKey("CveChofer2"))
|
||||
|
||||
|
||||
chkSegundoChofer.Checked = If(NumChoferes = 2, True, False)
|
||||
|
||||
DdlEstatusContrato.SelectedValueExist(GvRow.DataKey("CveContratosEstatus"))
|
||||
DdlSubProyectoModal.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
|
||||
DdlSubProyectoModal.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
|
||||
|
||||
DdlTipoAF.SelectedValueExist(GvRow.DataKey("CveTipoAF"))
|
||||
DdlTipoAF_SelectedIndexChanged(Nothing, Nothing)
|
||||
|
||||
DdlAF.SelectedValueExist(GvRow.DataKey("CveAF"))
|
||||
|
||||
|
||||
|
||||
HypRemision.Text = GvRow.DataKey("RemisionSerieFolio")
|
||||
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={GvRow.DataKey("CveVentaRemision")}"
|
||||
|
||||
If GvRow.DataKey("RemisionSaldo").ToDecimal > 0 Then
|
||||
LblSaldo.Text = $"Saldo {GvRow.DataKey("RemisionSaldo").ToDecimal.ToString("###,###,###.00")}"
|
||||
Else
|
||||
LblSaldo.Text = ""
|
||||
End If
|
||||
|
||||
|
||||
|
||||
CveContrato = GvRow.DataKey("CveContrato").ToEntero
|
||||
OcultarMostrarSegundoChofer()
|
||||
|
||||
UpCommando.Update()
|
||||
UpModal.Update()
|
||||
RegistraScript("$('#ModalActualizar').modal('show');")
|
||||
End Sub
|
||||
|
||||
Protected Sub MostrarModal(sender As Object, e As System.EventArgs)
|
||||
|
||||
If HidModClienteNombre.Value = "" Then
|
||||
HidModClienteNombre.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, HidModCveCliente.Value.ToEntero).FiltroPrimeroValor("NombreComercial")
|
||||
End If
|
||||
|
||||
DdlClientes.SelectedText = HidModClienteNombre.Value
|
||||
DdlClientes.SelectedValue = HidModCveCliente.Value
|
||||
|
||||
DdlClientes.txtText.Value = HidModClienteNombre.Value
|
||||
DdlClientes.txtValue.Value = HidModCveCliente.Value
|
||||
|
||||
chkSegundoChofer.Checked = If(HidNumChoferes.Value.ToEntero = 2, True, False)
|
||||
|
||||
OcultarMostrarSegundoChofer()
|
||||
|
||||
|
||||
|
||||
HypRemision.Text = HidRemisionSerieFolio.Value
|
||||
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={HidCveVentaRemision.Value}"
|
||||
If HidRemisionSaldo.Value.ToDecimal > 0 Then
|
||||
LblSaldo.Text = $"Saldo {HidRemisionSaldo.Value.ToDecimal.ToString("###,###,###.00")}"
|
||||
Else
|
||||
LblSaldo.Text = ""
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
UpModal.Update()
|
||||
|
||||
RegistraScript("$('#ModalActualizar').modal('show');")
|
||||
End Sub
|
||||
|
||||
Protected Sub chkSegundoChofer_CheckedChanged(sender As Object, e As EventArgs)
|
||||
OcultarMostrarSegundoChofer()
|
||||
End Sub
|
||||
|
||||
Private Sub OcultarMostrarSegundoChofer()
|
||||
|
||||
If chkSegundoChofer.Checked Then
|
||||
DVChofer2.Attributes.Add("style", "display:block")
|
||||
Else
|
||||
DVChofer2.Attributes.Add("style", "display:none")
|
||||
End If
|
||||
|
||||
|
||||
UpCommando.Update()
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlTipoAF_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaAFDdl(DdlTipoAF.SelectedValue.ToEntero)
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnDdlTipoAF_Click(sender As Object, e As EventArgs)
|
||||
|
||||
CargaAFDdl(HidCveTipoAF.Value.ToEntero)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaAFDdl(CveTipoAF As Integer)
|
||||
'Lista de Activos fijos
|
||||
|
||||
DdlAF.ClearSelection()
|
||||
DdlAF.SelectedValue = Nothing
|
||||
DdlAF.Items.Clear()
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
|
||||
|
||||
If ObjContratos.GetContratosValUnidadesAgendadas(DdlAF.SelectedValue.ToEntero, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, UsuarioActual.CveEmpresa, CveContrato, 2) Then
|
||||
|
||||
If CveTipoAF > 0 Then
|
||||
DdlAF.DataSource = ObjContratos.DtResultados.FiltraParametros($" CveTipoActivoFijo = {CveTipoAF} ")
|
||||
Else
|
||||
DdlAF.DataSource = ObjContratos.DtResultados
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
|
||||
'If CveTipoAF > 0 Then
|
||||
' DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros($" EstadoActivoFijo= 'Activo' AND CveTipoActivoFijo = {CveTipoAF} ")
|
||||
'Else
|
||||
' DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros($" EstadoActivoFijo= 'Activo' ")
|
||||
'End If
|
||||
|
||||
DdlAF.DataBind()
|
||||
DdlAF.Items.Insert(0, New ListItem("-", "-1"))
|
||||
|
||||
|
||||
|
||||
UpModal.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
||||
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
|
||||
End Sub
|
||||
@@ -325,4 +461,10 @@ Partial Class RepContratosCalendario
|
||||
Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaCronograma(DdlTipoVista.SelectedValue.ToEntero)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user