This commit is contained in:
Raul Pimienta
2019-08-27 11:34:06 -07:00
4 changed files with 197 additions and 87 deletions

View File

@@ -1103,6 +1103,7 @@ Partial Class Bancos_IE
If (Not VerificaComplementos(True)) And UsuarioActual.TienePermisoProceso(99) And ObjIE.CveEstatusIE <> 2 Then If (Not VerificaComplementos(True)) And UsuarioActual.TienePermisoProceso(99) And ObjIE.CveEstatusIE <> 2 Then
BtnEditar.Visible = True BtnEditar.Visible = True
PermisoComplementoVigente = True PermisoComplementoVigente = True
Else Else
BtnEditar.Visible = True BtnEditar.Visible = True
End If End If

View File

@@ -456,7 +456,7 @@
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight> <FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight>
<Color>=iif(Fields!CveVenta.Value= "", "White", "Black")</Color> <Color>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","White","#67809F"), "Black")</Color>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -468,7 +468,7 @@
<Border> <Border>
<Style>None</Style> <Style>None</Style>
</Border> </Border>
<BackgroundColor>=iif(Fields!CveVenta.Value = "", "#67809F", "Transparent")</BackgroundColor> <BackgroundColor>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","#67809F","#cccccc"), "Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -490,7 +490,7 @@
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight> <FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight>
<Format>dd/MM/yyyy</Format> <Format>dd/MM/yyyy</Format>
<Color>=iif(Fields!CveVenta.Value= "", "White", "Black")</Color> <Color>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","White","#67809F"), "Black")</Color>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -504,7 +504,7 @@
<Border> <Border>
<Style>None</Style> <Style>None</Style>
</Border> </Border>
<BackgroundColor>=iif(Fields!CveVenta.Value = "", "#67809F", "Transparent")</BackgroundColor> <BackgroundColor>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","#67809F","#cccccc"), "Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -525,7 +525,7 @@
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight> <FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight>
<Color>=iif(Fields!CveVenta.Value= "", "White", "Black")</Color> <Color>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","White","#67809F"), "Black")</Color>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -537,7 +537,7 @@
<Border> <Border>
<Style>None</Style> <Style>None</Style>
</Border> </Border>
<BackgroundColor>=iif(Fields!CveVenta.Value = "", "#67809F", "Transparent")</BackgroundColor> <BackgroundColor>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","#67809F","#cccccc"), "Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -555,11 +555,11 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Fields!Nombre.Value</Value> <Value>=IIf(Fields!Nombre.Value = "", IIf(Fields!Gpo.Value = "", Fields!Moneda.Value, Fields!Gpo.Value), Fields!Nombre.Value)</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight> <FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight>
<Color>=iif(Fields!CveVenta.Value= "", "White", "Black")</Color> <Color>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","White","#67809F"), "Black")</Color>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -571,13 +571,14 @@
<Border> <Border>
<Style>None</Style> <Style>None</Style>
</Border> </Border>
<BackgroundColor>=iif(Fields!CveVenta.Value = "", "#67809F", "Transparent")</BackgroundColor> <BackgroundColor>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","#67809F","#cccccc"), "Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<rd:Selected>true</rd:Selected>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell> <TablixCell>
@@ -592,7 +593,7 @@
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight> <FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight>
<Color>=iif(Fields!CveVenta.Value= "", "White", "Black")</Color> <Color>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","White","#67809F"), "Black")</Color>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -606,7 +607,7 @@
<Border> <Border>
<Style>None</Style> <Style>None</Style>
</Border> </Border>
<BackgroundColor>=iif(Fields!CveVenta.Value = "", "#67809F", "Transparent")</BackgroundColor> <BackgroundColor>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","#67809F","#cccccc"), "Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -629,7 +630,7 @@
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight> <FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight>
<Format>f2</Format> <Format>f2</Format>
<Color>=iif(Fields!CveVenta.Value= "", "White", "Black")</Color> <Color>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","White","#67809F"), "Black")</Color>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -641,7 +642,7 @@
<Border> <Border>
<Style>None</Style> <Style>None</Style>
</Border> </Border>
<BackgroundColor>=iif(Fields!CveVenta.Value = "", "#67809F", "Transparent")</BackgroundColor> <BackgroundColor>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","#67809F","#cccccc"), "Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -664,7 +665,7 @@
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight> <FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight>
<Format>#,0.00;- #,0.00;'-'</Format> <Format>#,0.00;- #,0.00;'-'</Format>
<Color>=iif(Fields!CveVenta.Value= "", "White", "Black")</Color> <Color>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","White","#67809F"), "Black")</Color>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -678,7 +679,7 @@
<Border> <Border>
<Style>None</Style> <Style>None</Style>
</Border> </Border>
<BackgroundColor>=iif(Fields!CveVenta.Value = "", "#67809F", "Transparent")</BackgroundColor> <BackgroundColor>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","#67809F","#cccccc"), "Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -701,7 +702,7 @@
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight> <FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight>
<Format>#,0.00;- #,0.00;'-'</Format> <Format>#,0.00;- #,0.00;'-'</Format>
<Color>=iif(Fields!CveVenta.Value= "", "White", "Black")</Color> <Color>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","White","#67809F"), "Black")</Color>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -715,7 +716,7 @@
<Border> <Border>
<Style>None</Style> <Style>None</Style>
</Border> </Border>
<BackgroundColor>=iif(Fields!CveVenta.Value = "", "#67809F", "Transparent")</BackgroundColor> <BackgroundColor>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","#67809F","#cccccc"), "Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -737,7 +738,7 @@
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight> <FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight>
<Format>#,0.00;-#,0.00;'-'</Format> <Format>#,0.00;-#,0.00;'-'</Format>
<Color>=iif(Fields!CveVenta.Value= "", "White", "Black")</Color> <Color>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","White","#67809F"), "Black")</Color>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -751,7 +752,7 @@
<Border> <Border>
<Style>None</Style> <Style>None</Style>
</Border> </Border>
<BackgroundColor>=iif(Fields!CveVenta.Value = "", "#67809F", "Transparent")</BackgroundColor> <BackgroundColor>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","#67809F","#cccccc"), "Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -773,7 +774,7 @@
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight> <FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight>
<Format>#,0.00;- #,0.00;'-'</Format> <Format>#,0.00;- #,0.00;'-'</Format>
<Color>=iif(Fields!CveVenta.Value= "", "White", "Black")</Color> <Color>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","White","#67809F"), "Black")</Color>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -787,7 +788,7 @@
<Border> <Border>
<Style>None</Style> <Style>None</Style>
</Border> </Border>
<BackgroundColor>=iif(Fields!CveVenta.Value = "", "#67809F", "Transparent")</BackgroundColor> <BackgroundColor>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","#67809F","#cccccc"), "Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -810,7 +811,7 @@
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight> <FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight>
<Format>#,0.00;-#,0.00;'-'</Format> <Format>#,0.00;-#,0.00;'-'</Format>
<Color>=iif(Fields!CveVenta.Value= "", "White", "Black")</Color> <Color>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","White","#67809F"), "Black")</Color>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@@ -824,7 +825,7 @@
<Border> <Border>
<Style>None</Style> <Style>None</Style>
</Border> </Border>
<BackgroundColor>=iif(Fields!CveVenta.Value = "", "#67809F", "Transparent")</BackgroundColor> <BackgroundColor>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","#67809F","#cccccc"), "Transparent")</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft> <PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight> <PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop> <PaddingTop>2pt</PaddingTop>
@@ -896,14 +897,16 @@
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style /> <Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName> <rd:DefaultName>Textbox1</rd:DefaultName>
<Top>0.18521cm</Top> <Top>0.18521cm</Top>
<Left>2.8349cm</Left> <Left>3.37444cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>12.60299cm</Width> <Width>21.20747cm</Width>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -949,9 +952,9 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName> <rd:DefaultName>Textbox2</rd:DefaultName>
<Top>1.10271cm</Top> <Top>1.10271cm</Top>
<Left>8.17404cm</Left> <Left>9.22743cm</Left>
<Height>0.52945cm</Height> <Height>0.52945cm</Height>
<Width>10.36447cm</Width> <Width>10.12635cm</Width>
<ZIndex>1</ZIndex> <ZIndex>1</ZIndex>
<Style> <Style>
<Border> <Border>
@@ -1018,7 +1021,7 @@
</Style> </Style>
</PageHeader> </PageHeader>
<PageFooter> <PageFooter>
<Height>0.58209cm</Height> <Height>1.04773cm</Height>
<PrintOnFirstPage>true</PrintOnFirstPage> <PrintOnFirstPage>true</PrintOnFirstPage>
<PrintOnLastPage>true</PrintOnLastPage> <PrintOnLastPage>true</PrintOnLastPage>
<ReportItems> <ReportItems>
@@ -1140,9 +1143,9 @@
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox10</rd:DefaultName> <rd:DefaultName>Textbox10</rd:DefaultName>
<Top>0.0829cm</Top> <Top>0.0829cm</Top>
<Left>9.84544cm</Left> <Left>10.83183cm</Left>
<Height>0.38981cm</Height> <Height>0.38981cm</Height>
<Width>2.92333cm</Width> <Width>2.91804cm</Width>
<ZIndex>3</ZIndex> <ZIndex>3</ZIndex>
<Style> <Style>
<Border> <Border>
@@ -1161,22 +1164,56 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Parameters!FechaImpresion.Value</Value> <Value>=Globals!ExecutionTime</Value>
<Style>
<FontSize>9pt</FontSize>
<Format>g</Format>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox11</rd:DefaultName>
<Top>0.0829cm</Top>
<Left>13.56466cm</Left>
<Height>0.38981cm</Height>
<Width>6.47703cm</Width>
<ZIndex>4</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox14">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>IMPRESO EN SIG, Rep. Productos Servicios</Value>
<Style> <Style>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
<Format>D</Format>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style /> <Style />
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox11</rd:DefaultName> <rd:DefaultName>Textbox9</rd:DefaultName>
<Top>0.0829cm</Top> <Top>0.50799cm</Top>
<Left>12.75466cm</Left> <Left>0.06614cm</Left>
<Height>0.38981cm</Height> <Height>0.38981cm</Height>
<Width>4.32745cm</Width> <Width>6.69369cm</Width>
<ZIndex>4</ZIndex> <ZIndex>5</ZIndex>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -1272,6 +1309,14 @@
<DataField>Nombre</DataField> <DataField>Nombre</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
</Field> </Field>
<Field Name="Gpo">
<DataField>Gpo</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Moneda">
<DataField>Moneda</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Codigo"> <Field Name="Codigo">
<DataField>Codigo</DataField> <DataField>Codigo</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
@@ -1331,6 +1376,7 @@
<Prompt>ReportParameter1</Prompt> <Prompt>ReportParameter1</Prompt>
</ReportParameter> </ReportParameter>
</ReportParameters> </ReportParameters>
<Language>es-MX</Language>
<rd:ReportUnitType>Cm</rd:ReportUnitType> <rd:ReportUnitType>Cm</rd:ReportUnitType>
<rd:ReportID>40c94aad-a12a-44fb-ab0d-ea36a9656792</rd:ReportID> <rd:ReportID>40c94aad-a12a-44fb-ab0d-ea36a9656792</rd:ReportID>
</Report> </Report>

