This commit is contained in:
Rakcsle Supertramp
2020-08-04 17:22:49 -07:00
12 changed files with 194 additions and 93 deletions

View File

@@ -279,6 +279,12 @@ Public Class ClsPaginas
End Property
Property GlobalDTPSATPS() As DataTable
Get
If Application("GlobalDTPSATPS") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing
ObjGrales.Dispose()
End If
GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End Get
Set(value As DataTable)
@@ -353,6 +359,12 @@ Public Class ClsPaginas
Property GlobalDTEstado(ClaveSATPais As String) As DataTable
Get
If Application("GlobalDTEstado") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATEstado("-1") Then Application("GlobalDTEstado") = ObjGrales.DtResultados Else Application("GlobalDTEstado") = Nothing
ObjGrales.Dispose()
End If
If ClaveSATPais <> "-1" Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTEstado"), DataTable), String.Format("ClaveSATPais = '{0}'", ClaveSATPais), "", DataViewRowState.CurrentRows)
GlobalDTEstado = Dv.ToTable
@@ -369,6 +381,12 @@ Public Class ClsPaginas
Property GlobalDTMunicipio(ClaveSATEstado As String) As DataTable
Get
If Application("GlobalDTMunicipio") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATMunicipio("-1") Then Application("GlobalDTMunicipio") = ObjGrales.DtResultados Else Application("GlobalDTMunicipio") = Nothing
ObjGrales.Dispose()
End If
If ClaveSATEstado <> "-1" Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTMunicipio"), DataTable), String.Format("ClaveSATEstado = '{0}'", ClaveSATEstado), "", DataViewRowState.CurrentRows)
GlobalDTMunicipio = Dv.ToTable
@@ -385,6 +403,12 @@ Public Class ClsPaginas
Property GlobalDTColonia(ClaveSATMunicipio As String) As DataTable
Get
If Application("GlobalDTColonia") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATColonia("-1") Then Application("GlobalDTColonia") = ObjGrales.DtResultados Else Application("GlobalDTColonia") = Nothing
ObjGrales.Dispose()
End If
If ClaveSATMunicipio <> "-1" Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTColonia"), DataTable), String.Format("ClaveSATMunicipio = '{0}'", ClaveSATMunicipio), "", DataViewRowState.CurrentRows)
GlobalDTColonia = Dv.ToTable
@@ -403,6 +427,11 @@ Public Class ClsPaginas
Property GlobalDTPSATUM() As DataTable
Get
If Application("GlobalDTPSATUM") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATUnidadMedida Then Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATUM") = Nothing
ObjGrales.Dispose()
End If
'System.Data.EnumerableRowCollection
If Not IsNothing(Application("GlobalDTPSATUM")) Then
@@ -8129,7 +8158,8 @@ Public Class ClsPaginas
Dim dtsec As DataTable = GlobalDTInvPSSeccionesAlmacen(CveEmpresa, CveAlmacen, CvePS)
DdlSeccionAlmacen.DataSource = dtsec
DdlSeccionAlmacen.DataBind()
If dtsec.Rows.Count = 1 Then
If dtsec Is Nothing Then Exit Sub
If dtsec.Rows.Count = 1 Then
DdlSeccionAlmacen.SelectedIndex = 0
DdlSeccionAlmacen.Enabled = False
Else 'si es mayor a uno que por default seleccione el primero, que seria el predeterminado

View File

