-- activación de cancelación de venta/remisión al cancelar el viaje! y si tiene pago se genera el ixc
This commit is contained in:
@@ -4334,7 +4334,7 @@ Namespace Modelos
|
||||
Next
|
||||
End If
|
||||
|
||||
If ObjConta.ValidacionesPrePoliza(ObjFactura.CvePrePoliza, UsuarioActual, Opcion:=2) Then
|
||||
If Not ErrorPrepoliza AndAlso ObjConta.ValidacionesPrePoliza(ObjFactura.CvePrePoliza, UsuarioActual, Opcion:=2) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||
ErrorList.Add(ObjConta.MensajePolizaDescuadre)
|
||||
@@ -5805,7 +5805,7 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
'CUANDO SE CANCELA, Y TIENE RELACIONADA UNA REMISIÓN, Y ESTA NO SE CANCELARÁ. DEBE DE HACER EN AUTOMÁTICO LOS MOVIMIENTOS AL ALMACEN DE ENTREGA POR ADELANTADO
|
||||
Dim RevivirRemisiones As Boolean = Not EsRefacturacion AndAlso ((TieneRemisionesRelacionadas AndAlso ListaRemisionesCancelar Is Nothing) OrElse (DtRemisionesRelacionadas.Rows.Count > ListaRemisionesCancelar.Count))
|
||||
Dim RevivirRemisiones As Boolean = Not EsRefacturacion AndAlso ((TieneRemisionesRelacionadas AndAlso ListaRemisionesCancelar Is Nothing) OrElse (ListaRemisionesCancelar IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > ListaRemisionesCancelar.Count))
|
||||
|
||||
'REMISION YA SE DEBE HACER POR EL PROCESO DE DEVOLUCION DE ALMACEN
|
||||
If Not EsRefacturacion AndAlso (ObjFactura.SaldoAlmacen <> 0 AndAlso ObjFactura.EsDevolucionVenta.Contiene(0, 1)) AndAlso Not (RealizarDevolucionAlmacen.Contiene(1, 2)) And RevivirRemisiones = False Then
|
||||
|
||||
@@ -624,24 +624,24 @@ Partial Class RepContratoDetalle
|
||||
End If
|
||||
End If
|
||||
|
||||
'If Not ErrorProceso AndAlso Not CveVentaRemision > 0 AndAlso ChkEsPresupuestal.Checked = False Then
|
||||
' 'CveVentaRemision
|
||||
' Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{TxtFolio.Text}"
|
||||
If Not ErrorProceso AndAlso Not CveVentaRemision > 0 AndAlso ChkEsPresupuestal.Checked = False Then
|
||||
'CveVentaRemision
|
||||
Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{TxtFolio.Text}"
|
||||
|
||||
' Dim Respuesta As New RespuestaFacturacion()
|
||||
' Dim CvePS As Integer = 907784
|
||||
' Respuesta = GeneraRemision(CveContrato, ObsRemisionPartida, TxtImporte.Text.ToDecimal, CvePS, ObjContratos.IniciaTransacSQL, DdlSubProyecto.SelectedValue.ToEntero)
|
||||
Dim Respuesta As New RespuestaFacturacion()
|
||||
Dim CvePS As Integer = 907784
|
||||
Respuesta = GeneraRemision(CveContrato, ObsRemisionPartida, TxtImporte.Text.ToDecimal, CvePS, ObjContratos.IniciaTransacSQL, DdlSubProyecto.SelectedValue.ToEntero)
|
||||
|
||||
' If Respuesta.CveVenta > 0 Then
|
||||
' CveVentaRemision = Respuesta.CveVenta
|
||||
' SerieFolioRemision = Respuesta.SerieFolio
|
||||
' ErrorProceso = False
|
||||
' SeGeneroRemision = True
|
||||
' Else
|
||||
' ErrorProceso = True
|
||||
' Alert("se presento un error al generar la remisión", TipoMensaje.MsgAdvertencia)
|
||||
' End If
|
||||
'End If
|
||||
If Respuesta.CveVenta > 0 Then
|
||||
CveVentaRemision = Respuesta.CveVenta
|
||||
SerieFolioRemision = Respuesta.SerieFolio
|
||||
ErrorProceso = False
|
||||
SeGeneroRemision = True
|
||||
Else
|
||||
ErrorProceso = True
|
||||
Alert("se presento un error al generar la remisión", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ErrorProceso Then
|
||||
ObjContratos.Commit()
|
||||
|
||||
@@ -165,22 +165,17 @@ Partial Class ListadoContratos
|
||||
Dim tempArray() As String
|
||||
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
||||
Dim fDestino = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", $"{CveContrato.ToString}.{ FileExtension}")
|
||||
|
||||
Try
|
||||
If File.Exists(fDestino) Then
|
||||
File.Delete(fDestino)
|
||||
End If
|
||||
|
||||
File.Move(fileItem.FileUrl, fDestino)
|
||||
|
||||
If Not File.Exists(fDestino) Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
If ObjContratos.UpdateContratoArchivo(CveContrato, $"{CveContrato.ToString}.{ FileExtension}", UsuarioActual.CveEmpresa) Then
|
||||
ErrorProceso = False
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
ErrorProceso = True
|
||||
End Try
|
||||
@@ -222,7 +217,6 @@ Partial Class ListadoContratos
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Not ErrorProceso Then
|
||||
ObjContratos.Commit()
|
||||
|
||||
@@ -323,7 +317,6 @@ Partial Class ListadoContratos
|
||||
If Not Directory.Exists(folderContratosPath) Then
|
||||
Directory.CreateDirectory(folderContratosPath)
|
||||
End If
|
||||
|
||||
If Not Directory.Exists(Path.Combine(folderContratosPath, "Temp")) Then
|
||||
Directory.CreateDirectory(Path.Combine(folderContratosPath, "Temp"))
|
||||
End If
|
||||
@@ -334,26 +327,20 @@ Partial Class ListadoContratos
|
||||
Session("FileExtension") = FileExtension
|
||||
Dim tempArray() As String
|
||||
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
||||
|
||||
|
||||
ViewState("extencion") = FileExtension
|
||||
ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", "Temp", fileItem.filename)
|
||||
|
||||
File.Move(fileItem.FileUrl, ViewState("FUrl").ToString)
|
||||
LbArchivo.Text = tempArray(1)
|
||||
|
||||
Next
|
||||
|
||||
UpModal.Update()
|
||||
RegistraScript("$('#ModalUpload').modal('hide')", "hidemodal1")
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "G E N E R A R E M I S O N"
|
||||
|
||||
|
||||
Private Function GeneraRemision(CveContrato As Integer, ObsPartida As String, Importe As Decimal, CvePS As Integer, ByRef TransaccionSQL As SqlClient.SqlTransaction) As RespuestaFacturacion
|
||||
|
||||
Dim Respuesta As New RespuestaFacturacion()
|
||||
@@ -366,7 +353,6 @@ Partial Class ListadoContratos
|
||||
Dim ObjFactura As Modelos.Factura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyecto, DdlClientes.SelectedValue.ToEntero, CveMoneda, "Rem")
|
||||
|
||||
If ObjFactura IsNot Nothing AndAlso ProcesoOK Then
|
||||
|
||||
ObjFactura.CveMoneda = CveMoneda
|
||||
ObjFactura.CveContrato = CveContrato
|
||||
ObjFactura.Observaciones = ObsPartida
|
||||
@@ -433,8 +419,6 @@ Partial Class ListadoContratos
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub LnkAgregarContrato_Click(sender As Object, e As EventArgs)
|
||||
@@ -442,7 +426,4 @@ Partial Class ListadoContratos
|
||||
RegistraScript("$('#ModalAgregar').modal({ backdrop: 'static', keyboard: false });")
|
||||
UpTitulos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -731,23 +731,23 @@
|
||||
<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="HdnCveVentaRemision" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HdnNumContrato" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidModClienteNombre" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidModCveCliente" ClientIDMode="Static" />
|
||||
<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="HidRemisionSaldo" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidCveAF" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidCveAFDes" Value="-1" ClientIDMode="Static" />
|
||||
<%--<asp:Button runat="server" ID="BtnDdlTipoAF" OnClick="BtnDdlTipoAF_Click" ClientIDMode="Static"></asp:Button>--%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<asp:HiddenField runat="server" ID="HdnNumContrato" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidModClienteNombre" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidModCveCliente" ClientIDMode="Static" />
|
||||
<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:HiddenField runat="server" ID="HidCveAF" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidCveAFDes" Value="-1" ClientIDMode="Static" />
|
||||
|
||||
<div style="display:none!important">
|
||||
<asp:UpdatePanel runat="server" ID="UPCargaCalendario">
|
||||
<ContentTemplate>
|
||||
@@ -1236,11 +1236,7 @@
|
||||
setTimeout(() => {
|
||||
// dateAxis.zoomToDates(new Date(anioI, mesI, diaI), new Date(anioF, mesF, diaF));
|
||||
}, 1500);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var PrimeraCargaCalendario = true;
|
||||
var currentUpdateEvent;
|
||||
@@ -1257,20 +1253,15 @@
|
||||
let anio = parseInt($('#<%=HidCurrentYear.ClientID%>').val());
|
||||
|
||||
Calendario(mes, anio);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function selectDate(start, end, allDay) {
|
||||
}
|
||||
|
||||
function updateEvent(event, element, esCalendario = true) {
|
||||
|
||||
|
||||
function updateEvent(event, element, esCalendario = true) {
|
||||
$('#<%=HdnCveContrato.ClientID%>').val(event.id);
|
||||
$('#BtnCargaContratoCalendario').click();
|
||||
|
||||
|
||||
$('#BtnCargaContratoCalendario').click();
|
||||
}
|
||||
|
||||
function formatearFechaISO(fechaISO) {
|
||||
|
||||
@@ -5,6 +5,7 @@ Imports ADSNetLibrary.SIGAPI.Helpers
|
||||
Imports Extensiones.ModExtensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports Modelos
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Partial Class RepContratosCalendario
|
||||
@@ -301,19 +302,13 @@ Partial Class RepContratosCalendario
|
||||
Dim CvePadre As Integer = -1
|
||||
|
||||
For Each dRowUnidad As DataRow In DtUnidades.Rows
|
||||
|
||||
|
||||
Dim CveActivoFijo As Integer = dRowUnidad("CveActivoFijo").ToString.ToEntero
|
||||
Dim CodigoAF As String = dRowUnidad("Codigo").ToString
|
||||
'Dim unidad As String = $"{dRowUnidad("Codigo").ToString}-{dRowUnidad("Descripcion").tostring}"
|
||||
|
||||
Dim SeEncontro As Boolean = False
|
||||
|
||||
Dim EsHijo As Boolean = False
|
||||
For Each Row As DataRow In DtAvance.FiltraParametros("CodigoAF <> '' AND TipoEstatus <> 3").Rows
|
||||
|
||||
Dim CveActivoFijoContrato As Integer = Row("CveAF").ToString.ToEntero
|
||||
|
||||
'If CveActivoFijo = CveActivoFijoContrato Then
|
||||
' str.AppendLine(String.Format("{0}", separator))
|
||||
' SeEncontro = True
|
||||
@@ -325,9 +320,6 @@ Partial Class RepContratosCalendario
|
||||
' separator = ","
|
||||
' encontrados = encontrados + 1
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
If CveActivoFijo = CveActivoFijoContrato Then
|
||||
str.AppendLine(String.Format("{0}", separator))
|
||||
SeEncontro = True
|
||||
@@ -343,18 +335,15 @@ Partial Class RepContratosCalendario
|
||||
separator, Row("CveContrato").ToString, Row("NumeroContrato").ToString().Replace("\\", "\\\\").Replace("""", "\"""), Row("FechaInicial"), Row("FechaFinal"), 0, 100, unidad, duracion, ColorAleatorio(randomNumber), Row("CodigoAF").ToString, Row("CveContrato").ToString)
|
||||
)
|
||||
End If
|
||||
|
||||
If Not EsHijo Then
|
||||
CvePadre = Row("CveContrato").ToString.ToEntero
|
||||
EsHijo = True
|
||||
End If
|
||||
|
||||
separator = ","
|
||||
encontrados = encontrados + 1
|
||||
Else
|
||||
EsHijo = False
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If Not SeEncontro Then
|
||||
@@ -365,18 +354,11 @@ Partial Class RepContratosCalendario
|
||||
str.AppendLine(String.Format("{{id: {1}, text: ""{2}"", start_date: ""{3}"", end_date: ""{4}"", parent: {5}, progress:{6}, open: true, unidad: ""{7}"",duracion: ""{8}"", color: ""{9}"",codigoaf: ""{10}"", hidden: true}} ",
|
||||
"", CveActivoFijo, -1, txtFechaF.Text.ToDate.ToString("yyyy/MM/dd HH:mm"), txtFechaF.Text.ToDate.ToString("yyyy/MM/dd HH:mm"), 0, 100, "", "", ColorAleatorio(randomNumber), CodigoAF))
|
||||
separator = ","
|
||||
|
||||
End If
|
||||
|
||||
'str.AppendLine(String.Format("}"))
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
str.AppendLine("];loadGant();")
|
||||
RegistraScript(str.ToString())
|
||||
|
||||
@@ -389,7 +371,6 @@ Partial Class RepContratosCalendario
|
||||
Private Function ColorAleatorio(randomNumber As Random) As String
|
||||
|
||||
Dim listaColores As New List(Of String)
|
||||
|
||||
listaColores.Add("#94f35a")
|
||||
listaColores.Add("#1989a9")
|
||||
listaColores.Add("#5a3c98")
|
||||
@@ -436,10 +417,7 @@ Partial Class RepContratosCalendario
|
||||
listaColores.Add("#058106")
|
||||
listaColores.Add("#0485f2")
|
||||
listaColores.Add("#401685")
|
||||
|
||||
|
||||
Dim ranNumber As Integer = randomNumber.Next(0, listaColores.Count - 1)
|
||||
|
||||
Return listaColores(ranNumber)
|
||||
|
||||
End Function
|
||||
@@ -591,8 +569,6 @@ Partial Class RepContratosCalendario
|
||||
|
||||
DdlTipoAF.SelectedValueExist(DRow("CveTipoAF").ToString)
|
||||
DdlTipoAF_SelectedIndexChanged(Nothing, Nothing)
|
||||
|
||||
|
||||
If DRow("CveAF").ToString.ToEntero > 0 Then
|
||||
Dim ExisteItem As Boolean = False
|
||||
For Each item As ListItem In DdlAF.Items
|
||||
@@ -607,10 +583,7 @@ Partial Class RepContratosCalendario
|
||||
DdlAF.Items.Add(New ListItem(TmpItemText, $"{DRow("CveAF").ToString}"))
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
DdlAF.SelectedValueExist(DRow("CveAF").ToString)
|
||||
|
||||
HidCveAF.Value = "-1"
|
||||
HidCveAFDes.Value = ""
|
||||
If DRow("CveAF").ToString.ToEntero > 0 Then
|
||||
@@ -619,10 +592,9 @@ Partial Class RepContratosCalendario
|
||||
End If
|
||||
TxtMotivoCambioUnidad.Text = ""
|
||||
DVMotivoCambioAF.Visible = False
|
||||
|
||||
|
||||
HypRemision.Text = DRow("RemisionSerieFolio").ToString
|
||||
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={DRow("CveVentaRemision").ToString}"
|
||||
HdnCveVentaRemision.Value = DRow("CveVentaRemision").ToString
|
||||
|
||||
If DRow("RemisionSaldo").ToString.ToDecimal > 0 Then
|
||||
LblSaldo.Text = $"Saldo {DRow("RemisionSaldo").ToString.ToDecimal.ToString("###,###,###.00")}"
|
||||
@@ -642,15 +614,8 @@ Partial Class RepContratosCalendario
|
||||
Else
|
||||
Alert("Contrato no especificado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
||||
Dim TieneError As Boolean = False
|
||||
Dim NumChoferes As Integer = If(chkSegundoChofer.Checked, 2, 1)
|
||||
@@ -662,6 +627,7 @@ Partial Class RepContratosCalendario
|
||||
|
||||
Dim ObjContratos As New ClsContratos
|
||||
Dim objGenerales As New ClsGenerales(ObjContratos.IniciaTransacSQL())
|
||||
Dim ObjVentas As New ClsVentas(ObjContratos.IniciaTransacSQL())
|
||||
Dim DTAgendadados As New DataTable
|
||||
If ObjContratos.GetContratosValUnidadesAgendadas(DdlAF.SelectedValue.ToEntero, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, UsuarioActual.CveEmpresa, CveContrato) Then
|
||||
|
||||
@@ -691,8 +657,22 @@ Partial Class RepContratosCalendario
|
||||
-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.")
|
||||
|
||||
'cancelar la venta.
|
||||
If DdlEstatusContrato.SelectedValue = "52" Then 'cancelación de Fact/Rem
|
||||
Dim CancelacionPagos = OpcionesCancelacionPagos.ConPagos_GenerarIxC
|
||||
Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing
|
||||
Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, HdnCveVentaRemision.Value.ToEntero, UsuarioActual.CveEmpresa, EsCancelacion:=True, VerificaAlmacen:=True)
|
||||
If ObjFacturaCancelacion IsNot Nothing AndAlso ObjFacturaCancelacion.CveVenta > 0 Then
|
||||
resp = ObjFacturaCancelacion.CancelarFactura(0, CancelacionPagos:=CancelacionPagos, ValidarSAT:=False)
|
||||
If resp.HuboError Then
|
||||
TieneError = True
|
||||
Else
|
||||
RegistraScript("$('#ModalActualizar').modal('hide');")
|
||||
Alert("Actualizado Correctamente.")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
@@ -702,10 +682,9 @@ Partial Class RepContratosCalendario
|
||||
Else
|
||||
ObjContratos.Commit()
|
||||
End If
|
||||
|
||||
ObjContratos.Dispose()
|
||||
objGenerales.Dispose()
|
||||
|
||||
ObjVentas.Dispose()
|
||||
UpTitulos.Update()
|
||||
CargaDatos()
|
||||
InicializaCalendar()
|
||||
@@ -726,20 +705,17 @@ Partial Class RepContratosCalendario
|
||||
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")
|
||||
|
||||
TxtAnticipo.Text = GvRow.DataKey("ImporteMin")
|
||||
TxtDolares.Text = GvRow.DataKey("Importe")
|
||||
'Requeridos
|
||||
|
||||
DdlChofer.SelectedValueExist(GvRow.DataKey("CveChofer"))
|
||||
DdlChofer2.SelectedValueExist(GvRow.DataKey("CveChofer2"))
|
||||
chkSegundoChofer.Checked = If(NumChoferes = 2, True, False)
|
||||
|
||||
DdlEstatusContrato.SelectedValueExist(GvRow.DataKey("CveContratosEstatus"))
|
||||
DdlSubProyectoModal.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
|
||||
|
||||
DdlTipoAF.SelectedValueExist(GvRow.DataKey("CveTipoAF"))
|
||||
DdlTipoAF_SelectedIndexChanged(Nothing, Nothing)
|
||||
HdnCveVentaRemision.Value = GvRow.DataKey("CveVentaRemision")
|
||||
|
||||
If GvRow.DataKey("CveAF").ToEntero > 0 Then
|
||||
Dim ExisteItem As Boolean = False
|
||||
@@ -749,7 +725,6 @@ Partial Class RepContratosCalendario
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not ExisteItem Then
|
||||
Dim TmpItemText As String = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CodDesc", $" EstadoActivoFijo= 'Activo' AND CveActivoFijo = {GvRow.DataKey("CveAF")}")
|
||||
DdlAF.Items.Add(New ListItem(TmpItemText, $"{GvRow.DataKey("CveAF")}"))
|
||||
@@ -757,7 +732,6 @@ Partial Class RepContratosCalendario
|
||||
End If
|
||||
|
||||
DdlAF.SelectedValueExist(GvRow.DataKey("CveAF"))
|
||||
|
||||
HidCveAF.Value = "-1"
|
||||
HidCveAFDes.Value = ""
|
||||
If GvRow.DataKey("CveAF").ToEntero > 0 Then
|
||||
@@ -766,17 +740,13 @@ Partial Class RepContratosCalendario
|
||||
End If
|
||||
TxtMotivoCambioUnidad.Text = ""
|
||||
DVMotivoCambioAF.Visible = False
|
||||
|
||||
|
||||
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()
|
||||
|
||||
@@ -790,19 +760,17 @@ Partial Class RepContratosCalendario
|
||||
If HidModClienteNombre.Value = "" Then
|
||||
HidModClienteNombre.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, HidModCveCliente.Value.ToEntero).FiltroPrimeroValor("NombreComercial")
|
||||
End If
|
||||
|
||||
TxtMotivoCambioUnidad.Text = ""
|
||||
DVMotivoCambioAF.Visible = False
|
||||
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}"
|
||||
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={HdnCveVentaRemision.Value}"
|
||||
If HidRemisionSaldo.Value.ToDecimal > 0 Then
|
||||
LblSaldo.Text = $"Saldo {HidRemisionSaldo.Value.ToDecimal.ToString("###,###,###.00")}"
|
||||
Else
|
||||
@@ -884,11 +852,9 @@ Partial Class RepContratosCalendario
|
||||
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
||||
|
||||
Dim SubProyecto As String = DdlSubProyectos.SelectedItem.Text
|
||||
|
||||
Dim SbFiltros As New StringBuilder()
|
||||
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
|
||||
SbFiltros.AppendFormat("SubProyecto: {0}|", SubProyecto)
|
||||
|
||||
GvContratos.ExportToExcelGembox($"Reporte_Contratos_{NowADS.ToString("yyyyMMddHHmmss")}", UsuarioActual, "Reporte Contratos", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
|
||||
|
||||
End Sub
|
||||
@@ -960,6 +926,4 @@ Partial Class RepContratosCalendario
|
||||
CargaCronograma(DdlTipoVistaCalendario.SelectedValue.ToEntero)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user