View File

@@ -5,6 +5,8 @@ Imports System.Data
Imports Extensiones Imports Extensiones
Imports System.Xml Imports System.Xml
Imports Microsoft.Reporting.WebForms Imports Microsoft.Reporting.WebForms
Imports GemBox.Spreadsheet
Partial Class General_SaldosIniciales Partial Class General_SaldosIniciales
Inherits ClsPaginas Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -25,44 +27,46 @@ Partial Class General_SaldosIniciales
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
Dim dt As New DataTable Dim dt As New DataTable
Dim Conexion As Odbc.OdbcConnection = Nothing ' Conexion As Odbc.OdbcConnection = Nothing
Dim ErrorArchivo = False Dim ErrorArchivo = False
Dim ErrorExcel = False Dim ErrorExcel = False
Dim strConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + Ruta + FileName + ";Extended Properties=""Excel 12.0 Xml;HDR=YES;IMEX=1;"""
Dim objDbFactory As Common.DbProviderFactory = Common.DbProviderFactories.GetFactory("System.Data.OleDb") dt = ReadExcelFile(Ruta + FileName, True)
Dim objDbAdapter As Common.DbDataAdapter = objDbFactory.CreateDataAdapter() 'Dim strConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + Ruta + FileName + ";Extended Properties=""Excel 12.0 Xml;HDR=YES;IMEX=1;"""
Dim objDbConnection As Common.DbConnection = objDbFactory.CreateConnection() 'Dim objDbFactory As Common.DbProviderFactory = Common.DbProviderFactories.GetFactory("System.Data.OleDb")
objDbConnection.ConnectionString = strConnString 'Dim objDbAdapter As Common.DbDataAdapter = objDbFactory.CreateDataAdapter()
objDbConnection.Open() 'Dim objDbConnection As Common.DbConnection = objDbFactory.CreateConnection()
Dim objSheetNames As DataTable = objDbConnection.GetSchema("Tables") 'objDbConnection.ConnectionString = strConnString
Dim HojaExcel As String = objSheetNames.FiltroPrimeroValor("TABLE_NAME") 'objDbConnection.Open()
Try 'Dim objSheetNames As DataTable = objDbConnection.GetSchema("Tables")
Select Case Tipo 'Dim HojaExcel As String = objSheetNames.FiltroPrimeroValor("TABLE_NAME")
Case "CSV" 'Try
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Access Text Driver (*.txt, *.csv)};Dbq=" + Ruta + ";Extensions=asc,csv,tab,txt;") ' Select Case Tipo
Conexion.Open() ' Case "CSV"
Dim cmd = Conexion.CreateCommand() ' Conexion = New Odbc.OdbcConnection("Driver={Microsoft Access Text Driver (*.txt, *.csv)};Dbq=" + Ruta + ";Extensions=asc,csv,tab,txt;")
cmd.CommandType = CommandType.Text ' Conexion.Open()
cmd.CommandText = $"SELECT * FROM [{FileName}]" ' Dim cmd = Conexion.CreateCommand()
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd) ' cmd.CommandType = CommandType.Text
DataAdapter.Fill(dt) ' cmd.CommandText = $"SELECT * FROM [{FileName}]"
Case "EXCEL" ' Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";") ' DataAdapter.Fill(dt)
Conexion.Open() ' Case "EXCEL"
Dim cmd = Conexion.CreateCommand() ' Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
cmd.CommandType = CommandType.Text ' Conexion.Open()
cmd.CommandText = $"SELECT * FROM [{HojaExcel}]" ' Dim cmd = Conexion.CreateCommand()
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd) ' cmd.CommandType = CommandType.Text
DataAdapter.Fill(dt) ' cmd.CommandText = $"SELECT * FROM [{HojaExcel}]"
Case Else ' Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError) ' DataAdapter.Fill(dt)
Exit Sub ' Case Else
End Select ' Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
Catch ex As Exception ' Exit Sub
ErrorArchivo = True ' End Select
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex) 'Catch ex As Exception
End Try ' ErrorArchivo = True
Conexion.Close() ' OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
'End Try
'Conexion.Close()
If Not ErrorArchivo Then If Not ErrorArchivo Then
If RblFormato.SelectedValue = "1" Or RblFormato.SelectedValue = "2" Then If RblFormato.SelectedValue = "1" Or RblFormato.SelectedValue = "2" Then
If Not dt.Columns(0).ColumnName = "Codigo" Then If Not dt.Columns(0).ColumnName = "Codigo" Then
@@ -1523,57 +1527,69 @@ Partial Class General_SaldosIniciales
ElseIf RblFormato.SelectedValue = "12" Then ElseIf RblFormato.SelectedValue = "12" Then
Dim ObjMovimientos As New ClsInventarios Dim ObjMovimientos As New ClsInventarios
ObjMovimientos.IniciaTransacSQL() ObjMovimientos.IniciaTransacSQL()
Dim OcurrioError As Boolean = False
Dim ProductosServiciosRef As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
Dim AlmacenRef As DataTable = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
Dim contadorMovimientos As Integer = 0 Dim contadorMovimientos As Integer = 0
Dim listadoMovimientos As String = "" Dim listadoMovimientos As String = ""
Dim mensajeError As String = ""
Try Try
For Each almacenSinRepetir As DataRow In dt.FiltraParametros("", DistinctColumns:={"Almacen"}).Rows For Each almacenSinRepetir As DataRow In dt.FiltraParametros("", DistinctColumns:={"Almacen"}).Rows
Dim almacenActual As String = almacenSinRepetir("Almacen").ToString Dim almacenActual As String = almacenSinRepetir("Almacen").ToString
Dim CveAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"Almacen = '{almacenActual}'").ToEntero 'Dim CveAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"Almacen = '{almacenActual}'").ToEntero
Dim CveAlmacen As Integer = AlmacenRef.FiltroPrimeroValor("CveAlmacen", $"Almacen = '{almacenActual}'").ToEntero
Dim movimientoCabecera As Integer = ObjMovimientos.AddMovimiento(CveAlmacen, 1, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1) Dim movimientoCabecera As Integer = ObjMovimientos.AddMovimiento(CveAlmacen, 1, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
listadoMovimientos += $"movimiento con folio <a href='/Inventarios/EntradasSalidas.aspx?CveMovimiento={movimientoCabecera}' target='_blank' style='color:blue'>{ObjMovimientos.Folio}</a><br/>" listadoMovimientos += $"movimiento con folio <a href='/Inventarios/EntradasSalidas.aspx?CveMovimiento={movimientoCabecera}' target='_blank' style='color:blue'>{ObjMovimientos.Folio}</a><br/>"
If CveAlmacen > 0 Then If CveAlmacen > 0 Then
contadorMovimientos += 1 contadorMovimientos += 1
For Each nuevaEntrada As DataRow In dt.FiltraParametros($"Almacen = '{almacenActual}'").Rows For Each nuevaEntrada As DataRow In dt.FiltraParametros($"Almacen = '{almacenActual}'").Rows
Dim CvePS As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", $"Codigo = '{nuevaEntrada("CodigoPS")}'").ToEntero Dim RowPS As DataRow = ProductosServiciosRef.FiltroPrimero($"Codigo = '{nuevaEntrada("CodigoPS")}' AND CveEmpresa = {UsuarioActual.CveEmpresa}")
Dim CveUM As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"Codigo = '{nuevaEntrada("CodigoPS")}'").ToEntero
Dim CvePS As Integer = RowPS("CvePS").ToString().ToEntero
Dim CveUM As Integer = RowPS("CveUnidadMedida").ToString().ToEntero
If CvePS > 0 Then If CvePS > 0 Then
If CveUM > 0 Then If CveUM > 0 Then
Dim Cantidad As Decimal = nuevaEntrada("Existencia").ToString.ToDecimal Dim Cantidad As Decimal = nuevaEntrada("Existencia").ToString.ToDecimal
Dim Valor As Decimal = nuevaEntrada("Valor").ToString.ToDecimal Dim Valor As Decimal = nuevaEntrada("Valor").ToString.ToDecimal
If Not ObjMovimientos.AddMovimientoDetalle(movimientoCabecera, Cantidad, CveUM, CvePS, (Valor / Cantidad), -1, -1) Then If Not ObjMovimientos.AddMovimientoDetalle(movimientoCabecera, Cantidad, CveUM, CvePS, (Valor / Cantidad), -1, -1) Then
OcurrioError = True mensajeError = "No se logró generar el detalle del movimiento"
Throw New Exception()
End If End If
Else Else
OcurrioError = True mensajeError = $"La unidad de medida no se reconoce para el producto servicio:{nuevaEntrada("CodigoPS")}"
Throw New Exception()
End If End If
Else Else
OcurrioError = True mensajeError = $"No se encontró el producto o servicio con código ""{nuevaEntrada("CodigoPS")}"""
Throw New Exception()
End If End If
Next Next
Else Else
OcurrioError = True mensajeError = $"No se encontró el almacén con nombre ""{almacenActual}"""
'alert amacén no existe Throw New Exception()
Exit For Exit For
End If End If
Next Next
Catch ex As Exception Catch ex As Exception
OcurrioError = True If mensajeError = "" Then
mensajeError = "Error técnico, informar a soporte"
End If
ObjMovimientos.RollBack() ObjMovimientos.RollBack()
End Try End Try
If Not OcurrioError Then If mensajeError = "" Then
ObjMovimientos.Commit() ObjMovimientos.Commit()
Alert($"Se cargaron correctamente {contadorMovimientos} movimientos<br/><br/>{listadoMovimientos}") Alert($"Se cargaron correctamente {contadorMovimientos} movimientos<br/><br/>{listadoMovimientos}")
Else Else
Alert("Ocurrió un error al cargar las existencias", TipoMensaje.MsgError) Alert(mensajeError, TipoMensaje.MsgError)
ObjMovimientos.RollBack() ObjMovimientos.RollBack()
End If End If
ObjMovimientos.Dispose() ObjMovimientos.Dispose()
ProductosServiciosRef.Dispose()
AlmacenRef.Dispose()
End If End If
End If End If
@@ -1618,5 +1634,51 @@ Partial Class General_SaldosIniciales
End If End If
End Sub End Sub
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
Dim unnamed As Integer = 0
Dim cols As Integer
Dim columns As String()
Dim curRow As Integer = 0
Dim curCol As Integer = 0
Dim dataTable As DataTable = New DataTable()
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
If firstRowHasHeaders Then
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
Else
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
End If
curRow = 1
Else
dataTable.Columns.Add("Column " & (cols + 1))
End If
Next
While curRow < worksheet.Rows.Count
columns = New String(cols - 1) {}
For curCol = 0 To cols - 1
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
columns(curCol) = ""
Else
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
End If
Next
dataTable.Rows.Add(columns)
curRow += 1
End While
Return dataTable
End Function
End Class End Class

View File

@@ -661,6 +661,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
params.Add(New ReportParameter("LogoPath", "")) params.Add(New ReportParameter("LogoPath", ""))
End If End If
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
ImprimirPDF("Empresas/Grales/Formatos/RepProductosServiciosDetalle.rdlc", TmpDT, params, "ReportePS") ImprimirPDF("Empresas/Grales/Formatos/RepProductosServiciosDetalle.rdlc", TmpDT, params, "ReportePS")