diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb
index 008c30c2e..99b9d0e52 100644
--- a/Transportes/RepContratoDetalle.aspx.vb
+++ b/Transportes/RepContratoDetalle.aspx.vb
@@ -1,7 +1,11 @@
Option Explicit On
Option Strict On
Imports System.Data
+Imports System.IO
+Imports ADSNetLibrary.Helpers
+Imports ADSNetLibrary.SIGAPI.Helpers
Imports Extensiones
+Imports Extensiones.ModExtensiones
Imports Microsoft.Reporting.WebForms
Partial Class RepContratoDetalle
@@ -15,6 +19,22 @@ Partial Class RepContratoDetalle
ViewState("CveContrato") = value
End Set
End Property
+ Private Property CveContratoTipo As Integer
+ Get
+ Return CType(ViewState("CveContratoTipo"), Integer)
+ End Get
+ Set(value As Integer)
+ ViewState("CveContratoTipo") = value
+ End Set
+ End Property
+ Private Property CveMasivo As Integer
+ Get
+ Return CType(ViewState("CveMasivo"), Integer)
+ End Get
+ Set(value As Integer)
+ ViewState("CveMasivo") = value
+ End Set
+ End Property
Private Property CveViajePasajero As Integer
Get
Return CType(ViewState("CveViajePasajero"), Integer)
@@ -57,6 +77,7 @@ Partial Class RepContratoDetalle
End Property
#End Region
+#Region "Carga Página"
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Request("CveContrato") Is Nothing Then
Response.Redirect($"~/Transportes/RepContratos.aspx")
@@ -82,8 +103,11 @@ Partial Class RepContratoDetalle
If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then
Contrato = ObjContratos.DtResultados
If Contrato IsNot Nothing AndAlso Contrato.Rows.Count > 0 Then
+ CveContratoTipo = Contrato.Rows(0)("CveContratoTipo").ToString.ToEntero
SubProyecto = Contrato.Rows(0)("SubProyecto").ToString
+ CveMasivo = Contrato.Rows(0)("CveMasivo").ToString.ToEntero
LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString
+ LbCveSubProyecto.Text = Contrato.Rows(0)("CveSubProyecto").ToString
DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString
DdlClientes.SelectedValue = Contrato.Rows(0)("CveCliente").ToString
TxtDescripcion.Text = Contrato.Rows(0)("DescripcionContrato").ToString
@@ -96,6 +120,12 @@ Partial Class RepContratoDetalle
TxtDolares.Text = Contrato.Rows(0)("Importe").ToString
TxtPesos.Text = Contrato.Rows(0)("ImporteMax").ToString
TxtAnticipo.Text = Contrato.Rows(0)("ImporteMin").ToString
+ If Not String.IsNullOrEmpty(Contrato.Rows(0)("Archivo").ToString) Then
+ BtnDescargar.Visible = True
+ LbArchivo.Text = Contrato.Rows(0)("Archivo").ToString
+ LbArchivo.Visible = True
+ ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "CONTRATOS", ObjContratos.Archivo)
+ End If
'Boletos Vendidos
If Contrato.Rows(0)("CveContratoTipo").ToString() = "35" Then
TabBoletos.Visible = True
@@ -114,73 +144,133 @@ Partial Class RepContratoDetalle
Response.Redirect($"~/Transportes/RepContratos.aspx")
End If
ObjContratos.Dispose()
+
End Sub
- Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- CveViajePasajero = GvRow.DataKey("CveViajePasajero").ToEntero
- LbPartida.Text = GvRow.DataKey("Partida").ToString()
- LbDestino.Text = GvRow.DataKey("Destino").ToString()
- LbImporte.Text = Convert.ToDecimal(GvRow.DataKey("Importe")).ToString("C")
- LbNombre.Text = GvRow.DataKey("Nombre").ToString()
- LbVisa.Text = GvRow.DataKey("Visa").ToString()
- LbCelular.Text = GvRow.DataKey("Celular").ToString()
- LbSexo.Text = GvRow.DataKey("Sexo").ToString()
- LbObservacion.Text = GvRow.DataKey("Observacion").ToString()
- LbEstatus.Text = GvRow.DataKey("Estatus").ToString()
- LbCreado.Text = GvRow.DataKey("FechaIng").ToString()
- TxtAsiento.Text = GvRow.DataKey("Asiento").ToString()
- Dim Estatus As Boolean = Not CBool(LbEstatus.Text)
- Dim ObjTransportes As New ClsTransportes
+#End Region
+
+#Region "Información General"
+ Protected Sub GuardarArchivo(sender As Object, e As EventArgs)
+ Dim FileExtension As String = "-1"
+ Dim Filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
+ Dim Filename As String = ""
+ Dim folderContratosPath As String = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos")
+
+ 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
+
+ For Each fileItem As Archivo In Filesgral
+
+ FileExtension = IO.Path.GetExtension($"{AppDomain.CurrentDomain.BaseDirectory}Temp\{fileItem.filename}").Replace(".", "")
+ 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)
+ TxtArchivo.Text = tempArray(1)
+ ' imgFileOk.Visible = True
+ 'ImgArchivo.Src = "/imagenes/accept.png"
+ Next
+
+ UpTabContainer.Update()
+ RegistraScript("$('#ModalUpload').modal('hide')", "hidemodal1")
+ Button1.Visible = True
+ If Not FileExtension = "-1" Then
+ BtnDescargar.Visible = True
+ End If
+ UpdateContrato(sender, e)
+ End Sub
+ Protected Sub DescargarArchivo(sender As Object, e As EventArgs)
+ Dim File As New FileInfo(ViewState("FUrl").ToString)
+
+ If File.Exists Then 'set appropriate headers
+ Response.Clear()
+ Response.ClearHeaders()
+ Response.ClearContent()
+ Response.AddHeader("Content-Disposition", "attachment; filename=" & LbFolio.Text & ".pdf")
+ Response.AddHeader("Content-Length", File.Length.ToString())
+ 'Response.ContentType = "text/plain"
+ Response.ContentType = "application/octet-stream"
+ Response.Flush()
+ ' Response.TransmitFile(File.FullName)
+ Response.WriteFile(File.FullName)
+ Response.End()
+ 'if file does not exist
+
+ Alert("Descargado Correctamente.", TipoMensaje.MsgInformacion)
+ Else
+ Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()")
+
+ End If 'nothing in the URL as HTTP GET
+ End Sub
+ Protected Sub UpdateContrato(sender As Object, e As EventArgs)
+ Dim ObjContratos As New ClsContratos
Try
- ObjTransportes.IniciaTransacSQL()
-
- If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero, CveContrato, UsuarioActual.CveVendedor, LbImporte.Text.ToDecimal, TxtAsiento.Text.ToEntero, LbNombre.Text, LbVisa.Text, LbCelular.Text, LbObservacion.Text, Estatus, UsuarioActual.CveUsuario, LbSexo.Text.ToBool) Then
- Alert($"El boleto ha modificado el estatus de su boleto correctamente.")
-
- ObjTransportes.Commit()
+ If ObjContratos.UpdateContratos(CveContrato, LbFolio.Text, TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", LbCveSubProyecto.Text.ToEntero, -1, -1, -1, -1, LbArchivo.Text, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, -1) Then
+ Alert("Contrato actualizado correctamente")
End If
+ ObjContratos.Commit()
Catch ex As Exception
- ObjTransportes.RollBack()
- Alert($"No se pudo cambiar el estatus del boleto", TipoMensaje.MsgError)
+ Alert($"Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError)
+ ObjContratos.RollBack()
Finally
- ObjTransportes.Dispose()
+ Alert("Contrato actualizado correctamente")
+ ObjContratos.Dispose()
CargaDatos()
End Try
End Sub
- Protected Sub CambiarBoleto(sender As Object, e As EventArgs)
- DdlRuta.ClearSelection()
- PnEditarViaje.Visible = True
- PnEditarUsuario.Visible = False
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
-
- CveViajePasajero = GvRow.DataKey("CveViajePasajero").ToEntero
- LbPartida.Text = GvRow.DataKey("Partida").ToString()
- LbDestino.Text = GvRow.DataKey("Destino").ToString()
- LbImporte.Text = Convert.ToDecimal(GvRow.DataKey("Importe")).ToString("C")
- LbNombre.Text = GvRow.DataKey("Nombre").ToString()
- LbVisa.Text = GvRow.DataKey("Visa").ToString()
- LbCelular.Text = GvRow.DataKey("Celular").ToString()
- LbSexo.Text = GvRow.DataKey("Sexo").ToString()
- LbObservacion.Text = GvRow.DataKey("Observacion").ToString()
- LbEstatus.Text = GvRow.DataKey("Estatus").ToString()
- LbCreado.Text = GvRow.DataKey("FechaIng").ToString()
- TxtAsiento.Text = GvRow.DataKey("Asiento").ToString()
-
- 'Seleccionamos la ruta que tiene el usuario actual
- DdlRuta.ClearSelection()
+ Protected Sub EliminarContrato(sender As Object, e As EventArgs)
Dim ObjContratos As New ClsContratos
- If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, -1, CveEstatus:=-1, CveTipoContrato:=35) Then
- For Each row As DataRow In ObjContratos.DtResultados.Rows
- Dim fecha As DateTime = row("FechaInicial").ToString.ToDateTime
- ' Asigna los valores de la columna deseada al ListItem
- Dim listItem As New ListItem(row("SubProyecto").ToString() + " - " + fecha.ToShortDateString + " - " + fecha.ToShortTimeString, row("CveContrato").ToString())
- ' Agrega el ListItem al DropDownList
- DdlRuta.Items.Add(listItem)
- Next
+ If (CveContratoTipo = 35) Then
+ If CveMasivo <> 0 Then
+ If ObjContratos.RemoveContrato(CveContrato, UsuarioActual.CveEmpresa, CveMasivo:=CveMasivo) Then
+ Alert("Viajes masivos eliminados correctamente")
+ ObjContratos.Dispose()
+ Response.Redirect("RepViajes.aspx")
+ End If
+ Else
+ If ObjContratos.RemoveContrato(CveContrato, UsuarioActual.CveEmpresa) Then
+ Alert("Viaje eliminado correctamente")
+ ObjContratos.Dispose()
+ Response.Redirect("RepViajes.aspx")
+ End If
+ End If
+ Else
+ If ObjContratos.RemoveContrato(CveContrato, UsuarioActual.CveEmpresa) Then
+ Alert("Contrato eliminado correctamente")
+ ObjContratos.Dispose()
+ Response.Redirect("RepContratos.aspx")
+ End If
End If
- DdlRuta.SelectedValue = GvRow.DataKey("CveViaje")
- ObjContratos.Dispose()
+
+ End Sub
+#End Region
+
+#Region "Boletos"
+ Protected Sub OnLinkButtonClick(sender As Object, e As EventArgs)
+ 'Limpiamos la selección anterior
+ If AsientoSeleccionado <> "" Then
+ Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
+ Dim lnk As LinkButton = CType(cph.FindControl(AsientoSeleccionado), LinkButton)
+ lnk.CssClass = "disponible"
+ End If
+ 'Seleccionamos un asiento
+ Dim linkButton As LinkButton = DirectCast(sender, LinkButton)
+ Dim buttonID As String = linkButton.ID
+ linkButton.CssClass += " activo"
+ AsientoSeleccionado = buttonID
+ TxtAsiento.Text = buttonID.Substring(1)
+
+ UpBoletos.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
End Sub
Protected Sub UpdateBoleto(sender As Object, e As EventArgs)
@@ -208,26 +298,6 @@ Partial Class RepContratoDetalle
CargaDatos()
End Try
End Sub
- Protected Sub EditarBoleto(sender As Object, e As EventArgs)
-
- End Sub
- Protected Sub OnLinkButtonClick(sender As Object, e As EventArgs)
- 'Limpiamos la selección anterior
- If AsientoSeleccionado <> "" Then
- Dim cph As ContentPlaceHolder = CType(Me.Master.FindControl("C"), ContentPlaceHolder)
- Dim lnk As LinkButton = CType(cph.FindControl(AsientoSeleccionado), LinkButton)
- lnk.CssClass = "disponible"
- End If
- 'Seleccionamos un asiento
- Dim linkButton As LinkButton = DirectCast(sender, LinkButton)
- Dim buttonID As String = linkButton.ID
- linkButton.CssClass += " activo"
- AsientoSeleccionado = buttonID
- TxtAsiento.Text = buttonID.Substring(1)
-
- UpBoletos.Update()
- RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
- End Sub
Protected Sub OnChangeRuta(sender As Object, e As EventArgs)
Dim ObjTransportes As New ClsTransportes
@@ -289,6 +359,79 @@ Partial Class RepContratoDetalle
'Empresas/188/Formatos/Boleto.mrt
End Sub
+ Protected Sub EditarBoleto(sender As Object, e As EventArgs)
+
+ End Sub
+ Protected Sub CambiarBoleto(sender As Object, e As EventArgs)
+ DdlRuta.ClearSelection()
+ PnEditarViaje.Visible = True
+ PnEditarUsuario.Visible = False
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ CveViajePasajero = GvRow.DataKey("CveViajePasajero").ToEntero
+ LbPartida.Text = GvRow.DataKey("Partida").ToString()
+ LbDestino.Text = GvRow.DataKey("Destino").ToString()
+ LbImporte.Text = Convert.ToDecimal(GvRow.DataKey("Importe")).ToString("C")
+ LbNombre.Text = GvRow.DataKey("Nombre").ToString()
+ LbVisa.Text = GvRow.DataKey("Visa").ToString()
+ LbCelular.Text = GvRow.DataKey("Celular").ToString()
+ LbSexo.Text = GvRow.DataKey("Sexo").ToString()
+ LbObservacion.Text = GvRow.DataKey("Observacion").ToString()
+ LbEstatus.Text = GvRow.DataKey("Estatus").ToString()
+ LbCreado.Text = GvRow.DataKey("FechaIng").ToString()
+ TxtAsiento.Text = GvRow.DataKey("Asiento").ToString()
+
+ 'Seleccionamos la ruta que tiene el usuario actual
+ DdlRuta.ClearSelection()
+ Dim ObjContratos As New ClsContratos
+ If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, -1, CveEstatus:=-1, CveTipoContrato:=35) Then
+ For Each row As DataRow In ObjContratos.DtResultados.Rows
+ Dim fecha As DateTime = row("FechaInicial").ToString.ToDateTime
+ ' Asigna los valores de la columna deseada al ListItem
+ Dim listItem As New ListItem(row("SubProyecto").ToString() + " - " + fecha.ToShortDateString + " - " + fecha.ToShortTimeString, row("CveContrato").ToString())
+ ' Agrega el ListItem al DropDownList
+ DdlRuta.Items.Add(listItem)
+ Next
+ End If
+ DdlRuta.SelectedValue = GvRow.DataKey("CveViaje")
+ ObjContratos.Dispose()
+ RegistraScript(String.Format("$('#{0}').modal('show');", "ModalEditar"))
+ End Sub
+ Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ CveViajePasajero = GvRow.DataKey("CveViajePasajero").ToEntero
+ LbPartida.Text = GvRow.DataKey("Partida").ToString()
+ LbDestino.Text = GvRow.DataKey("Destino").ToString()
+ LbImporte.Text = Convert.ToDecimal(GvRow.DataKey("Importe")).ToString("C")
+ LbNombre.Text = GvRow.DataKey("Nombre").ToString()
+ LbVisa.Text = GvRow.DataKey("Visa").ToString()
+ LbCelular.Text = GvRow.DataKey("Celular").ToString()
+ LbSexo.Text = GvRow.DataKey("Sexo").ToString()
+ LbObservacion.Text = GvRow.DataKey("Observacion").ToString()
+ LbEstatus.Text = GvRow.DataKey("Estatus").ToString()
+ LbCreado.Text = GvRow.DataKey("FechaIng").ToString()
+ TxtAsiento.Text = GvRow.DataKey("Asiento").ToString()
+ Dim Estatus As Boolean = Not LbEstatus.Text.ToBool
+ Dim ObjTransportes As New ClsTransportes
+ Try
+ ObjTransportes.IniciaTransacSQL()
+
+ If ObjTransportes.UpdateViajesPasajeros(CveViajePasajero, CveContrato, UsuarioActual.CveVendedor, LbImporte.Text.ToDecimal, TxtAsiento.Text.ToEntero, LbNombre.Text, LbVisa.Text, LbCelular.Text, LbObservacion.Text, Estatus, UsuarioActual.CveUsuario, LbSexo.Text.ToBool) Then
+ Alert($"El boleto ha modificado el estatus de su boleto correctamente.")
+
+ ObjTransportes.Commit()
+ End If
+
+ Catch ex As Exception
+ ObjTransportes.RollBack()
+ Alert($"No se pudo cambiar el estatus del boleto", TipoMensaje.MsgError)
+ Finally
+ ObjTransportes.Dispose()
+ CargaDatos()
+ End Try
+ End Sub
+#End Region
+
End Class
diff --git a/Transportes/RepContratos.aspx b/Transportes/RepContratos.aspx
index 060762b84..0c4a53718 100644
--- a/Transportes/RepContratos.aspx
+++ b/Transportes/RepContratos.aspx
@@ -243,7 +243,8 @@
-
-
@@ -388,13 +388,21 @@
+
+
+
+
+
@@ -434,7 +442,40 @@
+ <%--MODAL UPLOAD--%>
+
+
+
+
+
+
Subir Archivo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb
index c1344d859..b9f0cc276 100644
--- a/Transportes/RepContratos.aspx.vb
+++ b/Transportes/RepContratos.aspx.vb
@@ -1,6 +1,7 @@
Option Explicit On
Option Strict On
Imports System.Data
+Imports System.IO
Imports Extensiones
Imports Extensiones.ModExtensiones
Imports Microsoft.Reporting.WebForms
@@ -18,6 +19,8 @@ Partial Class ListadoContratos
End Set
End Property
#End Region
+
+#Region "Carga Página"
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString
txtFechaF.Text = DateTime.Now.AddDays(7).ToShortDateString
@@ -71,6 +74,8 @@ Partial Class ListadoContratos
UpTitulos.Update()
End Sub
+#End Region
+
Protected Sub MostrarModal()
RegistraScript(String.Format("$('#{0}').modal('show');", "ModalAgregar"))
End Sub
@@ -84,6 +89,15 @@ Partial Class ListadoContratos
Exit Sub
End If
+ 'Agregamos Contrato
+ Dim ObjContratos As New ClsContratos
+ ObjContratos.IniciaTransacSQL()
+ If ObjContratos.AddContratos(LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, LbArchivo.Text, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=34, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text) > 0 Then
+ ObjContratos.Commit()
+ Alert("Agregado Correctamente.")
+ End If
+ ObjContratos.Dispose()
+
'Aumentamos Folio
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
Dim ObjFolios As New ClsGralFolios
@@ -91,15 +105,6 @@ Partial Class ListadoContratos
ObjFolios.Dispose()
End If
- 'Agregamos Contrato
- Dim ObjContratos As New ClsContratos
- ObjContratos.IniciaTransacSQL()
- If ObjContratos.AddContratos(LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=34, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text) > 0 Then
- ObjContratos.Commit()
- Alert("Agregado Correctamente.")
- End If
- ObjContratos.Dispose()
-
'Reiniciamos modal
TxtDescripcion.Text = ""
TxtFechaSalida.Text = ""
@@ -112,10 +117,11 @@ Partial Class ListadoContratos
TxtPesos.Text = ""
TxtAnticipo.Text = ""
TxtCantidadPasajeros.Text = ""
+ LbArchivo.Text = ""
UpModal.Update()
CargaDatos()
-
+ RegistraScript("$('#ModalAgregar').modal('hide')", "hidemodal1")
End Sub
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
@@ -153,4 +159,35 @@ Partial Class ListadoContratos
GvContratos.Columns(8).Visible = ChkUnidad.Checked
UpTitulos.Update()
End Sub
+ Protected Sub GuardarArchivo(sender As Object, e As EventArgs)
+ Dim FileExtension As String = "-1"
+ Dim Filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
+ Dim Filename As String = ""
+ Dim folderContratosPath As String = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos")
+
+ 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
+
+ For Each fileItem As Archivo In Filesgral
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ 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 = fileItem.filenameO
+ Next
+
+ UpModal.Update()
+ RegistraScript("$('#ModalUpload').modal('hide')", "hidemodal1")
+ End Sub
End Class
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 527c0b11f..25bdaabd5 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -1613,7 +1613,7 @@
Amort. Ant.:
-
+
@@ -10247,7 +10247,7 @@
$get("HdnTipoDescuento").value = "3";
//si es con.nc,es.el.total
- var Total = ToDouble($get(TipoAnticipo == 2 ? 'TxtTotal' : 'TxtSubTotal').value);
+ var Total = ToDouble($get((TipoAnticipo == 2 || TipoAnticipo == 4) ? 'TxtTotal' : 'TxtSubTotal').value);
var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (ToDouble($get('HdnCveVenta').value) == 0) SaldoCompra = Total;
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 5fad3f3ff..d40ab3a28 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -157,6 +157,15 @@ Partial Class Ventas
End Set
End Property
+ Private Property TmpDTAnticiposNCIxCCliente As DataTable
+ Get
+ Return If(IsNothing(ViewState("TmpDTAnticiposNCIxCCliente")), Nothing, CType(ViewState("TmpDTAnticiposNCIxCCliente"), DataTable))
+ End Get
+ Set(value As DataTable)
+ ViewState("TmpDTAnticiposNCIxCCliente") = value
+ End Set
+ End Property
+
Private Property TmpDTError As DataTable
Get
Return If(IsNothing(ViewState("TmpDTError")), Nothing, CType(ViewState("TmpDTError"), DataTable))
@@ -2311,6 +2320,21 @@ Partial Class Ventas
End Property
+ Public Property CveAlamcenFiltroDdl As Integer
+ Get
+ If ViewState("CveAlamcenFiltroDdl") Is Nothing Then
+ ViewState("CveAlamcenFiltroDdl") = -1
+ End If
+ Return ViewState("CveAlamcenFiltroDdl").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("CveAlamcenFiltroDdl") = value
+ End Set
+ End Property
+
+
+
+
#Region "VENTA MEDICA"
Property EsVentaMedica As Boolean
@@ -2572,7 +2596,7 @@ Partial Class Ventas
ImgDescTotal.Visible = False
ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '2'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = ''; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = 'none'; $get('BtnAplicarDescG').style.display = ''; $get('TrMotivoDescuento').style.display = '';")
- ImgAntiPend.Attributes.Add("onclick", "$get('HdnTipoDescuento').value = '3'; MuestraAnticipos();")
+ 'ImgAntiPend.Attributes.Add("onclick", "$get('HdnTipoDescuento').value = '3'; MuestraAnticipos();")
ImgOtrosConceptos.Attributes.Add("onclick", "javascript:$('#ModalOtrosConceptos').modal();")
'LkbAgregarComplementos.Attributes.Add("onclick", "javascript:$('#ModalComplementos').modal();")
'ImgCerrar.Attributes.Add("OnClick", "$('#DivAnticipos').hide();")
@@ -4913,6 +4937,13 @@ Partial Class Ventas
End If
End If
+
+
+ If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
+ TxtAlfa1.Text = DbRowVenta("Alfa1").ToString
+ End If
+
+
End Using
End If
@@ -8041,8 +8072,16 @@ Partial Class Ventas
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1")
End If
+
+ If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
+ Objeto.Attributes.Add("data-CveAlmacen", $"{CveAlamcenFiltroDdl}")
+ Objeto.ddlWS.Attributes.Add("data-CveAlmacen", $"{CveAlamcenFiltroDdl}")
+ End If
+
End If
+
+
End Sub
Private Sub CargaPSRemision(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost)
@@ -13471,7 +13510,17 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso EsVentaMedica Then
- CveAlmacenTraspasoDestino = CveAlmacenAsignado
+ If DdlSucursalCliente.SelectedValue.ToEntero > 0 Then
+ Dim objclientes As New ClsClientes
+ If objclientes.GetSucursales(CveCliente, -1) Then
+ CveAlmacenTraspasoDestino = objclientes.DtResultados.FiltroPrimeroValor("CveAlmacenAsignado", $" CveClienteSucursal = {DdlSucursalCliente.SelectedValue.ToEntero}").ToEntero
+ End If
+ objclientes.Dispose()
+ End If
+
+ If Not CveAlmacenTraspasoDestino > 0 Then
+ CveAlmacenTraspasoDestino = CveAlmacenAsignado
+ End If
If RBLTipoVenta.SelectedValue.ToEntero = 2 Then
If Not ChkRequiereTecnico.Checked Then
@@ -14785,6 +14834,11 @@ Partial Class Ventas
Next
Else
+
+ 'If DdlTipoAmortizacionAnticipo.SelectedValue <> "4" Then
+
+ 'End If
+
For Each row2 As GridViewRow In GVAnticipos.Rows
If row2.DataKey("CveConceptoContable").ToString().ToEntero() = 12 Then
@@ -15370,6 +15424,49 @@ Partial Class Ventas
End If
End If
+
+ 'If Not ErrorPrepoliza AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso ObjFactura.TipoDocto = "Ing" AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" AndAlso ObjFactura.CveMoneda = 1 Then
+
+ ' For Each row2 As GridViewRow In GVAnticipos.Rows
+ ' If row2.DataKey("CveConceptoContable").ToString().ToEntero() = 12 Then
+ ' If row2.FCCheckBox("Chk" & row2.RowIndex).Checked Then
+
+ ' importeMovimiento = row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal '- ((row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal) * row2.DataKey("IVAAnticipo").ToDecimal)
+
+ ' Dim ImporteAnticipo As Decimal = importeMovimiento
+ ' Dim CveMonedaAnticipo As Integer = row2.DataKey("CveMoneda").ToString().ToEntero()
+
+ ' Dim ObjFacturaRef As New Modelos.Factura(UsuarioActual, row2.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDTDetalle:=False, VerificaAlmacen:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False)
+
+ ' Dim ventaRef As New Venta(ObjFacturaRef, UsuarioActual)
+
+ ' ObjFacturaRef.Dispose()
+
+ ' If ventaRef.TipoDocto = "Dev" Then
+ ' Dim Pago As New VentaPago
+ ' Pago.Fecha = ObjFactura.Fecha
+ ' Pago.FechaDocumentoRelacionado = ObjFactura.Fecha
+ ' Pago.ImportePagoVenta = importeMovimiento
+ ' Pago.ImportePago = importeMovimiento
+ ' Pago.CveMonedaPago = ObjFactura.CveMoneda
+ ' Pago.TCPago = ObjFactura.TipoCambio
+ ' Pago.TipoPago = "NC"
+ ' Pago.CveVentaAmortizacion = ObjFactura.CveVenta 'Dr("CveVenta").ToString().ToEntero()
+ ' Pago.AplicaTraslado = False
+ ' Pago.Referencia = Concepto
+ ' 'Pago.CveConceptoPago = 251
+ ' ErrorPrepoliza = AplicaPrePolizaPagoVenta(ventaRef, Pago, ObjFactura.CvePrePoliza, ObjConta)
+
+ ' Else
+ ' ErrorPrepoliza = True
+ ' ErrorList.Add("No se puede aplicar un documento diferente a una devolución")
+ ' End If
+
+ ' End If
+ ' End If
+ ' Next
+ 'End If
+
If ObjConta.ValidacionesPrePoliza(ObjFactura.CvePrePoliza, UsuarioActual, Opcion:=2, AutoConta:=AutoConta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
If ObjConta.ValorPolizaDescuadre = 2 Then
@@ -16054,7 +16151,9 @@ Partial Class Ventas
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente) Then
- Dim DtMovtos As DataTable = ObjMovtos.DtResultados.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}")
+ Me.TmpDTAnticiposNCIxCCliente = ObjMovtos.DtResultados.Copy()
+ Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}")
+
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
DtMovtos = DtMovtos.FiltraParametros($"{If(CveVenta < 0, $"Tipo = 'Ant'{If(DdlTipoComprobante.SelectedValue = "Ing", $" AND CveMoneda ={DdlMoneda.SelectedValue.ToEntero()}", "")} ", "")}")
End If
@@ -16161,7 +16260,7 @@ Partial Class Ventas
saldo = e.Row.DataKey("Saldo").ToString().ToDecimal
If CveVenta <= 0 Then
- If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then 'cuando es por NC, debe de tomar el total de su saldo respectivo
+ If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("2") Then 'cuando es por NC, debe de tomar el total de su saldo respectivo
saldo = e.Row.DataKey("SaldoConImpuestos").ToString().ToDecimal
Else
saldo = e.Row.DataKey("SaldoSubTotal").ToString().ToDecimal
@@ -16173,6 +16272,10 @@ Partial Class Ventas
e.Row.FCLiteral("LtlAnticipos").Text = saldo.FormatoNumero
End If
+ If CveVenta <= 0 AndAlso DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("4") Then
+ saldo = e.Row.DataKey("Saldo").ToString().ToDecimal
+ End If
+
End If
saldo = saldo.RoundSQL()
@@ -16466,7 +16569,7 @@ Partial Class Ventas
'cuando no se ha registrado la venta
- If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("1", "2", "3") Then
+ If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("1", "2", "3", "4") Then
Dim Amortizacion As Decimal = 0
Dim ImpuestosLocalesTemporal As Decimal = 0
@@ -16612,6 +16715,27 @@ Partial Class Ventas
HdnTieneAnticiposVinculados.Value = "1"
End If
+
+
+ 'cuando es PAGO CON DEVOLUCION
+ If DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then
+
+ For Each gvr As GridViewRow In GVAnticipos.Rows
+ If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(12) Then
+ Amortizacion += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal ' - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo").ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)
+ End If
+ Next
+
+ LblAntAplicados.Text = String.Format("Pago con devolución: {0:C}", Amortizacion) : LblAntAplicados.Visible = True
+ HdnAnticipos.Value = Amortizacion.RoundSQL(2).ToString()
+ Amortizacion = 0
+ HdnTipoDescuento.Value = "-1"
+ HdnDescuento.Value = "0"
+ RegistraScript("BorraDescuentos();")
+ HdnTieneAnticiposVinculados.Value = "1"
+ End If
+
+
CalculaTotalesVenta(ValidarDescuentos:=True)
End If
End If
@@ -21505,22 +21629,24 @@ Partial Class Ventas
Exit Sub
End If
- Dim ObjContrato As New ClsContratos
- If ObjContrato.GetEstimacionesPorFacturar(-1, CveCliente, DdlContrato.SelectedValue.ToEntero(), 0, UsuarioActual.CveEmpresa) Then
- GvEst.DataSource = ObjContrato.DtResultados
- If ObjContrato.DtResultados.Rows.Count > 0 Then
- 'BtnEstimacion.Visible = True
- DdlContrato.Items.Clear()
- DdlContrato.Items.Add(New ListItem("Todos", "-1"))
- DdlContrato.DataSource = ObjContrato.DtResultados.FiltraParametros("CveContrato > 0", "NumeroContrato", DistinctColumns:={"CveContrato", "NumeroContrato"})
+ If DdlContrato.SelectedValue.ToEntero() > 0 Then
+ Dim ObjContrato As New ClsContratos
+ If ObjContrato.GetEstimacionesPorFacturar(-1, CveCliente, DdlContrato.SelectedValue.ToEntero(), 0, UsuarioActual.CveEmpresa) Then
+ GvEst.DataSource = ObjContrato.DtResultados
+ If ObjContrato.DtResultados.Rows.Count > 0 Then
+ 'BtnEstimacion.Visible = True
+ DdlContrato.Items.Clear()
+ DdlContrato.Items.Add(New ListItem("Todos", "-1"))
+ DdlContrato.DataSource = ObjContrato.DtResultados.FiltraParametros("CveContrato > 0", "NumeroContrato", DistinctColumns:={"CveContrato", "NumeroContrato"})
+ End If
End If
+
+ ObjContrato.Dispose()
+
+ DdlContrato.DataBind()
+ GvEst.DataBind()
End If
- ObjContrato.Dispose()
-
- DdlContrato.DataBind()
- GvEst.DataBind()
-
UPEstimaciones.Update()
End Sub
@@ -30502,6 +30628,22 @@ Partial Class Ventas
divAnticipoMsg.Visible = False
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ If DdlTipoComprobante.SelectedValue = "Ing" AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then
+ Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 And SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'NC' ", "")}")
+ divAmortizacionTipoRelacion.Visible = False
+ GVAnticipos.DataSource = DtMovtos
+ GVAnticipos.DataBind()
+ Else
+ Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}")
+ divAmortizacionTipoRelacion.Visible = True
+ If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
+ DtMovtos = DtMovtos.FiltraParametros($"{If(CveVenta < 0, $"Tipo = 'Ant'{If(DdlTipoComprobante.SelectedValue = "Ing", $" AND CveMoneda ={DdlMoneda.SelectedValue.ToEntero()}", "")} ", "")}")
+ End If
+ End If
+ End If
+
+
If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("1", "2") Then
'cuando es amortización por descuento, debe tener seleccionado descuentos previamente registrados
If DdlTipoAmortizacionAnticipo.SelectedValue = "1" AndAlso LblDescuentos.Text.ToDecimal <= 0 Then
@@ -36461,9 +36603,10 @@ Partial Class Ventas
DdlProcedimiento.SelectedValueExist(dRow("CveProcedimiento").ToString.ToEntero)
TxtPaciente.Text = dRow("Paciente").ToString
TxtEpisodio.Text = dRow("Episodio").ToString
- SeEstaFActurandoVentaMedica = True
+ TxtAlfa1.Text = dRow("Alfa1").ToString
CveTipoVenta = dRow("CveTipoVenta").ToString.ToEntero
ChkRequiereTecnico_CheckedChanged(Nothing, Nothing)
+ SeEstaFActurandoVentaMedica = True
End If
objVenta.Dispose()
End If
@@ -36533,34 +36676,6 @@ Partial Class Ventas
End Sub
- 'Private Sub CargaSucursalesModal(CveClienteSeleccionado As Integer)
-
- ' DdlSucursalClienteModal.Items.Clear()
- ' DdlSucursalClienteModal.ClearSelection()
- ' DdlSucursalClienteModal.SelectedValue = Nothing
-
- ' Dim ObjCliente As New ClsClientes
- ' If ObjCliente.GetSucursales(CveClienteSeleccionado) Then
- ' DdlSucursalClienteModal.DataSource = ObjCliente.DtResultados
- ' If ObjCliente.DtResultados.Rows.Count > 0 Then
- ' DvModalClientesucursal.Visible = True
- ' Else
- ' DvModalClientesucursal.Visible = False
- ' End If
- ' Else
- ' DvModalClientesucursal.Visible = False
- ' DdlSucursalClienteModal.DataSource = Nothing
- ' End If
- ' ObjCliente.Dispose()
-
- ' DdlSucursalClienteModal.DataBind()
- ' DdlSucursalClienteModal.Items.Insert(0, New ListItem("Matriz", "-1"))
-
- ' UpDvModalTipoVenta.FindDataSourceControl
-
- 'End Sub
-
-
Private Sub CargaDdlClientesSucursal()
@@ -36657,13 +36772,6 @@ Partial Class Ventas
UpDvModalTipoVenta.Update()
End Sub
- 'Protected Sub DdlClientesWS_selectedindexchange(sender As Object, e As EventArgs)
-
- ' CargaPSProcedimiento(DdlProcedimiento.SelectedValue.ToEntero, DdlClientesWS.SelectedValue.ToEntero, DdlSubProyectoDatos.SelectedValue.ToEntero)
- ' 'CargaSucursalesModal(DdlClientesWS.SelectedValue.ToEntero)
-
- 'End Sub
-
Protected Sub DdlClienteSucursal_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim CveClienteSplit As Integer = -1
@@ -36727,9 +36835,7 @@ Partial Class Ventas
ChkRequiereTecnicoModal.Enabled = True
- 'DdlClientesWS.txtText.Value = ""
- 'DdlClientesWS.txtValue.Value = ""
- 'DdlClientesWS.ddl.SelectedValueExist(-1)
+
DdlClienteSucursal.SelectedValueExist(-1)
DvModalRequiereOSFecha.Visible = False
@@ -36791,8 +36897,6 @@ Partial Class Ventas
End If
End If
-
-
For Each GvRow As GridViewRow In GvProductosProcedimiento.Rows
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
@@ -36874,6 +36978,9 @@ Partial Class Ventas
End If
+
+
+
DdlTipoComprobante.Enabled = False
CargaCliente(CveCliente)
@@ -36926,10 +37033,17 @@ Partial Class Ventas
UpParametros.Update()
End If
+ If RBLTipoVenta.SelectedValue.Contiene("5", "6") Then
+ AsignaAlamacenWS()
+ CargaPS(-1, DdlPS)
+ End If
+
RegistraScript("$('#DvModalTipoVenta').modal('hide');")
UpCliente.Update()
End Sub
+
+
Protected Sub GvProductosProcedimiento_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DataKey("Precio").ToDecimal = 0 Then
@@ -37089,6 +37203,27 @@ Partial Class Ventas
CargaProcedimientos(HdnCveProcedimientoNuevo.Value.ToEntero)
End Sub
+ Private Sub AsignaAlamacenWS()
+
+ CveAlamcenFiltroDdl = -1
+
+ If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
+ If DdlSucursalCliente.SelectedValue.ToEntero > 0 Then
+ Dim objclientes As New ClsClientes
+ If objclientes.GetSucursales(CveCliente, -1) Then
+ CveAlamcenFiltroDdl = objclientes.DtResultados.FiltroPrimeroValor("CveAlmacenAsignado", $" CveClienteSucursal = {DdlSucursalCliente.SelectedValue.ToEntero}").ToEntero
+ End If
+ objclientes.Dispose()
+ End If
+ If Not CveAlamcenFiltroDdl > 0 Then
+ CveAlamcenFiltroDdl = If(CveAlmacenAsignado > 0, CveAlmacenAsignado, -1)
+ End If
+
+ End If
+
+ End Sub
+
+
#End Region
'Protected Sub LnkCancelarSoloCFDI_Click(sender As Object, e As EventArgs)
@@ -37215,5 +37350,26 @@ Partial Class Ventas
End If
End Using
End Sub
+ Protected Sub ImgAntiPend_Click(sender As Object, e As EventArgs)
+ ' $get('HdnTipoDescuento').value = '3'; MuestraAnticipos();
+ HdnTipoDescuento.Value = "3"
+
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ If DdlTipoAmortizacionAnticipo.Items.FindByValue("4") Is Nothing Then
+ DdlTipoAmortizacionAnticipo.Items.Insert(1, New ListItem("Pago con devolución", "4"))
+ End If
+ DdlTipoAmortizacionAnticipo.SelectedValueExist("4")
+
+ DdlTipoRelacionAnticipo.SelectedValueExist("-1")
+
+ DdlTipoAmortizacionAnticipo_SelectedIndexChanged(DdlTipoAmortizacionAnticipo, EventArgs.Empty)
+
+ divAmortizacionTipoRelacion.Visible = False
+ End If
+
+ UpAnticipos.Update()
+
+ RegistraScript("MuestraAnticipos();", "AE")
+ End Sub
End Class