- cambio en PU

This commit is contained in:
rrene
2020-04-06 23:50:23 -07:00
parent a38c00030f
commit a3a98b2d1f

View File

@@ -1557,8 +1557,8 @@ Partial Class Inventarios_TraspasoAlmacen
'DEBE CONSIDERAR SOLO LAS FILAS QUE TENGA PRODUCTOS, NO EL TOTALIZADOR 'DEBE CONSIDERAR SOLO LAS FILAS QUE TENGA PRODUCTOS, NO EL TOTALIZADOR
If CvePS > 0 Then If CvePS > 0 Then
CveMovimientoDetalleSalida = GvRow.DataKey("CveMovimientoDetalle").ToString.ToEntero CveMovimientoDetalleSalida = GvRow.DataKey("CveMovimientoDetalle").ToString.ToEntero
Dim Cantidad As Double = GvRow.DataKey("Cantidad").ToString.ToDouble Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToString.ToDecimal
Dim PrecioUnitario As Double = GvRow.DataKey("PU").ToString.ToDouble Dim PrecioUnitario As Decimal = GvRow.DataKey("PU").ToString.ToDecimal
If CveMovimientoDetalleSalida <= 0 Then If CveMovimientoDetalleSalida <= 0 Then
ErrorMovInv = True ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida" TextoError = "Ocurrió un error al guardar los movimientos de salida"
@@ -1566,54 +1566,54 @@ Partial Class Inventarios_TraspasoAlmacen
End If End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow.DataKey("CveUM").ToEntero, CvePS, PrecioUnitario, GvRow.DataKey("CveAF").ToEntero, -1, GvRow.DataKey("SerieLote").ToString, Lote:=GvRow.DataKey("Lote"), Batch:=GvRow.DataKey("Batch"), CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow.DataKey("CveUM").ToEntero, CvePS, PrecioUnitario, GvRow.DataKey("CveAF").ToEntero, -1, GvRow.DataKey("SerieLote").ToString, Lote:=GvRow.DataKey("Lote"), Batch:=GvRow.DataKey("Batch"), CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
ErrorMovInv = True ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada" TextoError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For Exit For
End If
importe += Cantidad * PrecioUnitario
End If End If
importe += Cantidad * PrecioUnitario End If
End If Next
End If
Next
'If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then 'If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
' For Each Dr As DataRow In ObjInventario.DtResultados.Rows ' For Each Dr As DataRow In ObjInventario.DtResultados.Rows
' CveMovimientoDetalleSalida = Dr("CveMovimientoDetalle").ToString.ToEntero ' CveMovimientoDetalleSalida = Dr("CveMovimientoDetalle").ToString.ToEntero
' Dim Cantidad As Double = Dr("Cantidad").ToString.ToDouble ' Dim Cantidad As Double = Dr("Cantidad").ToString.ToDouble
' Dim PrecioUnitario As Double = Dr("PU").ToString.ToDouble ' Dim PrecioUnitario As Double = Dr("PU").ToString.ToDouble
' If CveMovimientoDetalleSalida <= 0 Then ' If CveMovimientoDetalleSalida <= 0 Then
' ErrorMovInv = True ' ErrorMovInv = True
' TextoError = "Ocurrió un error al guardar los movimientos de salida" ' TextoError = "Ocurrió un error al guardar los movimientos de salida"
' Exit For ' Exit For
' End If ' End If
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PrecioUnitario, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then ' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PrecioUnitario, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
' ErrorMovInv = True ' ErrorMovInv = True
' TextoError = "Ocurrió un error al guardar los movimientos de entrada" ' TextoError = "Ocurrió un error al guardar los movimientos de entrada"
' Exit For ' Exit For
' End If ' End If
' importe += Cantidad * PrecioUnitario ' importe += Cantidad * PrecioUnitario
' Next ' Next
'Else 'Else
' ErrorMovInv = True ' ErrorMovInv = True
' TextoError = "Ocurrió un error al obtener los movimientos de salida" ' TextoError = "Ocurrió un error al obtener los movimientos de salida"
'End If 'End If
If Not ErrorMovInv Then If Not ErrorMovInv Then
Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundSQL Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundSQL
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then
ErrorMovInv = True ErrorMovInv = True
TextoError = "Ocurrió un erro al cancelar el traspaso" TextoError = "Ocurrió un erro al cancelar el traspaso"
End If End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then
ErrorMovInv = True ErrorMovInv = True
TextoError = "Ocurrió un erro al cancelar el traspaso" TextoError = "Ocurrió un erro al cancelar el traspaso"
End If
End If End If
End If
End If End If
@@ -2901,7 +2901,7 @@ Partial Class Inventarios_TraspasoAlmacen
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim excelFile As ExcelFile = excelFile.Load(flatFilePath) Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
Dim unnamed As Integer = 0 Dim unnamed As Integer = 0
Dim cols As Integer Dim cols As Integer