-
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports GemBox.Spreadsheet
|
Imports GemBox.Spreadsheet
|
||||||
|
Imports Telerik.Web.UI.GridExcelBuilder
|
||||||
|
|
||||||
Partial Class Inventarios_AjustesSeccionAlmacen
|
Partial Class Inventarios_AjustesSeccionAlmacen
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -40,10 +41,10 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
|||||||
If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacen.SelectedValue.ToEntero, DdlClasificaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FolioAux, CvePS.ToEntero) Then
|
If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacen.SelectedValue.ToEntero, DdlClasificaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FolioAux, CvePS.ToEntero) Then
|
||||||
GvD.DataSource = ObjInv.DtResultados
|
GvD.DataSource = ObjInv.DtResultados
|
||||||
|
|
||||||
If ObjInv.DtResultados.FiltraParametros("Serie <> '' ").Rows.Count = 0 Then GvD.columns(2).visible = False
|
If ObjInv.DtResultados.FiltraParametros("Serie <> '' ").Rows.Count = 0 Then GvD.Columns(2).Visible = False
|
||||||
If ObjInv.DtResultados.FiltraParametros("Lote <> ''").Rows.Count = 0 Then GvD.columns(3).visible = False
|
If ObjInv.DtResultados.FiltraParametros("Lote <> ''").Rows.Count = 0 Then GvD.Columns(3).Visible = False
|
||||||
If ObjInv.DtResultados.FiltraParametros("FechaCaducidad IS NOT NULL ").Rows.Count = 0 Then GvD.columns(4).visible = False
|
If ObjInv.DtResultados.FiltraParametros("FechaCaducidad IS NOT NULL ").Rows.Count = 0 Then GvD.Columns(4).Visible = False
|
||||||
If ObjInv.DtResultados.FiltraParametros("CveSeccionAlmacen > 0").Rows.Count = 0 Then GvD.columns(5).visible = False
|
If ObjInv.DtResultados.FiltraParametros("CveSeccionAlmacen > 0").Rows.Count = 0 Then GvD.Columns(5).Visible = False
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -76,14 +77,12 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
|||||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
|
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
|
||||||
Dim Dtt As DataTable = Nothing
|
Dim Dtt As DataTable = Nothing
|
||||||
Dim CveMovimientoEntrada As Integer = 0
|
Dim CveMovimientoEntrada As Integer = 0
|
||||||
Dim Folio = 0
|
Dim Folio As Integer = 0
|
||||||
Dim ErrorMovInv As Boolean = False
|
Dim ErrorMovInv As Boolean = False
|
||||||
Dim TextoError = ""
|
Dim TextoError As String = ""
|
||||||
Dim Contador As Integer = 0
|
Dim Contador As Integer = 0
|
||||||
Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero
|
Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim Fecha As Date = DateTime.Now
|
Dim Fecha As Date = DateTime.Now
|
||||||
'AGREGAMOS LA ENTRADA
|
'AGREGAMOS LA ENTRADA
|
||||||
Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 44, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 44, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
||||||
@@ -153,7 +152,6 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
|||||||
Contador += 1
|
Contador += 1
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If Not ErrorMovInv AndAlso Contador > 0 Then
|
If Not ErrorMovInv AndAlso Contador > 0 Then
|
||||||
@@ -165,11 +163,11 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
|||||||
Dim ind As Integer = 0
|
Dim ind As Integer = 0
|
||||||
|
|
||||||
For Each Row As DataRow In resultado.Rows
|
For Each Row As DataRow In resultado.Rows
|
||||||
Dim CvePS = Row("CvePS").ToString().ToEntero()
|
Dim CvePS As Integer = Row("CvePS").ToString().ToEntero()
|
||||||
Cantidad = Row("Cantidad").ToString.ToDecimal()
|
Cantidad = Row("Cantidad").ToString.ToDecimal()
|
||||||
Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal()
|
Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal()
|
||||||
Dim CveUM As Integer = Row("CveUM").ToString().ToEntero()
|
Dim CveUM As Integer = Row("CveUM").ToString().ToEntero()
|
||||||
Dim CveSeccionAlmacen As Integer = Lista(Row("CvePS")).ToString().ToEntero() 'GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero()
|
Dim CveSeccionAlmacen As Integer = 0 ' Lista(Row("CvePS").ToString().ToEntero()).ToString.ToEntero 'GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero()
|
||||||
Dim CostoIndirecto As Decimal = Row("CostoIndirecto").ToString().ToDecimal()
|
Dim CostoIndirecto As Decimal = Row("CostoIndirecto").ToString().ToDecimal()
|
||||||
Dim Serie As String = Row("Serie").ToString()
|
Dim Serie As String = Row("Serie").ToString()
|
||||||
Dim Lote As String = Row("Lote").ToString()
|
Dim Lote As String = Row("Lote").ToString()
|
||||||
@@ -303,7 +301,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
|||||||
|
|
||||||
Dim FileExcel As New ExcelFile()
|
Dim FileExcel As New ExcelFile()
|
||||||
|
|
||||||
Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName)
|
Dim worksheet As ExcelWorksheet = FileExcel.Worksheets.Add(DtExcel.TableName)
|
||||||
worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With
|
worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With
|
||||||
{
|
{
|
||||||
.ColumnHeaders = True,
|
.ColumnHeaders = True,
|
||||||
@@ -313,8 +311,8 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
|||||||
worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255))
|
worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255))
|
||||||
worksheet.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255)
|
worksheet.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255)
|
||||||
|
|
||||||
Dim columnCount = worksheet.CalculateMaxUsedColumns()
|
Dim columnCount As Integer = worksheet.CalculateMaxUsedColumns()
|
||||||
For i = 0 To columnCount
|
For i As Integer = 0 To columnCount
|
||||||
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
|
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
|
||||||
Next
|
Next
|
||||||
|
|
||||||
@@ -344,7 +342,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
|||||||
Private Sub CargarArchivo(Ruta As String, FileName As String, CveAlmacen As Integer, CveSubProyecto As Integer)
|
Private Sub CargarArchivo(Ruta As String, FileName As String, CveAlmacen As Integer, CveSubProyecto As Integer)
|
||||||
Dim DtExcel As DataTable = ReadExcelFile(Ruta + FileName, True)
|
Dim DtExcel As DataTable = ReadExcelFile(Ruta + FileName, True)
|
||||||
|
|
||||||
Dim ErrorArchivo = False
|
Dim ErrorArchivo As Boolean = False
|
||||||
If Not ErrorArchivo AndAlso DtExcel IsNot Nothing Then
|
If Not ErrorArchivo AndAlso DtExcel IsNot Nothing Then
|
||||||
If Not DtExcel.Columns(0).ColumnName = "Cantidad" Then
|
If Not DtExcel.Columns(0).ColumnName = "Cantidad" Then
|
||||||
Alert("El nombre de la primera columna debe ser 'Código'.Favor de corregirlo", TipoMensaje.MsgError)
|
Alert("El nombre de la primera columna debe ser 'Código'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
@@ -397,11 +395,11 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'SALIDA ALMACÉN
|
'SALIDA ALMACÉN
|
||||||
Dim CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacen, 3, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="", TipoCambio:=-1,
|
Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="", TipoCambio:=-1,
|
||||||
MovimientoFijo:=False, Modulo:="ASA/SA")
|
MovimientoFijo:=False, Modulo:="ASA/SA")
|
||||||
|
|
||||||
'ENTRADA ALMACÉN
|
'ENTRADA ALMACÉN
|
||||||
Dim CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 2, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="", TipoCambio:=-1,
|
Dim CveMovimientoEntrada As Integer = ObjInventario.AddMovimiento(CveAlmacen, 2, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="", TipoCambio:=-1,
|
||||||
MovimientoFijo:=False, Modulo:="ASA/EA", CveMovimientoRelacionado:=CveMovimientoSalida)
|
MovimientoFijo:=False, Modulo:="ASA/EA", CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||||
|
|
||||||
Dim dtSecciones As DataTable = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, CveAlmacen)
|
Dim dtSecciones As DataTable = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, CveAlmacen)
|
||||||
@@ -478,7 +476,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
|||||||
resultado = ObjInventario.DtResultados
|
resultado = ObjInventario.DtResultados
|
||||||
Dim RowEntrada As DataRow = ObjInventario.DtResultados.Rows(0)
|
Dim RowEntrada As DataRow = ObjInventario.DtResultados.Rows(0)
|
||||||
|
|
||||||
Dim CvePSEntrada = RowEntrada("CvePS").ToString().ToEntero()
|
Dim CvePSEntrada As Integer = RowEntrada("CvePS").ToString().ToEntero()
|
||||||
Dim PUEntrada As Decimal = RowEntrada("PUOriginal").ToString().ToDecimal()
|
Dim PUEntrada As Decimal = RowEntrada("PUOriginal").ToString().ToDecimal()
|
||||||
Dim CveUMEntrada As Integer = RowEntrada("CveUM").ToString().ToEntero()
|
Dim CveUMEntrada As Integer = RowEntrada("CveUM").ToString().ToEntero()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user