-- 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
|
Next
|
||||||
End If
|
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 > 0 Then
|
||||||
If ObjConta.ValorPolizaDescuadre = 2 Then
|
If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||||
ErrorList.Add(ObjConta.MensajePolizaDescuadre)
|
ErrorList.Add(ObjConta.MensajePolizaDescuadre)
|
||||||
@@ -5805,7 +5805,7 @@ Namespace Modelos
|
|||||||
End If
|
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
|
'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
|
'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
|
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
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'If Not ErrorProceso AndAlso Not CveVentaRemision > 0 AndAlso ChkEsPresupuestal.Checked = False Then
|
If Not ErrorProceso AndAlso Not CveVentaRemision > 0 AndAlso ChkEsPresupuestal.Checked = False Then
|
||||||
' 'CveVentaRemision
|
'CveVentaRemision
|
||||||
' Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{TxtFolio.Text}"
|
Dim ObsRemisionPartida As String = $"{DdlTipoAF.SelectedItem.Text}-{ TxtDescripcion.Text}-{TxtFolio.Text}"
|
||||||
|
|
||||||
' Dim Respuesta As New RespuestaFacturacion()
|
Dim Respuesta As New RespuestaFacturacion()
|
||||||
' Dim CvePS As Integer = 907784
|
Dim CvePS As Integer = 907784
|
||||||
' Respuesta = GeneraRemision(CveContrato, ObsRemisionPartida, TxtImporte.Text.ToDecimal, CvePS, ObjContratos.IniciaTransacSQL, DdlSubProyecto.SelectedValue.ToEntero)
|
Respuesta = GeneraRemision(CveContrato, ObsRemisionPartida, TxtImporte.Text.ToDecimal, CvePS, ObjContratos.IniciaTransacSQL, DdlSubProyecto.SelectedValue.ToEntero)
|
||||||
|
|
||||||
' If Respuesta.CveVenta > 0 Then
|
If Respuesta.CveVenta > 0 Then
|
||||||
' CveVentaRemision = Respuesta.CveVenta
|
CveVentaRemision = Respuesta.CveVenta
|
||||||
' SerieFolioRemision = Respuesta.SerieFolio
|
SerieFolioRemision = Respuesta.SerieFolio
|
||||||
' ErrorProceso = False
|
ErrorProceso = False
|
||||||
' SeGeneroRemision = True
|
SeGeneroRemision = True
|
||||||
' Else
|
Else
|
||||||
' ErrorProceso = True
|
ErrorProceso = True
|
||||||
' Alert("se presento un error al generar la remisión", TipoMensaje.MsgAdvertencia)
|
Alert("se presento un error al generar la remisión", TipoMensaje.MsgAdvertencia)
|
||||||
' End If
|
End If
|
||||||
'End If
|
End If
|
||||||
|
|
||||||
If Not ErrorProceso Then
|
If Not ErrorProceso Then
|
||||||
ObjContratos.Commit()
|
ObjContratos.Commit()
|
||||||
|
|||||||
@@ -165,22 +165,17 @@ Partial Class ListadoContratos
|
|||||||
Dim tempArray() As String
|
Dim tempArray() As String
|
||||||
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
||||||
Dim fDestino = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", $"{CveContrato.ToString}.{ FileExtension}")
|
Dim fDestino = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", $"{CveContrato.ToString}.{ FileExtension}")
|
||||||
|
|
||||||
Try
|
Try
|
||||||
If File.Exists(fDestino) Then
|
If File.Exists(fDestino) Then
|
||||||
File.Delete(fDestino)
|
File.Delete(fDestino)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
File.Move(fileItem.FileUrl, fDestino)
|
File.Move(fileItem.FileUrl, fDestino)
|
||||||
|
|
||||||
If Not File.Exists(fDestino) Then
|
If Not File.Exists(fDestino) Then
|
||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjContratos.UpdateContratoArchivo(CveContrato, $"{CveContrato.ToString}.{ FileExtension}", UsuarioActual.CveEmpresa) Then
|
If ObjContratos.UpdateContratoArchivo(CveContrato, $"{CveContrato.ToString}.{ FileExtension}", UsuarioActual.CveEmpresa) Then
|
||||||
ErrorProceso = False
|
ErrorProceso = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ErrorProceso = True
|
ErrorProceso = True
|
||||||
End Try
|
End Try
|
||||||
@@ -222,7 +217,6 @@ Partial Class ListadoContratos
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If Not ErrorProceso Then
|
If Not ErrorProceso Then
|
||||||
ObjContratos.Commit()
|
ObjContratos.Commit()
|
||||||
|
|
||||||
@@ -323,7 +317,6 @@ Partial Class ListadoContratos
|
|||||||
If Not Directory.Exists(folderContratosPath) Then
|
If Not Directory.Exists(folderContratosPath) Then
|
||||||
Directory.CreateDirectory(folderContratosPath)
|
Directory.CreateDirectory(folderContratosPath)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not Directory.Exists(Path.Combine(folderContratosPath, "Temp")) Then
|
If Not Directory.Exists(Path.Combine(folderContratosPath, "Temp")) Then
|
||||||
Directory.CreateDirectory(Path.Combine(folderContratosPath, "Temp"))
|
Directory.CreateDirectory(Path.Combine(folderContratosPath, "Temp"))
|
||||||
End If
|
End If
|
||||||
@@ -334,26 +327,20 @@ Partial Class ListadoContratos
|
|||||||
Session("FileExtension") = FileExtension
|
Session("FileExtension") = FileExtension
|
||||||
Dim tempArray() As String
|
Dim tempArray() As String
|
||||||
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
||||||
|
|
||||||
|
|
||||||
ViewState("extencion") = FileExtension
|
ViewState("extencion") = FileExtension
|
||||||
ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", "Temp", fileItem.filename)
|
ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", "Temp", fileItem.filename)
|
||||||
|
|
||||||
File.Move(fileItem.FileUrl, ViewState("FUrl").ToString)
|
File.Move(fileItem.FileUrl, ViewState("FUrl").ToString)
|
||||||
LbArchivo.Text = tempArray(1)
|
LbArchivo.Text = tempArray(1)
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
UpModal.Update()
|
UpModal.Update()
|
||||||
RegistraScript("$('#ModalUpload').modal('hide')", "hidemodal1")
|
RegistraScript("$('#ModalUpload').modal('hide')", "hidemodal1")
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region "G E N E R A R E M I S O N"
|
#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
|
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()
|
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")
|
Dim ObjFactura As Modelos.Factura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyecto, DdlClientes.SelectedValue.ToEntero, CveMoneda, "Rem")
|
||||||
|
|
||||||
If ObjFactura IsNot Nothing AndAlso ProcesoOK Then
|
If ObjFactura IsNot Nothing AndAlso ProcesoOK Then
|
||||||
|
|
||||||
ObjFactura.CveMoneda = CveMoneda
|
ObjFactura.CveMoneda = CveMoneda
|
||||||
ObjFactura.CveContrato = CveContrato
|
ObjFactura.CveContrato = CveContrato
|
||||||
ObjFactura.Observaciones = ObsPartida
|
ObjFactura.Observaciones = ObsPartida
|
||||||
@@ -433,8 +419,6 @@ Partial Class ListadoContratos
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Protected Sub LnkAgregarContrato_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkAgregarContrato_Click(sender As Object, e As EventArgs)
|
||||||
@@ -442,7 +426,4 @@ Partial Class ListadoContratos
|
|||||||
RegistraScript("$('#ModalAgregar').modal({ backdrop: 'static', keyboard: false });")
|
RegistraScript("$('#ModalAgregar').modal({ backdrop: 'static', keyboard: false });")
|
||||||
UpTitulos.Update()
|
UpTitulos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -731,23 +731,23 @@
|
|||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:Button runat="server" ID="BtnModal" OnClick="MostrarModal"></asp:Button>
|
<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: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>--%>
|
<%--<asp:Button runat="server" ID="BtnDdlTipoAF" OnClick="BtnDdlTipoAF_Click" ClientIDMode="Static"></asp:Button>--%>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</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">
|
<div style="display:none!important">
|
||||||
<asp:UpdatePanel runat="server" ID="UPCargaCalendario">
|
<asp:UpdatePanel runat="server" ID="UPCargaCalendario">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
@@ -1236,12 +1236,8 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// dateAxis.zoomToDates(new Date(anioI, mesI, diaI), new Date(anioF, mesF, diaF));
|
// dateAxis.zoomToDates(new Date(anioI, mesI, diaI), new Date(anioF, mesF, diaF));
|
||||||
}, 1500);
|
}, 1500);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var PrimeraCargaCalendario = true;
|
var PrimeraCargaCalendario = true;
|
||||||
var currentUpdateEvent;
|
var currentUpdateEvent;
|
||||||
var addStartDate;
|
var addStartDate;
|
||||||
@@ -1257,7 +1253,6 @@
|
|||||||
let anio = parseInt($('#<%=HidCurrentYear.ClientID%>').val());
|
let anio = parseInt($('#<%=HidCurrentYear.ClientID%>').val());
|
||||||
|
|
||||||
Calendario(mes, anio);
|
Calendario(mes, anio);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1265,12 +1260,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateEvent(event, element, esCalendario = true) {
|
function updateEvent(event, element, esCalendario = true) {
|
||||||
|
|
||||||
|
|
||||||
$('#<%=HdnCveContrato.ClientID%>').val(event.id);
|
$('#<%=HdnCveContrato.ClientID%>').val(event.id);
|
||||||
$('#BtnCargaContratoCalendario').click();
|
$('#BtnCargaContratoCalendario').click();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatearFechaISO(fechaISO) {
|
function formatearFechaISO(fechaISO) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ Imports ADSNetLibrary.SIGAPI.Helpers
|
|||||||
Imports Extensiones.ModExtensiones
|
Imports Extensiones.ModExtensiones
|
||||||
Imports GemBox.Spreadsheet
|
Imports GemBox.Spreadsheet
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
|
Imports Modelos
|
||||||
Imports Newtonsoft.Json.Linq
|
Imports Newtonsoft.Json.Linq
|
||||||
|
|
||||||
Partial Class RepContratosCalendario
|
Partial Class RepContratosCalendario
|
||||||
@@ -301,19 +302,13 @@ Partial Class RepContratosCalendario
|
|||||||
Dim CvePadre As Integer = -1
|
Dim CvePadre As Integer = -1
|
||||||
|
|
||||||
For Each dRowUnidad As DataRow In DtUnidades.Rows
|
For Each dRowUnidad As DataRow In DtUnidades.Rows
|
||||||
|
|
||||||
|
|
||||||
Dim CveActivoFijo As Integer = dRowUnidad("CveActivoFijo").ToString.ToEntero
|
Dim CveActivoFijo As Integer = dRowUnidad("CveActivoFijo").ToString.ToEntero
|
||||||
Dim CodigoAF As String = dRowUnidad("Codigo").ToString
|
Dim CodigoAF As String = dRowUnidad("Codigo").ToString
|
||||||
'Dim unidad As String = $"{dRowUnidad("Codigo").ToString}-{dRowUnidad("Descripcion").tostring}"
|
'Dim unidad As String = $"{dRowUnidad("Codigo").ToString}-{dRowUnidad("Descripcion").tostring}"
|
||||||
|
|
||||||
Dim SeEncontro As Boolean = False
|
Dim SeEncontro As Boolean = False
|
||||||
|
|
||||||
Dim EsHijo As Boolean = False
|
Dim EsHijo As Boolean = False
|
||||||
For Each Row As DataRow In DtAvance.FiltraParametros("CodigoAF <> '' AND TipoEstatus <> 3").Rows
|
For Each Row As DataRow In DtAvance.FiltraParametros("CodigoAF <> '' AND TipoEstatus <> 3").Rows
|
||||||
|
|
||||||
Dim CveActivoFijoContrato As Integer = Row("CveAF").ToString.ToEntero
|
Dim CveActivoFijoContrato As Integer = Row("CveAF").ToString.ToEntero
|
||||||
|
|
||||||
'If CveActivoFijo = CveActivoFijoContrato Then
|
'If CveActivoFijo = CveActivoFijoContrato Then
|
||||||
' str.AppendLine(String.Format("{0}", separator))
|
' str.AppendLine(String.Format("{0}", separator))
|
||||||
' SeEncontro = True
|
' SeEncontro = True
|
||||||
@@ -325,9 +320,6 @@ Partial Class RepContratosCalendario
|
|||||||
' separator = ","
|
' separator = ","
|
||||||
' encontrados = encontrados + 1
|
' encontrados = encontrados + 1
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If CveActivoFijo = CveActivoFijoContrato Then
|
If CveActivoFijo = CveActivoFijoContrato Then
|
||||||
str.AppendLine(String.Format("{0}", separator))
|
str.AppendLine(String.Format("{0}", separator))
|
||||||
SeEncontro = True
|
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)
|
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
|
End If
|
||||||
|
|
||||||
If Not EsHijo Then
|
If Not EsHijo Then
|
||||||
CvePadre = Row("CveContrato").ToString.ToEntero
|
CvePadre = Row("CveContrato").ToString.ToEntero
|
||||||
EsHijo = True
|
EsHijo = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
separator = ","
|
separator = ","
|
||||||
encontrados = encontrados + 1
|
encontrados = encontrados + 1
|
||||||
Else
|
Else
|
||||||
EsHijo = False
|
EsHijo = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If Not SeEncontro Then
|
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}} ",
|
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))
|
"", 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 = ","
|
separator = ","
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'str.AppendLine(String.Format("}"))
|
'str.AppendLine(String.Format("}"))
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
str.AppendLine("];loadGant();")
|
str.AppendLine("];loadGant();")
|
||||||
RegistraScript(str.ToString())
|
RegistraScript(str.ToString())
|
||||||
|
|
||||||
@@ -389,7 +371,6 @@ Partial Class RepContratosCalendario
|
|||||||
Private Function ColorAleatorio(randomNumber As Random) As String
|
Private Function ColorAleatorio(randomNumber As Random) As String
|
||||||
|
|
||||||
Dim listaColores As New List(Of String)
|
Dim listaColores As New List(Of String)
|
||||||
|
|
||||||
listaColores.Add("#94f35a")
|
listaColores.Add("#94f35a")
|
||||||
listaColores.Add("#1989a9")
|
listaColores.Add("#1989a9")
|
||||||
listaColores.Add("#5a3c98")
|
listaColores.Add("#5a3c98")
|
||||||
@@ -436,10 +417,7 @@ Partial Class RepContratosCalendario
|
|||||||
listaColores.Add("#058106")
|
listaColores.Add("#058106")
|
||||||
listaColores.Add("#0485f2")
|
listaColores.Add("#0485f2")
|
||||||
listaColores.Add("#401685")
|
listaColores.Add("#401685")
|
||||||
|
|
||||||
|
|
||||||
Dim ranNumber As Integer = randomNumber.Next(0, listaColores.Count - 1)
|
Dim ranNumber As Integer = randomNumber.Next(0, listaColores.Count - 1)
|
||||||
|
|
||||||
Return listaColores(ranNumber)
|
Return listaColores(ranNumber)
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
@@ -591,8 +569,6 @@ Partial Class RepContratosCalendario
|
|||||||
|
|
||||||
DdlTipoAF.SelectedValueExist(DRow("CveTipoAF").ToString)
|
DdlTipoAF.SelectedValueExist(DRow("CveTipoAF").ToString)
|
||||||
DdlTipoAF_SelectedIndexChanged(Nothing, Nothing)
|
DdlTipoAF_SelectedIndexChanged(Nothing, Nothing)
|
||||||
|
|
||||||
|
|
||||||
If DRow("CveAF").ToString.ToEntero > 0 Then
|
If DRow("CveAF").ToString.ToEntero > 0 Then
|
||||||
Dim ExisteItem As Boolean = False
|
Dim ExisteItem As Boolean = False
|
||||||
For Each item As ListItem In DdlAF.Items
|
For Each item As ListItem In DdlAF.Items
|
||||||
@@ -607,10 +583,7 @@ Partial Class RepContratosCalendario
|
|||||||
DdlAF.Items.Add(New ListItem(TmpItemText, $"{DRow("CveAF").ToString}"))
|
DdlAF.Items.Add(New ListItem(TmpItemText, $"{DRow("CveAF").ToString}"))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
DdlAF.SelectedValueExist(DRow("CveAF").ToString)
|
DdlAF.SelectedValueExist(DRow("CveAF").ToString)
|
||||||
|
|
||||||
HidCveAF.Value = "-1"
|
HidCveAF.Value = "-1"
|
||||||
HidCveAFDes.Value = ""
|
HidCveAFDes.Value = ""
|
||||||
If DRow("CveAF").ToString.ToEntero > 0 Then
|
If DRow("CveAF").ToString.ToEntero > 0 Then
|
||||||
@@ -619,10 +592,9 @@ Partial Class RepContratosCalendario
|
|||||||
End If
|
End If
|
||||||
TxtMotivoCambioUnidad.Text = ""
|
TxtMotivoCambioUnidad.Text = ""
|
||||||
DVMotivoCambioAF.Visible = False
|
DVMotivoCambioAF.Visible = False
|
||||||
|
|
||||||
|
|
||||||
HypRemision.Text = DRow("RemisionSerieFolio").ToString
|
HypRemision.Text = DRow("RemisionSerieFolio").ToString
|
||||||
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={DRow("CveVentaRemision").ToString}"
|
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={DRow("CveVentaRemision").ToString}"
|
||||||
|
HdnCveVentaRemision.Value = DRow("CveVentaRemision").ToString
|
||||||
|
|
||||||
If DRow("RemisionSaldo").ToString.ToDecimal > 0 Then
|
If DRow("RemisionSaldo").ToString.ToDecimal > 0 Then
|
||||||
LblSaldo.Text = $"Saldo {DRow("RemisionSaldo").ToString.ToDecimal.ToString("###,###,###.00")}"
|
LblSaldo.Text = $"Saldo {DRow("RemisionSaldo").ToString.ToDecimal.ToString("###,###,###.00")}"
|
||||||
@@ -642,15 +614,8 @@ Partial Class RepContratosCalendario
|
|||||||
Else
|
Else
|
||||||
Alert("Contrato no especificado", TipoMensaje.MsgAdvertencia)
|
Alert("Contrato no especificado", TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
||||||
Dim TieneError As Boolean = False
|
Dim TieneError As Boolean = False
|
||||||
Dim NumChoferes As Integer = If(chkSegundoChofer.Checked, 2, 1)
|
Dim NumChoferes As Integer = If(chkSegundoChofer.Checked, 2, 1)
|
||||||
@@ -662,6 +627,7 @@ Partial Class RepContratosCalendario
|
|||||||
|
|
||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
Dim objGenerales As New ClsGenerales(ObjContratos.IniciaTransacSQL())
|
Dim objGenerales As New ClsGenerales(ObjContratos.IniciaTransacSQL())
|
||||||
|
Dim ObjVentas As New ClsVentas(ObjContratos.IniciaTransacSQL())
|
||||||
Dim DTAgendadados As New DataTable
|
Dim DTAgendadados As New DataTable
|
||||||
If ObjContratos.GetContratosValUnidadesAgendadas(DdlAF.SelectedValue.ToEntero, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, UsuarioActual.CveEmpresa, CveContrato) Then
|
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,
|
-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,
|
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
|
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
|
Else
|
||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
@@ -702,10 +682,9 @@ Partial Class RepContratosCalendario
|
|||||||
Else
|
Else
|
||||||
ObjContratos.Commit()
|
ObjContratos.Commit()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
objGenerales.Dispose()
|
objGenerales.Dispose()
|
||||||
|
ObjVentas.Dispose()
|
||||||
UpTitulos.Update()
|
UpTitulos.Update()
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
InicializaCalendar()
|
InicializaCalendar()
|
||||||
@@ -726,20 +705,17 @@ Partial Class RepContratosCalendario
|
|||||||
TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy HH:mm:ss")
|
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 ")
|
TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy HH:mm:ss ")
|
||||||
TxtMoneda.Text = GvRow.DataKey("Moneda")
|
TxtMoneda.Text = GvRow.DataKey("Moneda")
|
||||||
|
|
||||||
TxtAnticipo.Text = GvRow.DataKey("ImporteMin")
|
TxtAnticipo.Text = GvRow.DataKey("ImporteMin")
|
||||||
TxtDolares.Text = GvRow.DataKey("Importe")
|
TxtDolares.Text = GvRow.DataKey("Importe")
|
||||||
'Requeridos
|
'Requeridos
|
||||||
|
|
||||||
DdlChofer.SelectedValueExist(GvRow.DataKey("CveChofer"))
|
DdlChofer.SelectedValueExist(GvRow.DataKey("CveChofer"))
|
||||||
DdlChofer2.SelectedValueExist(GvRow.DataKey("CveChofer2"))
|
DdlChofer2.SelectedValueExist(GvRow.DataKey("CveChofer2"))
|
||||||
chkSegundoChofer.Checked = If(NumChoferes = 2, True, False)
|
chkSegundoChofer.Checked = If(NumChoferes = 2, True, False)
|
||||||
|
|
||||||
DdlEstatusContrato.SelectedValueExist(GvRow.DataKey("CveContratosEstatus"))
|
DdlEstatusContrato.SelectedValueExist(GvRow.DataKey("CveContratosEstatus"))
|
||||||
DdlSubProyectoModal.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
|
DdlSubProyectoModal.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
|
||||||
|
|
||||||
DdlTipoAF.SelectedValueExist(GvRow.DataKey("CveTipoAF"))
|
DdlTipoAF.SelectedValueExist(GvRow.DataKey("CveTipoAF"))
|
||||||
DdlTipoAF_SelectedIndexChanged(Nothing, Nothing)
|
DdlTipoAF_SelectedIndexChanged(Nothing, Nothing)
|
||||||
|
HdnCveVentaRemision.Value = GvRow.DataKey("CveVentaRemision")
|
||||||
|
|
||||||
If GvRow.DataKey("CveAF").ToEntero > 0 Then
|
If GvRow.DataKey("CveAF").ToEntero > 0 Then
|
||||||
Dim ExisteItem As Boolean = False
|
Dim ExisteItem As Boolean = False
|
||||||
@@ -749,7 +725,6 @@ Partial Class RepContratosCalendario
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If Not ExisteItem Then
|
If Not ExisteItem Then
|
||||||
Dim TmpItemText As String = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CodDesc", $" EstadoActivoFijo= 'Activo' AND CveActivoFijo = {GvRow.DataKey("CveAF")}")
|
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")}"))
|
DdlAF.Items.Add(New ListItem(TmpItemText, $"{GvRow.DataKey("CveAF")}"))
|
||||||
@@ -757,7 +732,6 @@ Partial Class RepContratosCalendario
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
DdlAF.SelectedValueExist(GvRow.DataKey("CveAF"))
|
DdlAF.SelectedValueExist(GvRow.DataKey("CveAF"))
|
||||||
|
|
||||||
HidCveAF.Value = "-1"
|
HidCveAF.Value = "-1"
|
||||||
HidCveAFDes.Value = ""
|
HidCveAFDes.Value = ""
|
||||||
If GvRow.DataKey("CveAF").ToEntero > 0 Then
|
If GvRow.DataKey("CveAF").ToEntero > 0 Then
|
||||||
@@ -766,17 +740,13 @@ Partial Class RepContratosCalendario
|
|||||||
End If
|
End If
|
||||||
TxtMotivoCambioUnidad.Text = ""
|
TxtMotivoCambioUnidad.Text = ""
|
||||||
DVMotivoCambioAF.Visible = False
|
DVMotivoCambioAF.Visible = False
|
||||||
|
|
||||||
|
|
||||||
HypRemision.Text = GvRow.DataKey("RemisionSerieFolio")
|
HypRemision.Text = GvRow.DataKey("RemisionSerieFolio")
|
||||||
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={GvRow.DataKey("CveVentaRemision")}"
|
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={GvRow.DataKey("CveVentaRemision")}"
|
||||||
|
|
||||||
If GvRow.DataKey("RemisionSaldo").ToDecimal > 0 Then
|
If GvRow.DataKey("RemisionSaldo").ToDecimal > 0 Then
|
||||||
LblSaldo.Text = $"Saldo {GvRow.DataKey("RemisionSaldo").ToDecimal.ToString("###,###,###.00")}"
|
LblSaldo.Text = $"Saldo {GvRow.DataKey("RemisionSaldo").ToDecimal.ToString("###,###,###.00")}"
|
||||||
Else
|
Else
|
||||||
LblSaldo.Text = ""
|
LblSaldo.Text = ""
|
||||||
End If
|
End If
|
||||||
|
|
||||||
CveContrato = GvRow.DataKey("CveContrato").ToEntero
|
CveContrato = GvRow.DataKey("CveContrato").ToEntero
|
||||||
OcultarMostrarSegundoChofer()
|
OcultarMostrarSegundoChofer()
|
||||||
|
|
||||||
@@ -790,19 +760,17 @@ Partial Class RepContratosCalendario
|
|||||||
If HidModClienteNombre.Value = "" Then
|
If HidModClienteNombre.Value = "" Then
|
||||||
HidModClienteNombre.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, HidModCveCliente.Value.ToEntero).FiltroPrimeroValor("NombreComercial")
|
HidModClienteNombre.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, HidModCveCliente.Value.ToEntero).FiltroPrimeroValor("NombreComercial")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
TxtMotivoCambioUnidad.Text = ""
|
TxtMotivoCambioUnidad.Text = ""
|
||||||
DVMotivoCambioAF.Visible = False
|
DVMotivoCambioAF.Visible = False
|
||||||
DdlClientes.SelectedText = HidModClienteNombre.Value
|
DdlClientes.SelectedText = HidModClienteNombre.Value
|
||||||
DdlClientes.SelectedValue = HidModCveCliente.Value
|
DdlClientes.SelectedValue = HidModCveCliente.Value
|
||||||
DdlClientes.txtText.Value = HidModClienteNombre.Value
|
DdlClientes.txtText.Value = HidModClienteNombre.Value
|
||||||
DdlClientes.txtValue.Value = HidModCveCliente.Value
|
DdlClientes.txtValue.Value = HidModCveCliente.Value
|
||||||
|
|
||||||
chkSegundoChofer.Checked = If(HidNumChoferes.Value.ToEntero = 2, True, False)
|
chkSegundoChofer.Checked = If(HidNumChoferes.Value.ToEntero = 2, True, False)
|
||||||
OcultarMostrarSegundoChofer()
|
OcultarMostrarSegundoChofer()
|
||||||
|
|
||||||
HypRemision.Text = HidRemisionSerieFolio.Value
|
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
|
If HidRemisionSaldo.Value.ToDecimal > 0 Then
|
||||||
LblSaldo.Text = $"Saldo {HidRemisionSaldo.Value.ToDecimal.ToString("###,###,###.00")}"
|
LblSaldo.Text = $"Saldo {HidRemisionSaldo.Value.ToDecimal.ToString("###,###,###.00")}"
|
||||||
Else
|
Else
|
||||||
@@ -884,11 +852,9 @@ Partial Class RepContratosCalendario
|
|||||||
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
||||||
|
|
||||||
Dim SubProyecto As String = DdlSubProyectos.SelectedItem.Text
|
Dim SubProyecto As String = DdlSubProyectos.SelectedItem.Text
|
||||||
|
|
||||||
Dim SbFiltros As New StringBuilder()
|
Dim SbFiltros As New StringBuilder()
|
||||||
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
|
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
|
||||||
SbFiltros.AppendFormat("SubProyecto: {0}|", SubProyecto)
|
SbFiltros.AppendFormat("SubProyecto: {0}|", SubProyecto)
|
||||||
|
|
||||||
GvContratos.ExportToExcelGembox($"Reporte_Contratos_{NowADS.ToString("yyyyMMddHHmmss")}", UsuarioActual, "Reporte Contratos", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
|
GvContratos.ExportToExcelGembox($"Reporte_Contratos_{NowADS.ToString("yyyyMMddHHmmss")}", UsuarioActual, "Reporte Contratos", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
@@ -960,6 +926,4 @@ Partial Class RepContratosCalendario
|
|||||||
CargaCronograma(DdlTipoVistaCalendario.SelectedValue.ToEntero)
|
CargaCronograma(DdlTipoVistaCalendario.SelectedValue.ToEntero)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user