Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -6320,6 +6320,27 @@ Public Class ClsInventarios
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Function GetValidaFechaAlmacen(CveEmpresa As Integer, CveAlmacen As Integer, CvePS As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Inv_ValidaFechaAlmacenGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al consultar los productos por fechas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#Region " IDisposable Support "
|
||||
' IDisposable
|
||||
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
||||
@@ -6352,6 +6373,8 @@ Public Class ClsInventarios
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
@@ -2493,13 +2493,14 @@ Public Class ClsOIEventos
|
||||
Optional RecurrenciaTipo As Integer = -1, Optional Frecuencia As Integer = -1, Optional DiasSemana As String = "-1", Optional Dia As Integer = -1, Optional Mes As Integer = -1,
|
||||
Optional RecurrenciaFin As String = "-1", Optional CveTipoEvento As Integer = 2, Optional Importe As Double = -1,
|
||||
Optional CveEmpresaCRM As Integer = -1, Optional CveContactoCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1,
|
||||
Optional CveSubProyecto As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveCompra As Integer = -1, Optional CveVenta As Integer = -1, Optional CveMovimiento As Integer = -1) As Boolean
|
||||
Optional CveSubProyecto As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveCompra As Integer = -1, Optional CveVenta As Integer = -1, Optional CveMovimiento As Integer = -1,
|
||||
Optional CveContrato As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
Retorno = AddEvento(CveTipoEvento, CveAgendaTipo, Asunto, Descripcion, Prioridad, CveUsuarioPara, CveUsuarioIng, FechaInicio, FechaFin, -1, -1, "-1", CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC,
|
||||
CvePersonal, CveProveedor, CveEventoPadre:=CveEventoPadre, RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dia, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, Importe:=Importe,
|
||||
CveEmpresaCRM:=CveEmpresaCRM, CveContactoCRM:=CveContactoCRM, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoProcesoCRM:=CveTipoProcesoCRM, CveEtapaProcesoCRM:=CveEtapaProcesoCRM, CveSubProyecto:=CveSubProyecto, CveCompra:=CveCompra,
|
||||
CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento)
|
||||
CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, CveContrato:=CveContrato)
|
||||
|
||||
|
||||
Return Retorno
|
||||
|
||||
@@ -4481,6 +4481,10 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ValidaFechaDeAlamacen() Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(538) = "1" Then
|
||||
@@ -7803,6 +7807,54 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ValidaFechaDeAlamacen() As Boolean
|
||||
Dim respuesta As Boolean = False
|
||||
|
||||
|
||||
|
||||
Dim objInventario As New ClsInventarios
|
||||
Dim MovimientosError As Boolean = False
|
||||
|
||||
'Dim SB As New StringBuilder
|
||||
'Dim FechaCompra As DateTime = TxtFecha.Text.ToDate
|
||||
'FechaCompra
|
||||
Dim FechaMinima As DateTime = TxtFecha.Text.ToDate
|
||||
|
||||
If DtInv IsNot Nothing Then
|
||||
For Each Dr As DataRow In TmpDT.Rows
|
||||
|
||||
Dim CveTipoPS As Integer = Dr("CveTipoPS").ToString.ToEntero
|
||||
|
||||
If CveTipoPS = 2 Then
|
||||
If objInventario.GetValidaFechaAlmacen(CveEmpresa:=UsuarioActual.CveEmpresa, CveAlmacen:=ddlAlmacenAdd.SelectedValue.ToEntero, CvePS:=Dr("CvePS").ToString.ToEntero) Then
|
||||
|
||||
If objInventario.DtResultados IsNot Nothing AndAlso objInventario.DtResultados.Rows.Count > 0 Then
|
||||
Dim FechamoMovimiento As DateTime = objInventario.DtResultados(0)("FechaMovto").ToString.ToDate
|
||||
If FechamoMovimiento > FechaMinima Then
|
||||
FechaMinima = FechamoMovimiento
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
objInventario.Dispose()
|
||||
|
||||
If FechaMinima > TxtFecha.Text.ToDate Then
|
||||
Alert($"Los productos tienen movientos, la fecha minima que se puede aplicar es {FechaMinima.ToString("dd/MM/yyyy HH:mm")}", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Return respuesta
|
||||
|
||||
End Function
|
||||
|
||||
Private Function GeneraStrinDoctosRelacionados() As String
|
||||
|
||||
Dim DoctosRelacionados As String = "-1"
|
||||
|
||||
@@ -107,6 +107,32 @@ Partial Class PopUpVerFactura
|
||||
ImprimeFormatoCartaPorteTimbrado(Request("CVETIMBRE").ToString.ToEntero)
|
||||
End If
|
||||
|
||||
If Request("ArchivoContrato") IsNot Nothing AndAlso Request("ArchivoContrato") IsNot Nothing Then
|
||||
|
||||
Dim ArchivoContrato As String = Decripta(Request("ArchivoContrato"))
|
||||
Dim File As New FileInfo(ArchivoContrato)
|
||||
|
||||
If File.Exists Then 'set appropriate headers
|
||||
|
||||
Response.Clear()
|
||||
Response.ClearHeaders()
|
||||
Response.ClearContent()
|
||||
Response.AddHeader("Content-Disposition", "inline; filename=" & $"{File.Name}")
|
||||
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()
|
||||
|
||||
Else
|
||||
|
||||
Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()")
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
If Request("RFC") IsNot Nothing AndAlso Request("File") IsNot Nothing Then
|
||||
Dim Path As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, Request("RFC"), Request("File"))
|
||||
Dim Archivo As New System.IO.FileInfo(Path)
|
||||
@@ -4485,6 +4511,26 @@ Partial Class PopUpVerFactura
|
||||
params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/SalidaDemostracion.rdlc", DtMovimientos, params, String.Format("Salida por Demostración - {0}", Folio.ToString), RDSName:="DsInventarios")
|
||||
Else
|
||||
|
||||
params.Add(New ReportParameter("LogoPath", RutaImagenLogo))
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
|
||||
params.Add(New ReportParameter("Direccion", UsuarioActual.Empresa.Direccion))
|
||||
params.Add(New ReportParameter("CP", UsuarioActual.Empresa.CP))
|
||||
params.Add(New ReportParameter("Localidad", UsuarioActual.Empresa.Localidad))
|
||||
params.Add(New ReportParameter("Estado", UsuarioActual.Empresa.Estado))
|
||||
params.Add(New ReportParameter("Colonia", UsuarioActual.Empresa.Colonia))
|
||||
|
||||
params.Add(New ReportParameter("Concepto", "SALIDA POR DEMOSTRACIÓN"))
|
||||
params.Add(New ReportParameter("Folio", Folio))
|
||||
params.Add(New ReportParameter("Fecha", Fecha))
|
||||
params.Add(New ReportParameter("Observaciones", Observaciones))
|
||||
params.Add(New ReportParameter("Almacen", Almacen))
|
||||
params.Add(New ReportParameter("NombreRecibio", Recibio))
|
||||
params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
ImprimirPDF(RutaFormatoReporte("SalidaDemostracion.rdlc"), DtMovimientos, params, String.Format("Salida por Demostración - {0}", Folio.ToString), RDSName:="DsInventarios")
|
||||
End If
|
||||
Case 34, 35 ' S A L I D A S P O R A J U S T E --- S A L I D A M A N U A L
|
||||
'Dim Archivo As New System.IO.FileInfo(String.Format("Empresas/{0}/Formatos/Salidas.rdlc", 72))
|
||||
|
||||
@@ -9036,16 +9036,23 @@ Namespace ADS.eFacturas
|
||||
Try
|
||||
Dim listaDS As New List(Of ReportDataSource)
|
||||
Dim rdsTotales As New ReportDataSource()
|
||||
Dim ltotales As New List(Of utilValores)()
|
||||
'Dim ltotales As New List(Of utilValores)()
|
||||
|
||||
Dim DTTotales As New DataTable
|
||||
DTTotales.TableName = "DTTotales"
|
||||
DTTotales.Columns.Add("Nombre")
|
||||
DTTotales.Columns.Add("Valor")
|
||||
|
||||
ltotales.Add(New utilValores("Subtotal", objxml.comprobante.SubTotal.ToString("N2")))
|
||||
Dim nRowSubtotales As DataRow = DTTotales.NewRow
|
||||
nRowSubtotales("Nombre") = "Subtotal"
|
||||
nRowSubtotales("Valor") = objxml.comprobante.SubTotal.ToString("N2")
|
||||
DTTotales.Rows.Add(nRowSubtotales)
|
||||
|
||||
If objxml.comprobante.Descuento > 0 Then
|
||||
ltotales.Add(New utilValores("Descuento", objxml.comprobante.Descuento.ToString("N2")))
|
||||
Dim nRowDescuento As DataRow = DTTotales.NewRow
|
||||
nRowDescuento("Nombre") = "Descuento"
|
||||
nRowDescuento("Valor") = objxml.comprobante.Descuento.ToString("N2")
|
||||
DTTotales.Rows.Add(nRowDescuento)
|
||||
End If
|
||||
|
||||
For Each item As CFDIImpuesto In objxml.Impuestos
|
||||
@@ -9053,8 +9060,6 @@ Namespace ADS.eFacturas
|
||||
If item.Importe > 0 Then
|
||||
Dim TasaOCuota As Decimal = 0
|
||||
Decimal.TryParse(item.TasaOCuota, TasaOCuota)
|
||||
ltotales.Add(New utilValores($"Impuestos {item.Tipo} {item.ImpuestoTexto} {(If(item.TipoFactor = "Tasa", (TasaOCuota * 100).ToString("N4"), item.TasaOCuota))} {(If(item.TipoFactor = "Tasa", "%", ""))}", item.Importe.ToString("N2")))
|
||||
|
||||
nRow("Nombre") = $"Impuestos {item.Tipo} {item.ImpuestoTexto} {(If(item.TipoFactor = "Tasa", (TasaOCuota * 100).ToString("N4"), item.TasaOCuota))} {(If(item.TipoFactor = "Tasa", "%", ""))}"
|
||||
nRow("Valor") = item.Importe.ToString("N2")
|
||||
DTTotales.Rows.Add(nRow)
|
||||
@@ -9062,7 +9067,11 @@ Namespace ADS.eFacturas
|
||||
End If
|
||||
Next
|
||||
|
||||
ltotales.Add(New utilValores("Total", objxml.comprobante.Total.ToString("N2")))
|
||||
Dim nRowTotal As DataRow = DTTotales.NewRow
|
||||
nRowTotal("Nombre") = "Subtotal"
|
||||
nRowTotal("Valor") = objxml.comprobante.Total.ToString("N2")
|
||||
DTTotales.Rows.Add(nRowTotal)
|
||||
|
||||
rdsTotales.Name = "dsTotales"
|
||||
rdsTotales.Value = DTTotales 'ltotales.ToDataTable
|
||||
listaDS.Add(rdsTotales)
|
||||
|
||||
1736
Empresas/186/Formatos/SalidaDemostracion.rdlc
Normal file
1736
Empresas/186/Formatos/SalidaDemostracion.rdlc
Normal file
File diff suppressed because it is too large
Load Diff
@@ -694,7 +694,7 @@
|
||||
<Value>Logo</Value>
|
||||
<Sizing>FitProportional</Sizing>
|
||||
<Top>0.12668cm</Top>
|
||||
<Left>0.07701cm</Left>
|
||||
<Left>0.11112cm</Left>
|
||||
<Height>2.58833cm</Height>
|
||||
<Width>4.20283cm</Width>
|
||||
<Style>
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
<DataField>Codigo</DataField>
|
||||
<rd:TypeName>System.String</rd:TypeName>
|
||||
</Field>
|
||||
<Field Name="NumeroParte">
|
||||
<Field Name="NumeroParte">
|
||||
<DataField>NumeroParte</DataField>
|
||||
<rd:TypeName>System.String</rd:TypeName>
|
||||
</Field>
|
||||
</Field>
|
||||
<Field Name="PS">
|
||||
<DataField>PS</DataField>
|
||||
<rd:TypeName>System.String</rd:TypeName>
|
||||
@@ -2484,7 +2484,6 @@ Municipio y/o Delegación: </Value>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<Line Name="Line5">
|
||||
<Top>0cm</Top>
|
||||
<Left>0.13678cm</Left>
|
||||
<Height>0cm</Height>
|
||||
<Width>20.28859cm</Width>
|
||||
@@ -2496,7 +2495,6 @@ Municipio y/o Delegación: </Value>
|
||||
</Style>
|
||||
</Line>
|
||||
<Line Name="Line4">
|
||||
<Top>0cm</Top>
|
||||
<Left>0.13678cm</Left>
|
||||
<Height>0cm</Height>
|
||||
<Width>25.72414cm</Width>
|
||||
|
||||
1431
Empresas/Grales/Formatos/Salida.rdlc
Normal file
1431
Empresas/Grales/Formatos/Salida.rdlc
Normal file
File diff suppressed because it is too large
Load Diff
1663
Empresas/Grales/Formatos/SalidaDemostracion.rdlc
Normal file
1663
Empresas/Grales/Formatos/SalidaDemostracion.rdlc
Normal file
File diff suppressed because it is too large
Load Diff
2634
Empresas/Grales/Formatos/rptChequeMovimientosPrePoliza.rdlc
Normal file
2634
Empresas/Grales/Formatos/rptChequeMovimientosPrePoliza.rdlc
Normal file
File diff suppressed because it is too large
Load Diff
@@ -716,6 +716,12 @@ Partial Class OI_PopUpAgenda
|
||||
CveMovimiento = Request("CveMovimiento").ToEntero
|
||||
End If
|
||||
|
||||
Dim CveContrato As Integer = -1
|
||||
If Request("CveContrato") IsNot Nothing AndAlso IsNumeric(Request("CveContrato")) AndAlso Request("CveContrato").ToEntero > 0 Then
|
||||
CveContrato = Request("CveContrato").ToEntero
|
||||
End If
|
||||
|
||||
|
||||
'------------------------------------------
|
||||
'Recorrro Grid para obtener el usuario PARA
|
||||
For Each RowPara As GridViewRow In GVUsuarios.Rows
|
||||
@@ -741,7 +747,7 @@ Partial Class OI_PopUpAgenda
|
||||
Alert("La Nueva Tarea se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ElseIf CveTipoEvento = 2 Then
|
||||
If ObjEventos.AddEventoAgenda(CveAgendaTipo, Asunto, Descripcion, Prioridad, FechaInicio.ToDateTime, FechaFin.ToDateTime, CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveCompra:=CveCompra, CveVenta:=CveVenta, CveMovimiento:=CveMovimiento) Then
|
||||
If ObjEventos.AddEventoAgenda(CveAgendaTipo, Asunto, Descripcion, Prioridad, FechaInicio.ToDateTime, FechaFin.ToDateTime, CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveCompra:=CveCompra, CveVenta:=CveVenta, CveMovimiento:=CveMovimiento, CveContrato:=CveContrato) Then
|
||||
Alert("La Nueva Agenda se guardó correctamente.", TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();")
|
||||
End If
|
||||
ElseIf CveTipoEvento = 3 Then
|
||||
|
||||
@@ -1539,8 +1539,18 @@ Partial Class RH_Personal
|
||||
|
||||
Private Sub CargaOutSourcing()
|
||||
|
||||
Dim DtModulosEmpresa As New DataTable
|
||||
Dim ObjEmpresas As New ClsSisEmpresas
|
||||
If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
|
||||
DtModulosEmpresa = ObjEmpresas.DtResultados
|
||||
Else
|
||||
DtModulosEmpresa = Nothing
|
||||
End If
|
||||
ObjEmpresas.Dispose()
|
||||
|
||||
|
||||
If UsuarioActual.CveEmpresa = 7 Then
|
||||
DdlEmpresaAsignada.DataSource = GlobalDTEmpresas.FiltraParametros("CveEmpresa in (7,11,12,122,145,113)")
|
||||
DdlEmpresaAsignada.DataSource = DtModulosEmpresa.FiltraParametros("CveEmpresa in (7,11,12,122,145,113)")
|
||||
DdlEmpresaAsignada.DataBind()
|
||||
DvOutsourcing.Visible = True
|
||||
End If
|
||||
|
||||
@@ -20,7 +20,10 @@
|
||||
<div class="titlefiltros caption ">
|
||||
<ul class="list-inline">
|
||||
<li>Empresa:
|
||||
<asp:DropDownList ID="DdlEmpresa" AutoPostBack="true" runat="server" AppendDataBoundItems="true" DataTextField="Empresa" DataValueField="CveEmpresa" CssClass=" select2me table-group-action-input form-control input-inline input-small input-sm" Style="width: 400px !important;" ValidationGroup="GrpGuardar">
|
||||
<asp:DropDownList ID="DdlEmpresa" AutoPostBack="true" runat="server" AppendDataBoundItems="true" DataTextField="Empresa" DataValueField="CveEmpresa"
|
||||
CssClass=" select2me table-group-action-input form-control input-inline input-small input-sm" Style="width: 400px !important;" ValidationGroup="GrpGuardar"
|
||||
OnSelectedIndexChanged="DdlEmpresa_SelectedIndexChanged"
|
||||
>
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
|
||||
@@ -47,14 +47,23 @@ Partial Class Sistemas_EmpresasModulos
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Private Sub CargarEmpresa()
|
||||
|
||||
Dim DTEmpresas As New DataTable
|
||||
|
||||
Using ObjEmpresas As New ClsSisEmpresas()
|
||||
If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
|
||||
DTEmpresas = ObjEmpresas.DtResultados
|
||||
End If
|
||||
End Using
|
||||
|
||||
If UsuarioActual.CveRol <> 1 Then
|
||||
DdlEmpresa.DataSource = GlobalDTEmpresas
|
||||
DdlEmpresa.DataSource = DTEmpresas
|
||||
DdlEmpresa.Enabled = False
|
||||
Else
|
||||
DdlEmpresa.DataSource = GlobalDTEmpresas
|
||||
DdlEmpresa.DataSource = DTEmpresas
|
||||
End If
|
||||
|
||||
DdlEmpresa.SelectedValue = UsuarioActual.CveEmpresa.ToString
|
||||
DdlEmpresa.SelectedValueExist(UsuarioActual.CveEmpresa.ToString)
|
||||
DdlEmpresa.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaModulosEmpresa()
|
||||
@@ -71,7 +80,13 @@ Partial Class Sistemas_EmpresasModulos
|
||||
End Sub
|
||||
|
||||
Private Sub CargaModulosDisponible()
|
||||
Dim DtModulosDisponible As DataTable = GlobalDTModulos().FiltraParametros("Liga <> ''")
|
||||
Dim DtModulosDisponible As New DataTable '= GlobalDTModulos().FiltraParametros("Liga <> ''")
|
||||
|
||||
Using ObjModulos As New ClsModulos
|
||||
If ObjModulos.GetModulos(-1, -1, "-1", "-1") Then
|
||||
DtModulosDisponible = ObjModulos.DtResultados
|
||||
End If
|
||||
End Using
|
||||
|
||||
Dim rowsToDelete = From r1 In DtModulosDisponible.AsEnumerable()
|
||||
Join r2 In DtModulosEmpresa.AsEnumerable() On r1.Field(Of Integer)("CveModulo") Equals r2.Field(Of Integer)("CveModulo")
|
||||
@@ -150,4 +165,8 @@ Partial Class Sistemas_EmpresasModulos
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Protected Sub DdlEmpresa_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
consultar_Click(Nothing, Nothing)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
#C_Tab_ctl00_DdlClientes{
|
||||
width:100%!important;
|
||||
}*/
|
||||
|
||||
.font-light {
|
||||
color:#666666;
|
||||
}
|
||||
.mx-1 {
|
||||
margin: 0 5px 0 5px;
|
||||
}
|
||||
@@ -127,12 +131,7 @@
|
||||
<div class="row my-1">
|
||||
<label class="col-md-4 bold text-primary">Folio</label>
|
||||
<asp:TextBox class="col-md-2" runat="server" ID="TxtFolio" Text="" MaxLength="50" style="margin-left:15px" Width="120px" Height="34px"></asp:TextBox>
|
||||
<div class="col-md-2">
|
||||
<asp:HyperLink runat="server" Text="" Target="_blank" id="HypRemision" CssClass="Texto"></asp:HyperLink>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label runat="server" ID="LblSaldo"></asp:Label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row " style="border:0px!important">
|
||||
@@ -358,61 +357,211 @@
|
||||
</div>
|
||||
<%-- Contrato Digitalizado --%>
|
||||
<div class="col-md-5">
|
||||
<div class="portlet light bordered xspadding">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand1" class=" collapse" data-original-title=""
|
||||
title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand1" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
<i class="fa fa-file-pdf-o"></i>Contrato Digitalizado
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<asp:UpdatePanel ID="UPAFUL" runat="server" UpdateMode="Conditional">
|
||||
<div class="portlet light bordered xspadding">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand1" class=" collapse" data-original-title=""
|
||||
title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand3" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
<i class="fa fa-money"></i>Pagos
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" ID="BtnDescargar" class="btn btn-warning" Visible="false"><i class='fa fa-download' aria-hidden='true'></i> Descargar</asp:LinkButton>
|
||||
<asp:TextBox Style="display: none" ID="TxtArchivo" ClientIDMode="Static" runat="server"
|
||||
Width="200px"></asp:TextBox>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<asp:UpdatePanel ID="UpPagos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<button type="button" class="btn btn-primary" runat="server" clientidmode="Static"
|
||||
id="Button1" data-toggle="modal" data-target="#ModalUpload" visible="true">
|
||||
<i class="fa fa-upload"
|
||||
aria-hidden="true"></i>Subir Archivo</button>
|
||||
<div class="row" runat="server" visible="false" id="DVFactura">
|
||||
<label class="col-md-2">Factura: </label>
|
||||
<div class="col-md-2">
|
||||
<asp:HyperLink runat="server" Text="" Target="_blank" id="HypRemision" CssClass="Texto"></asp:HyperLink>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label runat="server" ID="LblSaldo"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GVAuxiliar" runat="server" AutoGenerateColumns="False" ShowFooter="true"
|
||||
DataKeyNames="CvePrePoliza, Cargo, Abono, CveReferencia, IdPoliza,CvePrePolizaOriginal,TipoReferencia"
|
||||
EmptyDataText="No se encontraron pagos" ToolTip="Listado de Auxiliar Contable" CssClass="table table-striped table-advance table-hover mysmallbtn Widthall" GridLines="None"
|
||||
OnRowDataBound="GVAuxiliar_RowDataBound" >
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Folio</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplReferencia" runat="server" Text='<%# Eval("Referencia", "{0}") %>' Target="_blank"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaMovto" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="LbltotalText" runat="server" Text=""></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>Pago</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCargo" runat="server" Text='<%# If(CDbl(Eval("Abono")) = 0, "", Eval("Abono", "{0:N2}")) %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="Lbltotal" runat="server" Text=""></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnDescargar" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="portlet light bordered xspadding">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand1" class=" collapse" data-original-title=""
|
||||
title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand1" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
<i class="fa fa-file-pdf-o"></i>Contrato Digitalizado
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<asp:UpdatePanel ID="UPAFUL" runat="server" UpdateMode="Conditional">
|
||||
|
||||
<ContentTemplate>
|
||||
<asp:HyperLink target="_blank" runat="server" ID="BtnDescargar" class="btn btn-warning" Visible="false"><i class='fa fa-download' aria-hidden='true'></i> Descargar</asp:HyperLink>
|
||||
<asp:TextBox Style="display: none" ID="TxtArchivo" ClientIDMode="Static" runat="server"
|
||||
Width="200px"></asp:TextBox>
|
||||
|
||||
<button type="button" class="btn btn-primary" runat="server" clientidmode="Static"
|
||||
id="Button1" data-toggle="modal" data-target="#ModalUpload" visible="true">
|
||||
<i class="fa fa-upload"
|
||||
aria-hidden="true"></i>Subir Archivo</button>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<%-- Bitácora --%>
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light bordered xspadding">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand" class=" collapse" data-original-title=""
|
||||
title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand2" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
|
||||
<%--<div class="caption uppercase" style="position: relative;">
|
||||
<i class="fa fa-commenting"></i>Bitácora
|
||||
</div>
|
||||
|
||||
<div class="btn-group">
|
||||
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold font-green" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
|
||||
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold font-green" runat="server" Text=" <i class='fa fa-calendar-plus-o font-green' ></i>Agendar" Visible="false" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Agendar"></asp:HyperLink><br />
|
||||
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
|
||||
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
|
||||
</div>--%>
|
||||
<div class="caption font-default">
|
||||
<%--<i class="fa fa-users font-green"></i>--%>
|
||||
<span class="caption-subject bold uppercase">Bitacora</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold font-light " data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-light ' ></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important; cursor: pointer" ToolTip="Observaciones"></asp:HyperLink><br />
|
||||
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold font-light " runat="server" Text="" Visible="false" Style="font-weight: 700 !important; cursor: pointer" ToolTip="Agendar"><i class='fa fa-calendar-plus-o font-light ' ></i>Agendar</asp:HyperLink><br />
|
||||
|
||||
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
|
||||
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
|
||||
<%--<script> function OnAddedTareaNueva() { $('.btnupEventoBitacora').click(); }</script>--%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<asp:UpdatePanel ID="UPEventoBitacora" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvEventosBitacora" runat="server" AutoGenerateColumns="True"
|
||||
GridLines="None">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvEB" runat="server" AutoGenerateColumns="False" DataKeyNames="CveEvento" EmptyDataText="No se han capturado comentarios o bitácora" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha Agenda</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaAgenda" runat="server" Text='<%# Eval("FechaInicio") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Usuario</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Descripción</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEventoBitacora" runat="server" Text='<%# Eval("Descripcion") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="10px" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Archivo</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LinkArchivo" Visible="false" runat="server" CssClass="Texto" OnClick="DownloadFile">
|
||||
<asp:Image ImageUrl="/Imagenes/Abajo.png" ID="ImgArchivo" runat="server" />
|
||||
</asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<RowStyle CssClass="Texto" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -1036,4 +1185,48 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="ModalBitacora" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Bitácora</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<label>Bitácora/Observaciones</label>
|
||||
<br />
|
||||
<asp:TextBox CssClass="form-control" ID="TxtEventoDescripcion" class="Widthall" runat="server" TextMode="MultiLine" Columns="60" Rows="8"></asp:TextBox>
|
||||
<br />
|
||||
<%-- <asp:CheckBox ID="ChkEventoPrioridad" CssClass="md-checksd2" Text="Bitácora de Atención" runat="server" />--%>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:TextBox ID="AnexoBit" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<%--<div>
|
||||
|
||||
</div>--%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnGuardarEventoBitacora" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
||||
@@ -201,6 +201,22 @@ Partial Class RepContratoDetalle
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property TotalPagos As Decimal
|
||||
Get
|
||||
If ViewState("TotalPagos") Is Nothing Then
|
||||
ViewState("TotalPagos") = 0
|
||||
End If
|
||||
|
||||
Return ViewState("TotalPagos").ToString.ToDecimal
|
||||
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("TotalPagos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -209,20 +225,42 @@ Partial Class RepContratoDetalle
|
||||
|
||||
#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")
|
||||
End If
|
||||
|
||||
CveContrato = Request("CveContrato").ToEntero
|
||||
|
||||
If Not IsPostBack Then
|
||||
|
||||
InicializaCombos()
|
||||
CargaDatos()
|
||||
CargaAuxiliarClienteCxC(DdlClientes.SelectedValue.ToEntero, CveVentaRemision)
|
||||
AsientoSeleccionado = ""
|
||||
CveViajePasajero = 0
|
||||
Session("FileExtension") = ""
|
||||
ArchivoUpdate = ""
|
||||
CargaGvBitacora()
|
||||
|
||||
If CveContrato > 0 Then
|
||||
HlEvento.Visible = True
|
||||
HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveContrato=" & CveContrato & "&TB_iframe=true&height=370&width=600;"
|
||||
ImgAddObs.Visible = True
|
||||
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-light"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveContrato:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveContrato)
|
||||
CargaEventoBitacora()
|
||||
End If
|
||||
|
||||
If CveVentaRemision > 0 Then
|
||||
DVFactura.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
Private Sub InicializaCombos()
|
||||
'Lista Tipo AF
|
||||
@@ -297,6 +335,14 @@ Partial Class RepContratoDetalle
|
||||
If Not IsDBNull(ObjContratos.Archivo) AndAlso ObjContratos.Archivo <> "" AndAlso ObjContratos.Archivo <> "-1" AndAlso ObjContratos.Archivo <> $"{ObjContratos.CveContrato}." Then
|
||||
ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "CONTRATOS", ObjContratos.Archivo)
|
||||
BtnDescargar.Visible = True
|
||||
|
||||
Dim File As New FileInfo(ViewState("FUrl").ToString)
|
||||
BtnDescargar.NavigateUrl = $"~/Compras/PopUpVerFactura.aspx?ArchivoContrato={Encripta(File.FullName)}"
|
||||
'If File.Exists Then
|
||||
' RegistraScript($"window.open({Url}, ""_blank"");")
|
||||
'End If
|
||||
|
||||
|
||||
Else
|
||||
BtnDescargar.Visible = False
|
||||
A1.Visible = True
|
||||
@@ -313,13 +359,13 @@ Partial Class RepContratoDetalle
|
||||
ObjTransportes.Dispose()
|
||||
GvViajesPasajeros.DataBind()
|
||||
End If
|
||||
'Bitácora
|
||||
Dim ObjEventoBitacora As New ClsOIEventos
|
||||
If ObjEventoBitacora.GetEventos(-1, -1, -1, "-1", "-1", -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
|
||||
GvEventosBitacora.DataSource = ObjEventoBitacora.DtResultados
|
||||
GvEventosBitacora.DataBind()
|
||||
End If
|
||||
ObjEventoBitacora.Dispose()
|
||||
''Bitácora
|
||||
'Dim ObjEventoBitacora As New ClsOIEventos
|
||||
'If ObjEventoBitacora.GetEventos(-1, -1, -1, "-1", "-1", -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
|
||||
' GvEB.DataSource = ObjEventoBitacora.DtResultados
|
||||
' GvEB.DataBind()
|
||||
'End If
|
||||
'ObjEventoBitacora.Dispose()
|
||||
|
||||
End If
|
||||
Else
|
||||
@@ -332,8 +378,113 @@ Partial Class RepContratoDetalle
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Bitacora"
|
||||
Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(200)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(200)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(500)
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("Archivo").ToString <> "" Then
|
||||
e.Row.FCLinkButton("LinkArchivo").Visible = True
|
||||
e.Row.FCLinkButton("LinkArchivo").CommandArgument = String.Format("OI\{0}", e.Row.DBCampo("Archivo").ToString)
|
||||
ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LinkArchivo")) 'Registro un evento Postbacktrigger, que recargue toda la pagina para que funcione
|
||||
End If
|
||||
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnGuardarEventoBitacora_Click(sender As Object, e As EventArgs) Handles BtnGuardarEventoBitacora.Click
|
||||
Dim ObjEventoBitacora As New ClsOIEventos
|
||||
|
||||
Dim FileExtension As String = "-1"
|
||||
Dim Filesgral As List(Of Archivo) = AnexoBit.getfiles().Archivos
|
||||
Dim Filename As String = ""
|
||||
For Each fileItem As Archivo In Filesgral
|
||||
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
||||
Filename = fileItem.filename
|
||||
Next
|
||||
|
||||
|
||||
|
||||
If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
|
||||
If Filename <> "" Then
|
||||
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
|
||||
End If
|
||||
|
||||
GvEB.DataSource = ObjEventoBitacora.DtResultados
|
||||
TxtEventoDescripcion.Text = ""
|
||||
AnexoBit.Text = "[]"
|
||||
Alert("La bitácora/observación se guardó correctamente", TipoMensaje.MsgInformacion)
|
||||
RegistraScript("$('#ModalBitacora').modal('hide')", "hidemodal")
|
||||
|
||||
End If
|
||||
ObjEventoBitacora.Dispose()
|
||||
GvEB.DataBind()
|
||||
|
||||
UPEventoBitacora.Update()
|
||||
CargaEventoBitacora()
|
||||
UPAddEventoBitacora.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaEventoBitacora()
|
||||
|
||||
If CveContrato > 0 Then
|
||||
Dim ObjEventoBitacora As New ClsOIEventos()
|
||||
If ObjEventoBitacora.GetAgendaBitacora(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
|
||||
GvEB.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento = 6 OR CveTipoEvento = 2")
|
||||
Else
|
||||
GvEB.DataSource = Nothing
|
||||
End If
|
||||
ObjEventoBitacora.Dispose()
|
||||
GvEB.DataBind()
|
||||
UPEventoBitacora.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
'Protected Sub CargarArchivo(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AFU.UploadedComplete
|
||||
' If AFU.HasFile Then
|
||||
|
||||
|
||||
' Dim UploadFolder As String = String.Format("{0}\Temp\", UsuarioActual.Empresa.Ruta)
|
||||
' UploadFolder.DirectoryExistsCreate()
|
||||
' Dim Extension As String = System.IO.Path.GetExtension(AFU.PostedFile.FileName)
|
||||
|
||||
' If File.Exists(String.Format("{0}{1}{2}", UploadFolder, UsuarioActual.CveUsuario.ToString, Extension)) Then File.Delete(String.Format("{0}{1}{2}", UploadFolder, UsuarioActual.CveUsuario.ToString, Extension))
|
||||
|
||||
' AFU.SaveAs(UploadFolder & UsuarioActual.CveUsuario.ToString & Extension)
|
||||
' Session("FileUpload") = UploadFolder & UsuarioActual.CveUsuario.ToString & Extension
|
||||
' Session("FileExtension") = Extension
|
||||
' Session("FileFolder") = UploadFolder
|
||||
' End If
|
||||
'End Sub
|
||||
Protected Sub DownloadFile(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, CType(sender, LinkButton).CommandArgument)
|
||||
Dim Archivo As New System.IO.FileInfo(filePath)
|
||||
|
||||
HttpContext.Current.Response.Clear()
|
||||
HttpContext.Current.Response.ClearContent()
|
||||
HttpContext.Current.Response.ContentType = "application/octet-stream"
|
||||
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" + Path.GetFileName(filePath))
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||
HttpContext.Current.Response.TransmitFile(filePath)
|
||||
HttpContext.Current.Response.Flush()
|
||||
HttpContext.Current.Response.End()
|
||||
|
||||
Archivo = Nothing
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "Información General"
|
||||
Protected Sub BtnGuardarArchivo_Click1(sender As Object, e As EventArgs) Handles BtnGuardarArchivo.Click
|
||||
|
||||
Dim FileExtension As String = "-1"
|
||||
Dim Filesgral As List(Of Extensiones.Archivo) = Anexo.getfiles().Archivos
|
||||
Dim Filename As String = ""
|
||||
@@ -375,32 +526,61 @@ Partial Class RepContratoDetalle
|
||||
BtnDescargar.Visible = True
|
||||
End If
|
||||
End Sub
|
||||
Private Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
|
||||
DescargarArchivo()
|
||||
End Sub
|
||||
Private Sub DescargarArchivo()
|
||||
Dim File As New FileInfo(ViewState("FUrl").ToString)
|
||||
'Private Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
|
||||
' Dim File As New FileInfo(ViewState("FUrl").ToString)
|
||||
' Dim Url As String = $"{ObtenerUrlCompleta()}Compras/PopUpVerFactura.aspx?ArchivoContrato={Encripta(File.FullName)}"
|
||||
' If File.Exists Then
|
||||
' RegistraScript($"window.open({Url}, ""_blank"");")
|
||||
' End If
|
||||
|
||||
If File.Exists Then 'set appropriate headers
|
||||
Response.Clear()
|
||||
Response.ClearHeaders()
|
||||
Response.ClearContent()
|
||||
Response.AddHeader("Content-Disposition", "attachment; filename=" & TxtFolio.Text & $"{File.Extension}")
|
||||
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 Sub
|
||||
|
||||
Public Function ObtenerUrlCompleta() As String
|
||||
|
||||
Dim Solicitud As HttpRequest = HttpContext.Current.Request
|
||||
Dim url As String = Solicitud.Url.Scheme & "://" & Solicitud.Url.Host
|
||||
|
||||
If (Solicitud.Url.Port <> 80 AndAlso Solicitud.Url.Port <> 443) Then
|
||||
url &= ":" & Solicitud.Url.Port
|
||||
End If
|
||||
|
||||
|
||||
url &= Solicitud.ApplicationPath
|
||||
|
||||
If Not url.EndsWith("/") Then
|
||||
url &= "/"
|
||||
End If
|
||||
|
||||
Return url
|
||||
|
||||
End Function
|
||||
'Private Sub DescargaArchivo(urlArchivo As String)
|
||||
|
||||
' Dim File As New FileInfo(urlArchivo)
|
||||
|
||||
' If File.Exists Then 'set appropriate headers
|
||||
|
||||
' Response.Clear()
|
||||
' Response.ClearHeaders()
|
||||
' Response.ClearContent()
|
||||
' Response.AddHeader("Content-Disposition", "inline; filename=" & TxtFolio.Text & $"{File.Extension}")
|
||||
' 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()
|
||||
|
||||
' Else
|
||||
|
||||
' Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()")
|
||||
|
||||
' End If
|
||||
|
||||
'End Sub
|
||||
|
||||
End If 'nothing in the URL as HTTP GET
|
||||
End Sub
|
||||
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
||||
Dim ArchivoUpdate As String = "-1"
|
||||
Dim ErrorProceso As Boolean = False
|
||||
@@ -886,6 +1066,52 @@ Partial Class RepContratoDetalle
|
||||
GvBitacora.DataBind()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "PAGOS"
|
||||
Private Sub CargaAuxiliarClienteCxC(CveCliente As Integer, CveRemision As Integer)
|
||||
|
||||
If CveRemision > 0 Then
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
|
||||
If ObjMovtos.GetCxCClienteAuxiliar(CveCliente, CveRemision) Then
|
||||
|
||||
Dim dtTemp As New DataTable
|
||||
dtTemp = ObjMovtos.DtResultados.FiltraParametros(" Conceptocontable = 'Pago del Cliente' ")
|
||||
TotalPagos = dtTemp.SUM("Abono")
|
||||
GVAuxiliar.DataSource = dtTemp
|
||||
|
||||
Else
|
||||
GVAuxiliar.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjMovtos.Dispose()
|
||||
GVAuxiliar.DataBind()
|
||||
UpPagos.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GVAuxiliar_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DataKey("TipoReferencia").ToEntero = 1 Then
|
||||
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Bancos/IE.aspx?CveIE={e.Row.DataKey("CveReferencia").ToEntero}"
|
||||
End If
|
||||
End If
|
||||
If e.Row.RowType = DataControlRowType.Footer Then
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(1).Text = "Total"
|
||||
e.Row.FCLabel("Lbltotal").Text = TotalPagos.ToString("###,###,###.00")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
@@ -392,9 +392,10 @@
|
||||
<div class="col-md-8">
|
||||
<div class="input-group">
|
||||
|
||||
<asp:TextBox ID="TxtCantidadPasajeros" runat="server" CssClass="form-control" CausesValidation="True"
|
||||
<asp:TextBox ID="TxtCantidadPasajeros" runat="server" CssClass="form-control" CausesValidation="True"
|
||||
Width="100%"
|
||||
type="number" MaxLength="2" ></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtCantidadPasajeros" FilterType="Custom" ValidChars="1234567890" />
|
||||
<asp:RequiredFieldValidator ID="RFVCantidadPasajeros" runat="server" ControlToValidate="TxtCantidadPasajeros"
|
||||
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad de pasajeros''</b> es necesario, por favor ingréselo."
|
||||
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
|
||||
@@ -102,6 +102,10 @@ Partial Class ListadoContratos
|
||||
End Sub
|
||||
Protected Sub AddContrato(sender As Object, e As EventArgs)
|
||||
|
||||
If Not VallidaCantidadPasajeros(DdlTipoAF.SelectedValue.ToEntero, TxtCantidadPasajeros.Text.ToEntero) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ErrorProceso As Boolean = False
|
||||
Dim CveContrato As Integer = -1
|
||||
|
||||
@@ -221,6 +225,22 @@ Partial Class ListadoContratos
|
||||
RegistraScript("$('#ModalAgregar').modal('hide')", "hidemodal1")
|
||||
End Sub
|
||||
|
||||
Private Function VallidaCantidadPasajeros(CveTipoAF As Integer, Cantidad As Integer) As Boolean
|
||||
|
||||
Dim Respuesta As Boolean = True
|
||||
|
||||
If CveTipoAF = 181 And Cantidad < 30 Then 'autobus
|
||||
Respuesta = False
|
||||
Alert("El tipo unidad autobus debe de tener un minimo de 30 pasajeros.", TipoMensaje.MsgAdvertencia)
|
||||
ElseIf CveTipoAF = 184 And Cantidad > 21 Then 'sprinter
|
||||
Respuesta = False
|
||||
Alert("El tipo de unidad sprinter no puede tener más de 21 pasajeros.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
Protected Sub ResetModal()
|
||||
'Reiniciamos modal
|
||||
TxtDescripcion.Text = ""
|
||||
|
||||
@@ -6,7 +6,8 @@ Imports System.Data.SqlClient
|
||||
Imports System.Globalization
|
||||
Imports System.IO
|
||||
Imports System.Net
|
||||
Imports System.Net.Http
|
||||
Imports System.Net.Http
|
||||
Imports System.Security.Policy
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports Newtonsoft.Json
|
||||
@@ -209,14 +210,14 @@ Partial Class Clientes
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property ObjFactura As Modelos.Factura
|
||||
Get
|
||||
Return CType(ViewState("ObjFactura"), Modelos.Factura)
|
||||
End Get
|
||||
Set(value As Modelos.Factura)
|
||||
ViewState("ObjFactura") = value
|
||||
End Set
|
||||
End Property
|
||||
'Private Property ObjFactura As Modelos.Factura
|
||||
' Get
|
||||
' Return CType(ViewState("ObjFactura"), Modelos.Factura)
|
||||
' End Get
|
||||
' Set(value As Modelos.Factura)
|
||||
' ViewState("ObjFactura") = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
Private Property CobranzaTelefono As String
|
||||
Get
|
||||
@@ -309,14 +310,14 @@ Partial Class Clientes
|
||||
ViewState("DTPorcentajePrecios") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property TmpDT As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("TmpDT")), Nothing, CType(ViewState("TmpDT"), DataTable))
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("TmpDT") = value
|
||||
End Set
|
||||
End Property
|
||||
'Private Property TmpDT As DataTable
|
||||
' Get
|
||||
' Return If(IsNothing(ViewState("TmpDT")), Nothing, CType(ViewState("TmpDT"), DataTable))
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("TmpDT") = value
|
||||
' End Set
|
||||
'End Property
|
||||
Private Property DtPromociones As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("DtPromociones")), Nothing, CType(ViewState("DtPromociones"), DataTable))
|
||||
@@ -664,7 +665,7 @@ Partial Class Clientes
|
||||
Actualizar = False
|
||||
SetValues()
|
||||
CargaCombos()
|
||||
CreaDTVentas()
|
||||
'CreaDTVentas()
|
||||
CreaDtPago()
|
||||
RegistraScript("CargaHeader();")
|
||||
CargaCombosDirecionesClientesSAT()
|
||||
@@ -9197,102 +9198,52 @@ Partial Class Clientes
|
||||
|
||||
#Region " A C U M U L A D O R E S"
|
||||
|
||||
Protected Sub LnkFacturaUsadosCargos_Click(sender As Object, e As EventArgs)
|
||||
'CveVentaNota = 0
|
||||
Protected Sub LnkFacturaUsadosBonificacion_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim DtSubProyectos As DataTable = New DataTable()
|
||||
DtSubProyectos.Columns.Add(New DataColumn("CveSubProyecto", GetType(Integer)))
|
||||
|
||||
'Dim Cargos As Decimal = 0D
|
||||
'Dim Iva As Decimal = 0D
|
||||
|
||||
'For Each GvRow As GridViewRow In GvAcum.Rows
|
||||
|
||||
' If GvRow.DataKey("CveConcepto").Toentero() = 1 And GvRow.FCCheckBox("ChkCargo").Checked Then
|
||||
' Cargos = Cargos + GvRow.DataKey("ImporteCargo").ToDecimal()
|
||||
' End If
|
||||
'Next
|
||||
|
||||
'Dim CvePS As Integer = UsuarioActual.Empresa.Funcionalidad(534).Toentero() 'CvePS Distruibuidor Cargo Nota
|
||||
'Dim CveUnidadMedida As Integer
|
||||
'Dim CveClasificacion As Integer
|
||||
|
||||
'If CvePS > 0 Then
|
||||
|
||||
' If Cargos > 0 Then
|
||||
|
||||
' CveUnidadMedida = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimeroValor("CveUnidadMedida").ToString().Toentero()
|
||||
' CveClasificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimeroValor("CveClasificacion").ToString().Toentero()
|
||||
' Iva = Cargos * 0.16D
|
||||
|
||||
' If GenerarNotaCredito(CvePS, 1, CveUnidadMedida, Cargos, Iva, "Clientes/Usados", CveClasificacion) Then
|
||||
' Alert($"LA nota de crédito fue generada correctamente {SerieNotaAcumulador}-{FolioNotaAcumulador}")
|
||||
' Else
|
||||
' Alert("Se presento un error al generar la nota de creédito", TipoMensaje.MsgError)
|
||||
' End If
|
||||
' End If
|
||||
|
||||
'Else
|
||||
' Alert("No esta asignada la funcionalidad CvePS Distruibuidor Cargo Nota")
|
||||
'End If
|
||||
|
||||
CreaObjetosVenta(1)
|
||||
|
||||
'If ObjFactura.CveCliente > 0 Then
|
||||
' If TmpDT.Rows.Count > 0 Then
|
||||
' Dim Retorno = ObjFactura.EmitirFactura(false)
|
||||
' For Each Mensaje In Retorno.Mensajes
|
||||
' Alert(Mensaje, If(Retorno.TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion))
|
||||
' Next
|
||||
' End If
|
||||
'End If
|
||||
|
||||
CargaUsados()
|
||||
|
||||
End Sub
|
||||
Protected Sub LnkFacturaUsadosBonificacion_Click(sender As Object, e As EventArgs)
|
||||
|
||||
'CveVentaNota = 0
|
||||
'Dim Bonificacion As Decimal = 0D
|
||||
'Dim Iva As Decimal = 0D
|
||||
|
||||
'For Each GvRow As GridViewRow In GvAcum.Rows
|
||||
' If GvRow.DataKey("CveConcepto").Toentero() = 1 And GvRow.FCCheckBox("ChkBonificacion").Checked Then
|
||||
' Bonificacion = Bonificacion + GvRow.DataKey("ImporteBonificacion").ToDecimal()
|
||||
' End If
|
||||
'Next
|
||||
|
||||
|
||||
'Dim CvePS As Integer = UsuarioActual.Empresa.Funcionalidad(534).Toentero() 'CvePS Distruibuidor Bonificación Nota
|
||||
'Dim CveUnidadMedida As Integer
|
||||
'Dim CveClasificacion As Integer
|
||||
'If CvePS > 0 Then
|
||||
' If Bonificacion > 0 Then
|
||||
|
||||
' CveUnidadMedida = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimeroValor("CveUnidadMedida").ToString().Toentero()
|
||||
' CveClasificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimeroValor("CveClasificacion").ToString().Toentero()
|
||||
' Iva = Bonificacion * 0.16D
|
||||
|
||||
' If GenerarNotaCredito(CvePS, 2, CveUnidadMedida, Bonificacion, Iva, "Clientes/Usados", CveClasificacion) Then
|
||||
' Alert($"LA nota de crédito fue generada correctamente {SerieNotaAcumulador}-{FolioNotaAcumulador}")
|
||||
' Else
|
||||
' Alert("Se presento un error al generar la nota de creédito", TipoMensaje.MsgError)
|
||||
' End If
|
||||
|
||||
' End If
|
||||
|
||||
'Else
|
||||
' Alert("No esta asignada la funcionalidad CvePS Distruibuidor Bonificación Nota")
|
||||
'End If
|
||||
|
||||
CreaObjetosVenta(2)
|
||||
|
||||
If ObjFactura.CveCliente > 0 Then
|
||||
If TmpDT.Rows.Count > 0 Then
|
||||
Dim Retorno As Modelos.Factura.MMensajeFactura = ObjFactura.EmitirFactura(False)
|
||||
For Each Mensaje As String In Retorno.Mensajes
|
||||
Alert(Mensaje, If(Retorno.TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion))
|
||||
Next
|
||||
For Each GvRow As GridViewRow In GvAcum.Rows
|
||||
If GvRow.FCCheckBox("ChkBonificacion").Checked Then
|
||||
DtSubProyectos.Rows.Add(GvRow.DataKey("CveSubProyecto").ToEntero())
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim StringFolios As New StringBuilder
|
||||
Dim StringMsg As New StringBuilder
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
ObjVentas.IniciaTransacSQL()
|
||||
|
||||
Dim TieneError As Boolean = False
|
||||
Try
|
||||
For Each Row As DataRow In DtSubProyectos.FiltraParametros("", DistinctColumns:={"CveSubProyecto"}).Rows
|
||||
Dim Resp = CreaObjetosVenta(2, Row("CveSubProyecto").ToString().ToEntero(), ObjVentas)
|
||||
If Resp.TieneError Then
|
||||
TieneError = True
|
||||
StringMsg.Append("Ocurrió un error al generar la RNC de bonificación")
|
||||
Exit For
|
||||
Else
|
||||
StringFolios.AppendFormat("<br/><b>{0}<b/>", Resp.SerieFolio)
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
TieneError = True
|
||||
StringMsg.Append("Ocurrió un error al generar la RNC de bonificación")
|
||||
End Try
|
||||
|
||||
If TieneError Then
|
||||
ObjVentas.RollBack()
|
||||
Else
|
||||
ObjVentas.Commit()
|
||||
End If
|
||||
|
||||
If Not TieneError AndAlso StringFolios.Length > 0 Then
|
||||
StringMsg.AppendFormat("Se generaron las siguientes remisiones de nota de crédito de bonificación: {0}", StringFolios)
|
||||
End If
|
||||
|
||||
Alert(StringMsg.ToString(), If(TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion))
|
||||
|
||||
Alert("Listo")
|
||||
CargaUsados()
|
||||
End Sub
|
||||
@@ -9420,8 +9371,8 @@ Partial Class Clientes
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CreaDTVentas()
|
||||
TmpDT = New DataTable
|
||||
Private Function CreaDTVentas() As DataTable
|
||||
Dim TmpDT = New DataTable
|
||||
TmpDT.Columns.Add("CveVenta", GetType(Integer))
|
||||
TmpDT.Columns.Add("Consec", GetType(Integer))
|
||||
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
|
||||
@@ -9507,8 +9458,9 @@ Partial Class Clientes
|
||||
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||
|
||||
End Sub
|
||||
Private Function AgregarProductoServicio(Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
|
||||
Return TmpDT
|
||||
End Function
|
||||
Private Function AgregarProductoServicio(ByRef TmpDT As DataTable, Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
|
||||
PU As Decimal, Descuento As Decimal,
|
||||
CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
|
||||
Optional Serie As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
|
||||
@@ -9630,16 +9582,15 @@ Partial Class Clientes
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
Private Sub CreaObjetosVenta(Tipo As Integer)
|
||||
|
||||
Dim CveSubProyecto As Integer = -1
|
||||
Private Function CreaObjetosVenta(Tipo As Integer, CveSubProyecto As Integer, ByRef ObjVentas As ClsVentas) As Modelos.Factura.MMensajeFactura
|
||||
Dim TmpDT As DataTable = CreaDTVentas()
|
||||
Dim UsadosBonificacion As List(Of Integer) = New List(Of Integer)
|
||||
|
||||
TmpDT.Rows.Clear()
|
||||
TmpDT.AcceptChanges()
|
||||
|
||||
For Each GvRow As GridViewRow In GvAcum.Rows
|
||||
If GvRow.FCCheckBox("ChkBonificacion").Checked OrElse GvRow.FCCheckBox("ChkCargo").Checked Then
|
||||
CveSubProyecto = GvRow.DataKey("CveSubProyecto").ToEntero()
|
||||
If GvRow.FCCheckBox("ChkBonificacion").Checked AndAlso GvRow.DataKey("CveSubProyecto").ToEntero() = CveSubProyecto Then
|
||||
|
||||
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
|
||||
Dim PU As Decimal = 0
|
||||
@@ -9662,6 +9613,8 @@ Partial Class Clientes
|
||||
End If
|
||||
|
||||
If CvePSCargo > 0 AndAlso PU > 0 Then
|
||||
Dim CveMovto As Integer = GvRow.DataKey("CveMovto").ToEntero()
|
||||
|
||||
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePSCargo).Rows(0)
|
||||
If Dr IsNot Nothing Then
|
||||
CveUnidadMedida = Dr("CveUnidadMedida").ToString().ToEntero()
|
||||
@@ -9671,8 +9624,10 @@ Partial Class Clientes
|
||||
Clasificacion = Dr("Clasificacion").ToString()
|
||||
End If
|
||||
|
||||
AgregarProductoServicio(Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePSCargo, PS, "Clientes/Usados", PU, 0, -1, "", DdlSubProyecto.SelectedValue.ToEntero(),
|
||||
AgregarProductoServicio(TmpDT, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePSCargo, PS, "Clientes/Usados", PU, 0, -1, "", DdlSubProyecto.SelectedValue.ToEntero(),
|
||||
DdlSubProyecto.SelectedItem.Text, PorcentajeIVA:=PorcentajeIVA)
|
||||
|
||||
UsadosBonificacion.Add(CveMovto)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -9694,20 +9649,9 @@ Partial Class Clientes
|
||||
DT.Dispose()
|
||||
End If
|
||||
ObjFolios.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
'If FolioNotaCredito(Tipo) Then
|
||||
' Folio = FolioNotaAcumulador
|
||||
' Serie = SerieNotaAcumulador
|
||||
'End If
|
||||
|
||||
If ObjFactura IsNot Nothing Then
|
||||
ObjFactura.Dispose()
|
||||
ObjFactura = Nothing
|
||||
End If
|
||||
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual)
|
||||
Dim ObjFactura = New Modelos.Factura(UsuarioActual)
|
||||
ObjFactura.CveUsuario = UsuarioActual.CveUsuario
|
||||
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
ObjFactura.CveVenta = -1
|
||||
@@ -9828,20 +9772,12 @@ Partial Class Clientes
|
||||
ObjFactura.CveTipoRelacion = -1
|
||||
End If
|
||||
|
||||
Dim UsadosBonificacion As List(Of Integer) = New List(Of Integer)
|
||||
For Each GvRow As GridViewRow In GvAcum.Rows
|
||||
Dim CveMovto As Integer = GvRow.DataKey("CveMovto").ToEntero()
|
||||
If (Tipo = 1 And GvRow.FCCheckBox("ChkCargo").Checked) Or (Tipo = 2 And GvRow.FCCheckBox("ChkBonificacion").Checked) Then
|
||||
UsadosBonificacion.Add(CveMovto)
|
||||
End If
|
||||
Next
|
||||
|
||||
ObjFactura.UsadosBonificacion = UsadosBonificacion
|
||||
ObjFactura.TipoBonificacion = Tipo
|
||||
|
||||
' ObjFactura.Timbre = PreParaTimbre(ObjFactura)
|
||||
Return ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Clientes/Bonificacion", MostrarURL:=True)
|
||||
|
||||
End Sub
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Reference in New Issue
Block a user