@@ -1327,9 +1327,9 @@ Partial Class PopUpVerFactura
Dim CveTipoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacen}").ToString.ToEntero
'If CveTipoAlmacen = 19 Or CveTipoAlmacen = 20 Then
' CveConcepto = 24
'End If
If CveTipoAlmacen = 20 Then
CveConcepto = 24
End If
ObjInventarios.Dispose()
If RazonSocial = "" AndAlso NombreCliente <> "" Then RazonSocial = NombreCliente
@@ -1341,7 +1341,7 @@ Partial Class PopUpVerFactura
EstadoOrigen, PaisOrigen, CPOrigen, CalleDestino, NoExtDestino, ColoniaDestino, LocalidadDestino,
MunicipioDestino, EstadoDestino, PaisDestino, CPDestino, FechaMovimiento, NombreCapturo, PuestoRecibio,
PuestoEnrego, RazonSocial, ResponsableCarga, ResponsableRecibio, NombreCliente,
CantidadProductos:=CantidadProductos, CantidadUsados:=CantidadUsados)
CantidadProductos:=CantidadProductos, CantidadUsados:=CantidadUsados, CveTipoAlmacen:=CveTipoAlmacen)
End Sub
Private Sub PUanacExtr(CveMoneda As Integer) 'preciounitario a moneda nacional o extranjera
@@ -1358,7 +1358,7 @@ Partial Class PopUpVerFactura
Remision As String, Proveedor As String, CalleOrigen As String, NoExtOrigen As String, ColoniaOrigen As String, LocalidadOrigen As String, MunicipioOrigen As String,
EstadoOrigen As String, PaisOrigen As String, CPOrigen As String, CalleDestino As String, NoExtDestino As String, ColoniaDestino As String, LocalidadDestino As String, MunicipioDestino As String,
EstadoDestino As String, PaisDestino As String, CPDestino As String, FechaMovimiento As Date, NombreCapturo As String, PuestoRecibio As String, PuestoEntrego As String,
RazonSocial As String, ResponsableCarga As String, ResponsableRecibio As String, NombreCliente As String, Optional CantidadProductos As Decimal = 0, Optional CantidadUsados As Decimal = 0)
RazonSocial As String, ResponsableCarga As String, ResponsableRecibio As String, NombreCliente As String, Optional CantidadProductos As Decimal = 0, Optional CantidadUsados As Decimal = 0, Optional CveTipoAlmacen As Integer = -1)
Select Case CveConcepto
@@ -1445,6 +1445,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Concepto", ConceptoFormato))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("CveTipoAlmacen", Almacen))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("FacturaProveedor", If(CveCompra > 0, dr("SerieFolio").ToString, "")))
@@ -2460,19 +2461,19 @@ Partial Class PopUpVerFactura
If (UsuarioActual.CveEmpresa = 72) Then
params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
End If
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/SalidasGarantia.rdlc", DtMovimientos, params, String.Format("SalidaGarantia{0}", Folio.ToString), RDSName:="DsInventarios")
'Else
' params.Add(New ReportParameter("Folio", Folio))
' params.Add(New ReportParameter("Fecha", Fecha))
' params.Add(New ReportParameter("Almacen", Almacen))
' params.Add(New ReportParameter("SubProyecto", SubProyecto))
' params.Add(New ReportParameter("Observaciones", Observaciones))
' params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
' ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
'End If
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/SalidasGarantia.rdlc", DtMovimientos, params, String.Format("SalidaGarantia{0}", Folio.ToString), RDSName:="DsInventarios")
'Else
' params.Add(New ReportParameter("Folio", Folio))
' params.Add(New ReportParameter("Fecha", Fecha))
' params.Add(New ReportParameter("Almacen", Almacen))
' params.Add(New ReportParameter("SubProyecto", SubProyecto))
' params.Add(New ReportParameter("Observaciones", Observaciones))
' params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
' ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
'End If
Case 18 'D E V O L U C I O N D E L C L I E N T E
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/DevolucionCliente.rdlc", UsuarioActual.Empresa.Ruta))
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -2649,36 +2650,36 @@ Partial Class PopUpVerFactura
ImprimirPDF(Archivo, DtMovimientos, params, String.Format("Salida por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios")
ElseIf CveConcepto = 22 Then
ImprimirPDF(Archivo, DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios")
End If
'Case 22 'ENTRADA POR PRESTAMO
' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
' Dim params As New List(Of ReportParameter)
' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
' If Imagen.Exists Then
' params.Add(New ReportParameter("LogoPath", logouri))
' Else
' params.Add(New ReportParameter("LogoPath", ""))
' End If
' params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
' params.Add(New ReportParameter("Concepto", "Entrada por Prestamo"))
' params.Add(New ReportParameter("Almacen", Almacen))
' params.Add(New ReportParameter("Fecha", Fecha))
' params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
' params.Add(New ReportParameter("Folio", Folio))
' params.Add(New ReportParameter("Descuentos", ""))
' params.Add(New ReportParameter("IVA", ""))
' params.Add(New ReportParameter("Total", ""))
' 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
' params.Add(New ReportParameter("FacturadoA", NombreCliente))
' If (UsuarioActual.CveEmpresa = 72) Then
' params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
' End If
' ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios")
End If
'Case 22 'ENTRADA POR PRESTAMO
' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
' Dim params As New List(Of ReportParameter)
' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
' If Imagen.Exists Then
' params.Add(New ReportParameter("LogoPath", logouri))
' Else
' params.Add(New ReportParameter("LogoPath", ""))
' End If
' params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
' params.Add(New ReportParameter("Concepto", "Entrada por Prestamo"))
' params.Add(New ReportParameter("Almacen", Almacen))
' params.Add(New ReportParameter("Fecha", Fecha))
' params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
' params.Add(New ReportParameter("Folio", Folio))
' params.Add(New ReportParameter("Descuentos", ""))
' params.Add(New ReportParameter("IVA", ""))
' params.Add(New ReportParameter("Total", ""))
' 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
' params.Add(New ReportParameter("FacturadoA", NombreCliente))
' If (UsuarioActual.CveEmpresa = 72) Then
' params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
' End If
' ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios")
Case 24 'SALIDA POR RESGUARDO
If DtMovimientos(0)("CveTipoAlmacen").ToString.ToEntero = 20 Or DtMovimientos(0)("CveTipoAlmacen").ToString.ToEntero = 19 Then
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -3153,11 +3154,11 @@ Partial Class PopUpVerFactura
If CveConcepto = 2 Then
ElseIf CveConcepto = 3 Then
End If
End Sub
End Sub
#End Region
#Region "OP = 'OC' - IMPRIME PDF OC"
Private Sub ImprimePDFOC(CveOrdenCompra As Integer)
Dim reporte As Byte() = NewGeneraBytesOC(CveOrdenCompra, ConBitacora:=(UsuarioActual.Empresa.Funcionalidad(119) = "1"))

View File

@@ -6,19 +6,19 @@
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>1.60907cm</Width>
<Width>1.24394cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.06688cm</Width>
</TablixColumn>
<TablixColumn>
<Width>6.26873cm</Width>
<Width>5.79535cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.82959cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.67979cm</Width>
<Width>2.51831cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.11844cm</Width>
@@ -43,7 +43,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>CANTIDAD</Value>
<Value>CANT</Value>
<Style>
<FontFamily>MYRIAd Pro</FontFamily>
<FontSize>8pt</FontSize>
@@ -397,7 +397,7 @@
</TablixCells>
</TablixRow>
<TablixRow>
<Height>0.36717cm</Height>
<Height>0.43773cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
@@ -541,14 +541,16 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!SeccionAlmacen.Value</Value>
<Value>=Fields!SeccionAlmacen.Value &amp; ".__________"</Value>
<Style>
<FontFamily>MYRIAd Pro</FontFamily>
<FontSize>7.5pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>SeccionAlmacen</rd:DefaultName>
@@ -699,8 +701,8 @@
<DataSetName>DsInventarios</DataSetName>
<Top>0.17639cm</Top>
<Left>0.12931cm</Left>
<Height>0.96717cm</Height>
<Width>19.16933cm</Width>
<Height>1.03773cm</Height>
<Width>19.16934cm</Width>
<Style>
<Border>
<Style>None</Style>
@@ -708,7 +710,7 @@
</Style>
</Tablix>
<Line Name="Line3">
<Top>1.21412cm</Top>
<Top>1.53162cm</Top>
<Left>0.17882cm</Left>
<Height>0cm</Height>
<Width>19.11979cm</Width>
@@ -740,7 +742,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>ImporteLetra</rd:DefaultName>
<Top>0.73158in</Top>
<Top>0.98158in</Top>
<Left>1.49813in</Left>
<Height>0.18861in</Height>
<Width>6.09975in</Width>
@@ -853,7 +855,7 @@
</TablixMembers>
</TablixRowHierarchy>
<DataSetName>DsInventarios</DataSetName>
<Top>1.31995cm</Top>
<Top>1.95495cm</Top>
<Left>15.70179cm</Left>
<Height>0.46771cm</Height>
<Width>3.59684cm</Width>
@@ -1047,11 +1049,14 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName>
<Top>2.3622cm</Top>
<Top>2.6797cm</Top>
<Left>0.18166cm</Left>
<Height>2.46091cm</Height>
<Height>2.14341cm</Height>
<Width>10.47411cm</Width>
<ZIndex>2</ZIndex>
<Visibility>
<Hidden>=Not Parameters!CveTipoAlmacen.Value="19"</Hidden>
</Visibility>
<Style>
<Border>
<Style>None</Style>
@@ -1168,9 +1173,9 @@
</Paragraphs>
<rd:DefaultName>Textbox50</rd:DefaultName>
<Top>0.74112cm</Top>
<Left>10.83216cm</Left>
<Left>3.80525cm</Left>
<Height>1.86797cm</Height>
<Width>8.38745cm</Width>
<Width>15.41436cm</Width>
<ZIndex>3</ZIndex>
<Style>
<Border>
@@ -1817,6 +1822,12 @@
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="CveTipoAlmacen">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters>
<EmbeddedImages>
<EmbeddedImage Name="Logo1">

View File

@@ -276,8 +276,8 @@
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'SAT
Using ObjGrales As New ClsGenerales
If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing
If ObjGrales.GetSATUnidadMedida Then Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATUM") = Nothing
'If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing
'If ObjGrales.GetSATUnidadMedida Then Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATUM") = Nothing
If ObjGrales.GetSATUsosCFDI Then Application("GlobalDTSATUsosCFDI") = ObjGrales.DtResultados Else Application("GlobalDTSATUsosCFDI") = Nothing
If ObjGrales.GetSATFraccionArancelaria Then Application("GlobalDTFraccionArancelaria") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTFraccionArancelaria") = Nothing
If ObjGrales.GetSATIncoterm Then Application("GlobalDTIncoterm") = ObjGrales.DtResultados Else Application("GlobalDTIncoterm") = Nothing
@@ -286,9 +286,9 @@
If ObjGrales.GetSATUnidadesAduana Then Application("GlobalDTUnidadAduana") = ObjGrales.DtResultados Else Application("GlobalDTUnidadAduana") = Nothing
If ObjGrales.GetSATClavePedimento Then Application("GlobalDTClavePedimento") = ObjGrales.DtResultados Else Application("GlobalDTClavePedimento") = Nothing
If ObjGrales.GetSATPais Then Application("GlobalDTPais") = ObjGrales.DtResultados Else Application("GlobalDTPais") = Nothing
If ObjGrales.GetSATEstado("-1") Then Application("GlobalDTEstado") = ObjGrales.DtResultados Else Application("GlobalDTEstado") = Nothing
If ObjGrales.GetSATMunicipio("-1") Then Application("GlobalDTMunicipio") = ObjGrales.DtResultados Else Application("GlobalDTMunicipio") = Nothing
If ObjGrales.GetSATColonia("-1") Then Application("GlobalDTColonia") = ObjGrales.DtResultados Else Application("GlobalDTColonia") = Nothing
'If ObjGrales.GetSATEstado("-1") Then Application("GlobalDTEstado") = ObjGrales.DtResultados Else Application("GlobalDTEstado") = Nothing
'If ObjGrales.GetSATMunicipio("-1") Then Application("GlobalDTMunicipio") = ObjGrales.DtResultados Else Application("GlobalDTMunicipio") = Nothing
'If ObjGrales.GetSATColonia("-1") Then Application("GlobalDTColonia") = ObjGrales.DtResultados Else Application("GlobalDTColonia") = Nothing
End Using
GuardaLogAsax(String.Format("Globalasax 19:{0}", DateTime.Now))

View File

@@ -872,7 +872,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Cont As Integer = 0
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
Dim CostoEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, Dr("PU").ToString.ToDecimal())
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=-1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For

View File

@@ -122,10 +122,13 @@ public partial class OI_DocumentoDetalle : ClsPaginas
TxtObs.InnerText = Documento["Observacion"].ToString();
ArchivoAdjuntoNombre = Documento["ArchivoFisico"].ToString();
string[] ArchivoAux = Documento["ArchivoFisico"].ToString().Split('_');
string ArchivoAdjunto = ArchivoAux[1];
LkbDescargarArchivo.Text = ArchivoAdjunto;
DivDescargarArchivo.Visible = true;
if (ArchivoAdjuntoNombre.Contains("_"))
{
string[] ArchivoAux = Documento["ArchivoFisico"].ToString().Split('_');
string ArchivoAdjunto = ArchivoAux[1];
LkbDescargarArchivo.Text = ArchivoAdjunto;
DivDescargarArchivo.Visible = true;
}
}
}
ObjOI.Dispose();

View File

@@ -28,17 +28,22 @@
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveDocumento,SubCategoria,Descripcion,Observacion,Version,Responsable,FechaAprobacion,FechaInicioVigencia"
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveDocumento,Categoria,SubCategoria,Descripcion,Observacion,Version,Responsable,FechaAprobacion,FechaInicioVigencia,ArchivoFisico"
EmptyDataText="No se encontraron Documentos Registrados" ToolTip="Listado de Documentos" CssClass="table table-striped table-advance table-hover"
Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None" OnRowDataBound="GvDatos_RowDataBound">
<Columns>
<asp:HyperLinkField HeaderText="Descripcion" DataTextField="Descripcion" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}" ItemStyle-HorizontalAlign="Left"/>
<asp:HyperLinkField HeaderText="Observación" DataTextField="Observacion" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}" ItemStyle-HorizontalAlign="Left"/>
<asp:HyperLinkField HeaderText="Versión" DataTextField="Version" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}"/>
<asp:HyperLinkField HeaderText="Categoria" DataTextField="Categoria" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}"/>
<asp:HyperLinkField HeaderText="SubCategoria" DataTextField="SubCategoria" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}"/>
<asp:HyperLinkField HeaderText="Responsable" DataTextField="Responsable" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}" ItemStyle-HorizontalAlign="Left"/>
<%--<asp:HyperLinkField HeaderText="Fecha Aprobacion" DataTextField="FechaAprobacion" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}"/>--%>
<asp:HyperLinkField HeaderText="Fecha Inicio Vigencia" DataTextField="FechaInicioVigencia" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}"/>
<asp:HyperLinkField HeaderText="Fecha Inicio Vigencia" DataTextField="FechaInicioVigencia" DataTextFormatString="{0:d}" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}"/>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LkbDescargarDoc" runat="server" OnClick="LkbDescargarDoc_Click" Visible="true" ClientIDMode="AutoID" AlternateText="Descargar" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i title='Subir Documento' class='fa fa-download' title='Descargar Documento' ></i>" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>

View File

@@ -6,6 +6,7 @@ using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
using System.Data;
using System.IO;
public partial class OI_Documentos : ClsPaginas
{
@@ -27,4 +28,32 @@ public partial class OI_Documentos : ClsPaginas
}
ObjOI.Dispose();
}
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lkButonAux = e.Row.FCLinkButton("LkbDescargarDoc");
ScriptManager.GetCurrent(this).RegisterPostBackControl(lkButonAux);
}
}
protected void LkbDescargarDoc_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
string ArchivoFisico = GvRow.DataKey("ArchivoFisico");
string NombreArchivo = ArchivoFisico.Split('_')[1];
string Ruta = string.Format("{0}Empresas/{1}/DocumentosRepo/{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ArchivoFisico);
byte[] archivoBytes = File.ReadAllBytes(Ruta);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", NombreArchivo));
HttpContext.Current.Response.AddHeader("Content-Length", archivoBytes.Length.ToString());
HttpContext.Current.Response.OutputStream.Write(archivoBytes, 0, archivoBytes.Length);
HttpContext.Current.Response.End();
}
}

View File

@@ -1294,7 +1294,7 @@ Partial Class Ventas_ClientesAbonar
If CveMonedaVenta = 1 And CveMoneda <> 1 Then
'factura pesos, pago en dolares
tImporteVenta = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion).RoundSQL
tImporteVenta = gvr.FCTextBox("TxtAbonar").Text.ToDecimal.RoundSQL
tImportePago = (((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVenta / tipoCambioPago).RoundSQL * tipoCambioPago).RoundSQL
ElseIf CveMonedaVenta <> 1 And CveMoneda <> 1 Then
'factura dolares, pago en dolares

View File

@@ -119,7 +119,7 @@ Partial Class Ventas_RepRecuperacion
End If
If ObjMovtos.GetRepRecuperacion(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1,
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString,
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString, CveBanco:=DdlBanco.SelectedValue.ToEntero,
EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjMovtos.DtResultados
DtDatos = ObjMovtos.DtResultados

View File

@@ -183,7 +183,7 @@ Partial Class Ventas_RepRecuperacionDetalle
DdlVendedor.SelectedValueExist(CveVendedor)
DdlSubProyecto.SelectedValueExist(CveSubProyecto)
If CveCliente > 0 Then
DdlClientes.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros($"CveCliente = {CveCliente}").Rows(0)("NombreComercial").ToString
DdlClientes.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial", "")
DdlClientes.SelectedValue = CveCliente.ToString
End If
DdlUsuario.SelectedValueExist(CveUsuario)

View File

@@ -9618,12 +9618,12 @@ Partial Class Ventas
'Agregamos el gasto de contrato
If CveContrato > 0 AndAlso factura.TipoDocto = "Rem" AndAlso AplicaGastoContrato Then
Dim ObjContrato As New ClsContratos
If Not ObjContrato.AddContratoGasto(CveContrato, Row("PS").ToString(), Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, factura.Fecha, UsuarioActual.CveUsuario, CveVenta:=ObjVentas.CveVenta) Then
If Not ObjContr.AddContratoGasto(CveContrato, Row("PS").ToString(), Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, factura.Fecha, UsuarioActual.CveUsuario, CveVenta:=ObjVentas.CveVenta) Then
ErrorList.Add("Ocurrió un error al agregar el gasto de la Factura.")
Exit For
End If
ObjContrato.Dispose()
End If
'Si es devolucion se agregan a la tabla de Vta_VentasDetalleDevolucion
@@ -20920,15 +20920,25 @@ Partial Class Ventas
If Not CveProducto > 0 Then
Return False
End If
Dim drP As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimero("")
Dim AplicaSeccion As Boolean = CBool(drP("AplicaSeccion"))
Dim AplicaSerie As Boolean = CBool(drP("AplicaSerie"))
Dim CveSeccionAlmacen As Integer = -1
If Dr("CveTipoInvPS").ToString().ToEntero() = 5 Then
If AplicaSerie Then
For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString(), FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < 1 Then
Return False
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, 1, CveUnidad, CveProducto, 0, -1, Serie:=Dr2("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
If AplicaSeccion Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
Else
CveSeccionAlmacen = -1
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, 1, CveUnidad, CveProducto, 0, -1, Serie:=Dr2("Serie").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
Return False
End If
Next
@@ -20938,7 +20948,13 @@ Partial Class Ventas
Return False
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, Cantidad, CveUnidad, CveProducto, 0, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
If AplicaSeccion Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
Else
CveSeccionAlmacen = -1
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, Cantidad, CveUnidad, CveProducto, 0, -1, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
Return False
End If
End If
@@ -20952,8 +20968,14 @@ Partial Class Ventas
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 9, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalidaConsignacion, Modulo:="Vta/E6")
If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
Dim CveSeccionAlmacen As Integer = -1
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
If CBool(Dr("AplicaSeccion")) Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenOrigenContrato, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
Else
CveSeccionAlmacen = -1
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
Return False
End If
Next