Merge branch 'master' of http://jperez@adsistemasof.sytes.net:8383/SIG.git
This commit is contained in:
@@ -1259,9 +1259,9 @@ Public Class ClsInventarios
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function AddMovimientoDetalle(CveMovimiento As Integer, Cantidad As Double, CveUM As Integer, CvePS As Integer, PU As Double, CveAF As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional SerieLote As String = "",
|
||||
Optional Observaciones As String = "", Optional CveMovimientoDetalleEntrada As Integer = -1, Optional PUTC As Double = -1, Optional FechaCaducidad As Date = MinFecha,
|
||||
Optional CostoIndirecto As Double = 0, Optional CveCompraDetalle As Integer = -1, Optional CveOrdenCompraDetalle As Integer = -1, Optional CveVentaDetalle As Integer = -1,
|
||||
Public Function AddMovimientoDetalle(CveMovimiento As Integer, Cantidad As Double, CveUM As Integer, CvePS As Integer, PU As Decimal, CveAF As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional SerieLote As String = "",
|
||||
Optional Observaciones As String = "", Optional CveMovimientoDetalleEntrada As Integer = -1, Optional PUTC As Decimal = -1, Optional FechaCaducidad As Date = MinFecha,
|
||||
Optional CostoIndirecto As Decimal = 0, Optional CveCompraDetalle As Integer = -1, Optional CveOrdenCompraDetalle As Integer = -1, Optional CveVentaDetalle As Integer = -1,
|
||||
Optional Lote As String = "", Optional Batch As String = "", Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -1271,7 +1271,7 @@ Public Class ClsInventarios
|
||||
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
|
||||
.Add("@CveUM", SqlDbType.Int).Value = CveUM
|
||||
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
|
||||
.Add("@PU", SqlDbType.Float).Value = PU
|
||||
.Add("@PU", SqlDbType.Decimal).Value = PU
|
||||
.Add("@PUTC", SqlDbType.Money).Value = PUTC
|
||||
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
@@ -1282,7 +1282,7 @@ Public Class ClsInventarios
|
||||
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
|
||||
.Add("@CveMovimientoDetalleEntrada", SqlDbType.Int).Value = CveMovimientoDetalleEntrada
|
||||
.Add("@FechaCaducidad", SqlDbType.Date).Value = FechaCaducidad
|
||||
.Add("@CostoIndirecto", SqlDbType.Float).Value = CostoIndirecto
|
||||
.Add("@CostoIndirecto", SqlDbType.Decimal).Value = CostoIndirecto
|
||||
.Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle
|
||||
.Add("@CveOrdenCompraDetalle", SqlDbType.Int).Value = CveOrdenCompraDetalle
|
||||
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle
|
||||
|
||||
@@ -5191,7 +5191,7 @@ Public Class ClsPaginas
|
||||
If fllreport IsNot Nothing Then fllreport.liberarecursos()
|
||||
|
||||
sw.Stop()
|
||||
If sw.Elapsed.TotalSeconds > 10 Then
|
||||
If sw.Elapsed.TotalSeconds > 1 Then
|
||||
GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ")
|
||||
End If
|
||||
|
||||
|
||||
14556
App_Code/Modelos.vb
14556
App_Code/Modelos.vb
File diff suppressed because it is too large
Load Diff
@@ -4312,7 +4312,7 @@ Partial Class Compras_Compras
|
||||
Dim ImporteCompra As Decimal = TxtTotal.Text.ToDecimal
|
||||
Dim MultiplicadorNC = If(DdlTipoComprobante.SelectedValue = "NC", -1, 1)
|
||||
Dim CveMovimientoInventario As Integer = -1
|
||||
Dim IVA = 1.16
|
||||
Dim IVA As Decimal = 1.16D
|
||||
Dim ListaMovimientosAlmacen As New List(Of Integer)
|
||||
|
||||
Dim ErrorCreditoCapitalIntres As Boolean = False
|
||||
@@ -4326,9 +4326,9 @@ Partial Class Compras_Compras
|
||||
Dim ConceptoPoliza As String = String.Format("{0} - {1}{2} - {3}", NombreProveedor, TxtSerie.Text, TxtFolio.Text, TxtDescripcion.Text.Trim)
|
||||
|
||||
'TIPO CAMBIO MANUAL CON COMPRA NUEVA
|
||||
Dim TipoCambioGuardar = 1.0
|
||||
Dim TipoCambioGuardar As Decimal = 1
|
||||
If DdlMoneda.SelectedValue.ToEntero > 1 Then
|
||||
TipoCambioGuardar = If(DivTC.Visible, TxtTC.Text.ToDouble, LblTC.Text.Substring(3).ToDouble)
|
||||
TipoCambioGuardar = If(DivTC.Visible, TxtTC.Text.ToDecimal, LblTC.Text.Substring(3).ToDecimal)
|
||||
End If
|
||||
TipoCambio = If(DivTC.Visible, TipoCambioGuardar, TipoCambio)
|
||||
|
||||
@@ -5041,7 +5041,7 @@ Partial Class Compras_Compras
|
||||
Dim folio = 0
|
||||
Dim fecha As Date = TxtFecha.Text.ToDate
|
||||
Dim indice = 0
|
||||
Dim importeconcepto = 0.0
|
||||
Dim importeconcepto As Decimal = 0
|
||||
|
||||
Dim listalmacenes = (From cvealmacen In DtInv.AsEnumerable() Where cvealmacen.Field(Of Integer)("cvealmacen") > 0 Select cvealmacen.Field(Of Integer)("cvealmacen")).Distinct().ToList
|
||||
|
||||
@@ -5086,8 +5086,8 @@ Partial Class Compras_Compras
|
||||
For Each dr As DataRow In DtInv.Rows
|
||||
If dr("cvealmacen").ToString.ToEntero = tcvealmacen Then
|
||||
'hay que restarle descuento
|
||||
importeconcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, dr("pu").ToString.ToDouble, dr("pu").ToString.ToDouble * TipoCambioGuardar) - (If(DdlMoneda.SelectedValue.ToEntero = 1, dr("descuento").ToString.ToDouble, dr("descuento").ToString.ToDouble * TipoCambioGuardar) / dr("cantidad").ToString.ToDouble)
|
||||
If Not ObjInventario.AddMovimientoDetalle(cvemovimientoentrada, dr("cantidad").ToString.ToDouble, dr("cveum").ToString.ToEntero, dr("cveps").ToString.ToEntero, importeconcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, dr("pu").ToString.ToDouble), CveCompraDetalle:=dr("CveCompraDetalle").ToString.ToEntero) Then
|
||||
importeconcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, dr("pu").ToString.ToDecimal, dr("pu").ToString.ToDecimal * TipoCambioGuardar) - (If(DdlMoneda.SelectedValue.ToEntero = 1, dr("descuento").ToString.ToDecimal, dr("descuento").ToString.ToDecimal * TipoCambioGuardar) / dr("cantidad").ToString.ToDecimal)
|
||||
If Not ObjInventario.AddMovimientoDetalle(cvemovimientoentrada, dr("cantidad").ToString.ToDouble, dr("cveum").ToString.ToEntero, dr("cveps").ToString.ToEntero, importeconcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, dr("pu").ToString.ToDecimal), CveCompraDetalle:=dr("CveCompraDetalle").ToString.ToEntero) Then
|
||||
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
@@ -5145,7 +5145,7 @@ Partial Class Compras_Compras
|
||||
Dim i As Integer = 0
|
||||
Dim ListAlmacenes = (From CveAlmacen In DtInv.AsEnumerable() Where CveAlmacen.Field(Of Integer)("CveAlmacen") > 0 Select CveAlmacen.Field(Of Integer)("CveAlmacen")).Distinct().ToList
|
||||
Dim indice = 0
|
||||
Dim ImporteConcepto = 0.0
|
||||
Dim ImporteConcepto As Decimal = 0
|
||||
|
||||
For Each tCveAlmacen As Integer In ListAlmacenes
|
||||
If GvInv.Rows(indice).FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then
|
||||
@@ -5165,10 +5165,10 @@ Partial Class Compras_Compras
|
||||
Dim DtDetalle As New DataTable
|
||||
Dim DtEquivalencias As DataTable
|
||||
Dim CveProducto As Integer
|
||||
Dim CantidadInv As Double
|
||||
Dim PUInv As Double
|
||||
Dim CantidadInv As Decimal
|
||||
Dim PUInv As Decimal
|
||||
Dim CveUnidad As Integer
|
||||
Dim CostoIndirecto As Double
|
||||
Dim CostoIndirecto As Decimal
|
||||
Dim tDescuento As Decimal = 0
|
||||
|
||||
ListaMovimientosAlmacen.Add(CveMovimientoInventario)
|
||||
@@ -5178,17 +5178,17 @@ Partial Class Compras_Compras
|
||||
|
||||
CveProducto = Dr("CvePS").ToString.ToEntero
|
||||
CveUnidad = Dr("CveUM").ToString.ToEntero
|
||||
CantidadInv = Dr("Cantidad").ToString.ToDouble
|
||||
PUInv = Dr("PU").ToString.ToDouble
|
||||
tDescuento = Dr("Descuento").ToString.ToDecimal / CantidadInv.ToDecimal
|
||||
CostoIndirecto = Dr("CostoIndirectoAlmacen").ToString.ToDouble
|
||||
CantidadInv = Dr("Cantidad").ToString.ToDecimal
|
||||
PUInv = Dr("PU").ToString.ToDecimal
|
||||
tDescuento = Dr("Descuento").ToString.ToDecimal / CantidadInv
|
||||
CostoIndirecto = Dr("CostoIndirectoAlmacen").ToString.ToDecimal
|
||||
|
||||
If Dr("CveMetodoInventario").ToString.ToEntero = 5 Then
|
||||
'SI FUE POR SERIE LOTE
|
||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("CvePS = {0}", Dr("CvePS")))
|
||||
If DtDetalle.Rows.Count > 0 Then
|
||||
For Each drr As DataRow In DtDetalle.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, -1, SerieLote:=drr("Serie").ToString, FechaCaducidad:=drr("FechaCaducidad").ToString.ToDate, CostoIndirecto:=Dr("CostoIndirectoAlmacen").ToString.ToDouble, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, SerieLote:=drr("Serie").ToString, FechaCaducidad:=drr("FechaCaducidad").ToString.ToDate, CostoIndirecto:=Dr("CostoIndirectoAlmacen").ToString.ToDecimal, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -5207,9 +5207,9 @@ Partial Class Compras_Compras
|
||||
'SI LA UNIDAD ACTUAL NO ES LA BASE SACA PROPORCION (EQUIVALENTE)
|
||||
If CveUnidadBase <> CveUnidad Then
|
||||
' LO QUE PUSE LO QUE VALE UNIDAD BASE LO QUE VALE UNIDAD SELECCIONADA
|
||||
CantidadInv = Dr("Cantidad").ToString.ToDouble * drUMBase("Cantidad").ToString.ToDouble / DtEquivalencias.FiltraParametros(String.Format("CveUM = {0}", CveUnidad)).Rows(0)("Cantidad").ToString.ToDouble
|
||||
PUInv = PUInv * Dr("Cantidad").ToString.ToDouble / CantidadInv
|
||||
CostoIndirecto = CostoIndirecto * Dr("Cantidad").ToString.ToDouble / CantidadInv
|
||||
CantidadInv = Dr("Cantidad").ToString.ToDecimal * drUMBase("Cantidad").ToString.ToDecimal / DtEquivalencias.FiltraParametros(String.Format("CveUM = {0}", CveUnidad)).Rows(0)("Cantidad").ToString.ToDecimal
|
||||
PUInv = PUInv * Dr("Cantidad").ToString.ToDecimal / CantidadInv
|
||||
CostoIndirecto = CostoIndirecto * Dr("Cantidad").ToString.ToDecimal / CantidadInv
|
||||
CveUnidad = CveUnidadBase
|
||||
End If
|
||||
End If
|
||||
@@ -5218,7 +5218,7 @@ Partial Class Compras_Compras
|
||||
ImporteConcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, PUInv, PUInv * TipoCambioGuardar) - If(DdlMoneda.SelectedValue.ToEntero = 1, tDescuento, tDescuento * TipoCambioGuardar)
|
||||
ImporteConcepto = If(UsuarioActual.Empresa.UsaAC, ImporteConcepto * IVA, ImporteConcepto)
|
||||
If Dr("CveAlmacen").ToString.ToEntero = tCveAlmacen Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, CantidadInv, CveUnidad, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, Dr("PU").ToString.ToDouble), CostoIndirecto:=CostoIndirecto, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, CantidadInv, CveUnidad, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, Dr("PU").ToString.ToDecimal), CostoIndirecto:=CostoIndirecto, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -13802,7 +13802,7 @@ Partial Class Compras_Compras
|
||||
Else
|
||||
For Each Dr As GridViewRow In GVDevolucion.Rows
|
||||
If Dr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr.FCTextBox("TxtCantidad").Text.ToDouble, Dr.DataKey("CveUM").ToString.ToEntero, Dr.DataKey("CvePS").ToString.ToEntero, Dr.DataKey("PU").ToString.ToDouble, -1, CveMovimientoDetalleEntrada:=Dr.DataKey("CveMovimientoDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr.FCTextBox("TxtCantidad").Text.ToDouble, Dr.DataKey("CveUM").ToString.ToEntero, Dr.DataKey("CvePS").ToString.ToEntero, Dr.DataKey("PU").ToString.ToDecimal, -1, CveMovimientoDetalleEntrada:=Dr.DataKey("CveMovimientoDetalle").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
@@ -691,7 +691,7 @@ Partial Class Inventarios_Apartados
|
||||
Else
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
@@ -906,7 +906,7 @@ Partial Class Inventarios_Apartados
|
||||
Else
|
||||
For Each Gvr As GridViewRow In GvDatosDesapartado.Rows
|
||||
If Gvr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDouble, -1, -1, Gvr.DataKey("SerieLote").ToString, CveMovimientoDetalleEntrada:=Gvr.DataKey("CveMovimientoDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("SerieLote").ToString, CveMovimientoDetalleEntrada:=Gvr.DataKey("CveMovimientoDetalle").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
@@ -938,7 +938,7 @@ Partial Class Inventarios_Apartados
|
||||
Else
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
|
||||
@@ -696,7 +696,7 @@ Partial Class Inventarios_Consignaciones
|
||||
'AGREGAMOS MOVTOS DETALLE
|
||||
If CveMovimiento > 0 Then
|
||||
For Each Dr As DataRow In DtMovimientos.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, PUTC:=If(DdlMoneda.SelectedValue.ToEntero <> 1, Dr("PUExtranjero").ToString.ToDouble, -1)) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, PUTC:=If(DdlMoneda.SelectedValue.ToEntero <> 1, Dr("PUExtranjero").ToString.ToDecimal, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos"
|
||||
Exit For
|
||||
@@ -844,7 +844,7 @@ Partial Class Inventarios_Consignaciones
|
||||
End If
|
||||
|
||||
'AGREGAMOS MOVTOS DETALLE
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDouble, -1, -1, "", "") Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, "", "") Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un Error al guardar los movimientos"
|
||||
Exit For
|
||||
@@ -1001,7 +1001,7 @@ Partial Class Inventarios_Consignaciones
|
||||
End If
|
||||
|
||||
'AGREGAMOS MOVTOS DETALLE
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDouble, -1, -1, "", "") Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, "", "") Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un Error al guardar los movimientos detalle de la salida"
|
||||
Exit For
|
||||
@@ -1061,7 +1061,7 @@ Partial Class Inventarios_Consignaciones
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
@@ -1300,7 +1300,7 @@ Partial Class Inventarios_Consignaciones
|
||||
'End Try
|
||||
CveMovimientoDetalleEntrada = gvr.DataKey("CveMovimientoDetalle").ToString.ToEntero
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("PU").ToString.ToDouble, gvr.DataKey("CveAF").ToString.ToEntero, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("PU").ToString.ToDecimal, gvr.DataKey("CveAF").ToString.ToEntero, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
@@ -1325,7 +1325,7 @@ Partial Class Inventarios_Consignaciones
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,328 +1,337 @@
|
||||
Option Strict On
|
||||
Imports System.Data
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Linq
|
||||
Imports System.Web
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports Extensiones
|
||||
Partial Class Inventarios_KardexSeccionAlmacen
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
|
||||
Private Property DtSeccionAlmacen As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtSeccionAlmacen"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtSeccionAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CantidadTotal As Decimal
|
||||
Get
|
||||
Return CType(ViewState("CantidadTotal"), Decimal)
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("CantidadTotal") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CvePS As Integer
|
||||
Get
|
||||
Return CType(ViewState("CvePS"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePS") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveSeccionAlmacenOrigen As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveSeccionAlmacenOrigen"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveSeccionAlmacenOrigen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property SeccionAlmacenOrigen As String
|
||||
Get
|
||||
Return CType(ViewState("SeccionAlmacenOrigen"), String)
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("SeccionAlmacenOrigen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveAlmacen As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveAlmacen"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveUM As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveUM"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveUM") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveSubProyecto As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveSubProyecto"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveSubProyecto") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property SerieLote As String
|
||||
Get
|
||||
Return CType(ViewState("SerieLote"), String)
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("SerieLote") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
InicializaValores()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "CARGAS"
|
||||
|
||||
Private Sub InicializaValores()
|
||||
CantidadTotal = 0
|
||||
SeccionAlmacenOrigen = ""
|
||||
CvePS = 0
|
||||
CveAlmacen = 0
|
||||
CveSeccionAlmacenOrigen = 0
|
||||
CveSubProyecto = 0
|
||||
CveUM = 0
|
||||
SerieLote = ""
|
||||
|
||||
CreaDtSeccionAlmacen()
|
||||
CargaDdlAlmacen()
|
||||
CargaPS()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPS()
|
||||
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlPS.ddlWS.Attributes.Add("data-cveclasificacion", "-1")
|
||||
DdlPS.SelectedText = "Seleccione"
|
||||
DdlPS.SelectedValue = "-1"
|
||||
Else
|
||||
DdlPS.ddl.Items.Clear()
|
||||
DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
DdlPS.ddl.DataBind()
|
||||
DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdlAlmacen()
|
||||
DdlAlmacen.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlAlmacen.DataBind()
|
||||
|
||||
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlSeccionAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSeccionAlmacen.DataBind()
|
||||
|
||||
DdlSeccionAlmacenDestino.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlSeccionAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlSeccionAlmacenDestino.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
If Not DdlPS.SelectedValue.ToEntero > 0 Then
|
||||
Alert("Tiene que seleccionar un producto/servicio.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
|
||||
Alert("Tiene que seleccionar un alamacen.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
If ObjInv.GetKardexSeccionAlmacen(DdlPS.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjInv.DtResultados
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "SECCION ALMACEN"
|
||||
Private Sub CreaDtSeccionAlmacen()
|
||||
DtSeccionAlmacen = New DataTable
|
||||
DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
|
||||
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacenOrigen", GetType(Integer))
|
||||
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacenDestino", GetType(Integer))
|
||||
DtSeccionAlmacen.Columns.Add("SeccionAlmacenOrigen", GetType(String))
|
||||
DtSeccionAlmacen.Columns.Add("SeccionAlmacenDestino", GetType(String))
|
||||
DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
DtSeccionAlmacen.Rows.Clear()
|
||||
CantidadTotal = gvRow.DataKey("Existencia").ToDecimal
|
||||
CveSeccionAlmacenOrigen = gvRow.DataKey("CveAlmacenSeccion").ToEntero
|
||||
SeccionAlmacenOrigen = gvRow.DataKey("AlmacenSeccion").ToString
|
||||
CvePS = gvRow.DataKey("CvePS").ToEntero
|
||||
SerieLote = gvRow.DataKey("SerieLote").ToString
|
||||
CveAlmacen = gvRow.DataKey("CveAlmacen").ToEntero
|
||||
CveUM = gvRow.DataKey("CveUM").ToEntero
|
||||
CveSubProyecto = gvRow.DataKey("CveSubProyecto").ToEntero
|
||||
RegistraScript("$('#DModalSeccionAlmacen').modal()")
|
||||
CargaSeccionAlmacen()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
Dim CantidadDisponible As Decimal = 0
|
||||
If ObjInv.GetMovimientosDetalleSeccionesAlmacen(CveSeccionAlmacenOrigen, CveAlmacen, CvePS, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||
CantidadDisponible = ObjInv.DtResultados.Rows(0)("CantidadRestante").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
|
||||
CantidadDisponible -= DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen")
|
||||
|
||||
If TxtCantidadSeccion.Text.ToDecimal > CantidadDisponible Then
|
||||
Alert($"No tiene cantidad de producto suficiente en esta seccion de almacen, su cantidad restante es: <b>{CantidadDisponible}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Row As DataRow = Nothing
|
||||
DtSeccionAlmacen.AcceptChanges()
|
||||
Row = DtSeccionAlmacen.NewRow
|
||||
Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
|
||||
Row("CveSeccionAlmacenOrigen") = CveSeccionAlmacenOrigen
|
||||
Row("SeccionAlmacenOrigen") = SeccionAlmacenOrigen
|
||||
Row("CveSeccionAlmacenDestino") = DdlSeccionAlmacenDestino.SelectedValue.ToEntero
|
||||
Row("SeccionAlmacenDestino") = DdlSeccionAlmacenDestino.SelectedItem.Text
|
||||
Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
|
||||
DtSeccionAlmacen.Rows.Add(Row)
|
||||
DtSeccionAlmacen.AcceptChanges()
|
||||
CargaSeccionAlmacen()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
Dim Index As Integer = 0
|
||||
For Each Dr As DataRow In DtSeccionAlmacen.Rows
|
||||
If Dr("Consec").ToString.ToEntero = gvRow.DataKey("Consec").ToEntero() Then
|
||||
Exit For
|
||||
End If
|
||||
Index += 1
|
||||
Next
|
||||
DtSeccionAlmacen.Rows.RemoveAt(Index)
|
||||
DtSeccionAlmacen.AcceptChanges()
|
||||
CargaSeccionAlmacen()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSeccionAlmacen()
|
||||
Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen")
|
||||
GvSeccion.DataSource = DtSeccionAlmacen
|
||||
GvSeccion.DataBind()
|
||||
|
||||
TxtCantidadSeccion.Text = ""
|
||||
DdlSeccionAlmacenDestino.SelectedIndex = 0
|
||||
Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
|
||||
If CantidadRestante = 0 Then
|
||||
RVTxtCantidad.MaximumValue = "1"
|
||||
TxtCantidadSeccion.Enabled = False
|
||||
Else
|
||||
RVTxtCantidad.MaximumValue = CantidadRestante.ToString
|
||||
TxtCantidadSeccion.Enabled = True
|
||||
End If
|
||||
|
||||
UpModalSeccionAlmacen.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnTraspasar_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjInv As New ClsInventarios
|
||||
ObjInv.IniciaTransacSQL()
|
||||
Dim TieneError As Boolean = False
|
||||
Dim MensajeError As String = ""
|
||||
|
||||
'SALIDA
|
||||
Dim CveMovimientoSalida As Integer = ObjInv.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, CveSubProyecto, -1, CveAlmacenDestino:=CveAlmacen)
|
||||
|
||||
If CveMovimientoSalida <= 0 Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al guardar el movimiento de salida. Por favor vuelva a intentar."
|
||||
End If
|
||||
|
||||
Dim Cantidad As Decimal = DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen")
|
||||
|
||||
If Not ObjInv.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUM, CvePS, 0, -1, SerieLote:=SerieLote) Then
|
||||
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar."
|
||||
TieneError = True
|
||||
Else
|
||||
If ObjInv.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
|
||||
For Each Dr2 As DataRow In DtSeccionAlmacen.Rows
|
||||
If Not ObjInv.AddMovimientosDetalleSeccionesAlmacen(ObjInv.CveMovimientoDetalle, Dr2("CveSeccionAlmacenOrigen").ToString.ToEntero, -Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
'ENTRADA
|
||||
If Not TieneError Then
|
||||
Dim CveMovimientoEntrada As Integer = ObjInv.AddMovimiento(CveAlmacen, 2, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, CveSubProyecto, -1, CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||
|
||||
If CveMovimientoEntrada <= 0 Then
|
||||
MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar."
|
||||
TieneError = True
|
||||
Else
|
||||
If ObjInv.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInv.DtResultados.Rows
|
||||
If Not ObjInv.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
Else
|
||||
If ObjInv.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
|
||||
For Each Dr2 As DataRow In DtSeccionAlmacen.Rows
|
||||
If Not ObjInv.AddMovimientosDetalleSeccionesAlmacen(ObjInv.CveMovimientoDetalle, Dr2("CveSeccionAlmacenDestino").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
ObjInv.Commit()
|
||||
Alert("El traspaso se ha hecho correctamente")
|
||||
CargaDatos()
|
||||
RegistraScript("$('#DModalSeccionAlmacen').modal('hide')")
|
||||
Else
|
||||
ObjInv.RollBack()
|
||||
Alert(MensajeError, TipoMensaje.MsgError)
|
||||
Option Strict On
|
||||
Imports System.Data
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Linq
|
||||
Imports System.Web
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports Extensiones
|
||||
Partial Class Inventarios_KardexSeccionAlmacen
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
|
||||
Private Property DtSeccionAlmacen As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtSeccionAlmacen"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtSeccionAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CantidadTotal As Decimal
|
||||
Get
|
||||
Return CType(ViewState("CantidadTotal"), Decimal)
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("CantidadTotal") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CvePS As Integer
|
||||
Get
|
||||
Return CType(ViewState("CvePS"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePS") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveSeccionAlmacenOrigen As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveSeccionAlmacenOrigen"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveSeccionAlmacenOrigen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property SeccionAlmacenOrigen As String
|
||||
Get
|
||||
Return CType(ViewState("SeccionAlmacenOrigen"), String)
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("SeccionAlmacenOrigen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveAlmacen As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveAlmacen"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveUM As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveUM"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveUM") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveSubProyecto As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveSubProyecto"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveSubProyecto") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property SerieLote As String
|
||||
Get
|
||||
Return CType(ViewState("SerieLote"), String)
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("SerieLote") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
InicializaValores()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "CARGAS"
|
||||
|
||||
Private Sub InicializaValores()
|
||||
CantidadTotal = 0
|
||||
SeccionAlmacenOrigen = ""
|
||||
CvePS = 0
|
||||
CveAlmacen = 0
|
||||
CveSeccionAlmacenOrigen = 0
|
||||
CveSubProyecto = 0
|
||||
CveUM = 0
|
||||
SerieLote = ""
|
||||
|
||||
CreaDtSeccionAlmacen()
|
||||
CargaDdlAlmacen()
|
||||
CargaPS()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPS()
|
||||
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlPS.ddlWS.Attributes.Add("data-cveclasificacion", "-1")
|
||||
DdlPS.SelectedText = "Seleccione"
|
||||
DdlPS.SelectedValue = "-1"
|
||||
Else
|
||||
DdlPS.ddl.Items.Clear()
|
||||
DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
DdlPS.ddl.DataBind()
|
||||
DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdlAlmacen()
|
||||
DdlAlmacen.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlAlmacen.DataBind()
|
||||
|
||||
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlSeccionAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSeccionAlmacen.DataBind()
|
||||
|
||||
DdlSeccionAlmacenDestino.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
|
||||
DdlSeccionAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlSeccionAlmacenDestino.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
If Not DdlPS.SelectedValue.ToEntero > 0 Then
|
||||
Alert("Tiene que seleccionar un producto/servicio.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
|
||||
Alert("Tiene que seleccionar un alamacen.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
If ObjInv.GetKardexSeccionAlmacen(DdlPS.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjInv.DtResultados
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "SECCION ALMACEN"
|
||||
Private Sub CreaDtSeccionAlmacen()
|
||||
DtSeccionAlmacen = New DataTable
|
||||
DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
|
||||
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacenOrigen", GetType(Integer))
|
||||
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacenDestino", GetType(Integer))
|
||||
DtSeccionAlmacen.Columns.Add("SeccionAlmacenOrigen", GetType(String))
|
||||
DtSeccionAlmacen.Columns.Add("SeccionAlmacenDestino", GetType(String))
|
||||
DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
DtSeccionAlmacen.Rows.Clear()
|
||||
CantidadTotal = gvRow.DataKey("Existencia").ToDecimal
|
||||
CveSeccionAlmacenOrigen = gvRow.DataKey("CveAlmacenSeccion").ToEntero
|
||||
SeccionAlmacenOrigen = gvRow.DataKey("AlmacenSeccion").ToString
|
||||
CvePS = gvRow.DataKey("CvePS").ToEntero
|
||||
SerieLote = gvRow.DataKey("SerieLote").ToString
|
||||
CveAlmacen = gvRow.DataKey("CveAlmacen").ToEntero
|
||||
CveUM = gvRow.DataKey("CveUM").ToEntero
|
||||
CveSubProyecto = gvRow.DataKey("CveSubProyecto").ToEntero
|
||||
RegistraScript("$('#DModalSeccionAlmacen').modal()")
|
||||
CargaSeccionAlmacen()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
Dim CantidadDisponible As Decimal = 0
|
||||
If ObjInv.GetMovimientosDetalleSeccionesAlmacen(CveSeccionAlmacenOrigen, CveAlmacen, CvePS, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||
CantidadDisponible = ObjInv.DtResultados.Rows(0)("CantidadRestante").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
|
||||
CantidadDisponible -= DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen")
|
||||
|
||||
If TxtCantidadSeccion.Text.ToDecimal > CantidadDisponible Then
|
||||
Alert($"No tiene cantidad de producto suficiente en esta seccion de almacen, su cantidad restante es: <b>{CantidadDisponible}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Row As DataRow = Nothing
|
||||
DtSeccionAlmacen.AcceptChanges()
|
||||
Row = DtSeccionAlmacen.NewRow
|
||||
Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
|
||||
Row("CveSeccionAlmacenOrigen") = CveSeccionAlmacenOrigen
|
||||
Row("SeccionAlmacenOrigen") = SeccionAlmacenOrigen
|
||||
Row("CveSeccionAlmacenDestino") = DdlSeccionAlmacenDestino.SelectedValue.ToEntero
|
||||
Row("SeccionAlmacenDestino") = DdlSeccionAlmacenDestino.SelectedItem.Text
|
||||
Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
|
||||
DtSeccionAlmacen.Rows.Add(Row)
|
||||
DtSeccionAlmacen.AcceptChanges()
|
||||
CargaSeccionAlmacen()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
Dim Index As Integer = 0
|
||||
For Each Dr As DataRow In DtSeccionAlmacen.Rows
|
||||
If Dr("Consec").ToString.ToEntero = gvRow.DataKey("Consec").ToEntero() Then
|
||||
Exit For
|
||||
End If
|
||||
Index += 1
|
||||
Next
|
||||
DtSeccionAlmacen.Rows.RemoveAt(Index)
|
||||
DtSeccionAlmacen.AcceptChanges()
|
||||
CargaSeccionAlmacen()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSeccionAlmacen()
|
||||
Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen")
|
||||
GvSeccion.DataSource = DtSeccionAlmacen
|
||||
GvSeccion.DataBind()
|
||||
|
||||
TxtCantidadSeccion.Text = ""
|
||||
DdlSeccionAlmacenDestino.SelectedIndex = 0
|
||||
Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
|
||||
If CantidadRestante = 0 Then
|
||||
RVTxtCantidad.MaximumValue = "1"
|
||||
TxtCantidadSeccion.Enabled = False
|
||||
Else
|
||||
RVTxtCantidad.MaximumValue = CantidadRestante.ToString
|
||||
TxtCantidadSeccion.Enabled = True
|
||||
End If
|
||||
|
||||
UpModalSeccionAlmacen.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnTraspasar_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjInv As New ClsInventarios
|
||||
ObjInv.IniciaTransacSQL()
|
||||
Dim TieneError As Boolean = False
|
||||
Dim MensajeError As String = ""
|
||||
|
||||
'SALIDA
|
||||
Dim CveMovimientoSalida As Integer = ObjInv.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, CveSubProyecto, -1, CveAlmacenDestino:=CveAlmacen)
|
||||
|
||||
If CveMovimientoSalida <= 0 Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al guardar el movimiento de salida. Por favor vuelva a intentar."
|
||||
End If
|
||||
|
||||
Dim Cantidad As Decimal = DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen")
|
||||
|
||||
If Not ObjInv.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUM, CvePS, 0, -1, SerieLote:=SerieLote) Then
|
||||
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar."
|
||||
TieneError = True
|
||||
Else
|
||||
If ObjInv.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
|
||||
For Each Dr2 As DataRow In DtSeccionAlmacen.Rows
|
||||
If Not ObjInv.AddMovimientosDetalleSeccionesAlmacen(ObjInv.CveMovimientoDetalle, Dr2("CveSeccionAlmacenOrigen").ToString.ToEntero, -Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
'ENTRADA
|
||||
If Not TieneError Then
|
||||
Dim CveMovimientoEntrada As Integer = ObjInv.AddMovimiento(CveAlmacen, 2, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, CveSubProyecto, -1, CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||
|
||||
If CveMovimientoEntrada <= 0 Then
|
||||
MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar."
|
||||
TieneError = True
|
||||
Else
|
||||
If ObjInv.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInv.DtResultados.Rows
|
||||
If Not ObjInv.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
Else
|
||||
If ObjInv.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
|
||||
For Each Dr2 As DataRow In DtSeccionAlmacen.Rows
|
||||
If Not ObjInv.AddMovimientosDetalleSeccionesAlmacen(ObjInv.CveMovimientoDetalle, Dr2("CveSeccionAlmacenDestino").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal) Then
|
||||
TieneError = True
|
||||
MensajeError = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
ObjInv.Commit()
|
||||
Alert("El traspaso se ha hecho correctamente")
|
||||
CargaDatos()
|
||||
RegistraScript("$('#DModalSeccionAlmacen').modal('hide')")
|
||||
Else
|
||||
ObjInv.RollBack()
|
||||
Alert(MensajeError, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -507,11 +507,11 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
TieneError = True
|
||||
Else
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
Dim PUTemp = 0.0
|
||||
Dim PUTemp As Decimal = 0
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
PUTemp += Dr("PU").ToString.ToDouble * Dr("Cantidad").ToString.ToDouble
|
||||
PUTemp += Dr("PU").ToString.ToDecimal * Dr("Cantidad").ToString.ToDecimal
|
||||
Next
|
||||
PUTemp = PUTemp / LbCantidadArmado.Text.ToDouble
|
||||
PUTemp = PUTemp / LbCantidadArmado.Text.ToDecimal
|
||||
Dim CvePSTemp = CvePaqueteArmado
|
||||
Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteArmado).FiltroPrimeroValor("CveUM").ToEntero
|
||||
|
||||
@@ -611,14 +611,14 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
|
||||
If Gvr.DataKey("Cantidad").ToString.ToDouble > 0 Then
|
||||
If Gvr.DataKey("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then
|
||||
For Each Dr As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec").ToEntero)).Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDouble, -1, SerieLote:=Dr("Serie").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, -1, SerieLote:=Dr("Serie").ToString) Then
|
||||
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de entrada. Por favor vuelva a intentar."
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Gvr.DataKey("Cantidad").ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDouble, -1) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Gvr.DataKey("Cantidad").ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, -1) Then
|
||||
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de entrada. Por favor vuelva a intentar."
|
||||
TieneError = True
|
||||
Exit For
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1844,7 +1844,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
@@ -1878,7 +1878,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Dim CvePS = RowGarantia("CvePS").ToString().ToEntero()
|
||||
Dim CveTamaño As Integer = RowGarantia("CveTamaño").ToString().ToEntero()
|
||||
Dim CveUM As Integer = RowGarantia("CveUnidadMedida").ToString().ToEntero()
|
||||
Dim PU As Double = RowGarantia("Importe").ToString().ToDouble() ' / RowGarantia("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Decimal = RowGarantia("Importe").ToString().ToDecimal() ' / RowGarantia("Cantidad").ToString().ToDouble()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoGarantia, RowGarantia("Cantidad").ToString().ToDouble(), CveUM, CvePS, PU, -1) Then
|
||||
ErrorMovInv = True
|
||||
@@ -1942,7 +1942,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
End If
|
||||
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
@@ -2033,7 +2033,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Else
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero()) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero()) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
@@ -2298,7 +2298,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
Dim PU As Decimal = RowUsado("PU").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
|
||||
|
||||
@@ -190,11 +190,11 @@ Partial Class Inventarios_RecepcionUsados
|
||||
ViewState("UMSerieLote") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CostoPromedioSerieLote As Double
|
||||
Private Property CostoPromedioSerieLote As Decimal
|
||||
Get
|
||||
Return CType(ViewState("CostoPromedioSerieLote"), Double)
|
||||
Return CType(ViewState("CostoPromedioSerieLote"), Decimal)
|
||||
End Get
|
||||
Set(value As Double)
|
||||
Set(value As Decimal)
|
||||
ViewState("CostoPromedioSerieLote") = value
|
||||
End Set
|
||||
End Property
|
||||
@@ -1070,7 +1070,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Dim ErrorMovInv As Boolean = False
|
||||
Dim ErrorAC As Boolean = False
|
||||
Dim IDPoliza As Integer = 0
|
||||
Dim ImporteConcepto = 0.0
|
||||
Dim ImporteConcepto As Decimal = 0
|
||||
|
||||
Try
|
||||
Dim CveSubProyecto = -1
|
||||
@@ -1128,9 +1128,9 @@ Partial Class Inventarios_RecepcionUsados
|
||||
For Each Dr As DataRow In DtMovimientos.Rows
|
||||
|
||||
If CveConcepto = 42 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then
|
||||
ImporteConcepto = Dr("PU").ToString.ToDouble * GlobalTipoCambio(TxtFecha.Text.ToDate)
|
||||
ImporteConcepto = Dr("PU").ToString.ToDecimal * GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
||||
Else
|
||||
ImporteConcepto = Dr("PU").ToString.ToDouble
|
||||
ImporteConcepto = Dr("PU").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
@@ -1236,11 +1236,11 @@ Partial Class Inventarios_RecepcionUsados
|
||||
TxtCodigoSerie.Focus()
|
||||
CvePSSerieLote = DrPS("CvePS").ToString.ToEntero
|
||||
CveUMSerieLote = DrPS("CveUnidadMedida").ToString.ToEntero
|
||||
CostoPromedioSerieLote = DrPS("CostoPromedio").ToString.ToDouble
|
||||
CostoPromedioSerieLote = DrPS("CostoPromedio").ToString.ToDecimal
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
GuardaCodigoSerie(TxtCantidadProducto.Text.ToDouble, DrPS("CvePS").ToString.ToEntero, DrPS("CveUnidadMedida").ToString.ToEntero, DrPS("CostoPromedio").ToString.ToDouble)
|
||||
GuardaCodigoSerie(TxtCantidadProducto.Text.ToDouble, DrPS("CvePS").ToString.ToEntero, DrPS("CveUnidadMedida").ToString.ToEntero, DrPS("CostoPromedio").ToString.ToDecimal)
|
||||
|
||||
TxtCodigoBarras.Text = ""
|
||||
TxtCodigoBarras.Focus()
|
||||
@@ -1258,14 +1258,14 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Dim DrP = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"Codigo= '{TxtCodigo.Text.Trim}'")
|
||||
|
||||
If DrP IsNot Nothing AndAlso DrP("CvePS").ToString.ToEntero > 0 Then
|
||||
GuardaCodigoSerie(TxtCantidadProducto.Text.ToDouble, DrP("CvePS").ToString.ToEntero, DrP("CveUnidadMedida").ToString.ToEntero, DrP("CostoPromedio").ToString.ToDouble)
|
||||
GuardaCodigoSerie(TxtCantidadProducto.Text.ToDouble, DrP("CvePS").ToString.ToEntero, DrP("CveUnidadMedida").ToString.ToEntero, DrP("CostoPromedio").ToString.ToDecimal)
|
||||
Else
|
||||
Alert("No se encontró el producto. Favor de verificar y volver a intentar.", TipoMensaje.MsgError, "window.setTimeout(Focus2,200);")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub GuardaCodigoSerie(Cantidad As Double, CvePS As Integer, CveUM As Integer, CostoPromedio As Double, Optional SerieLote As String = "-1")
|
||||
Private Sub GuardaCodigoSerie(Cantidad As Double, CvePS As Integer, CveUM As Integer, CostoPromedio As Decimal, Optional SerieLote As String = "-1")
|
||||
Dim ObjInv As New ClsInventarios
|
||||
|
||||
If CveMovimiento <= 0 Then
|
||||
@@ -2159,223 +2159,223 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function AddPSRNC(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 SerieLote As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
|
||||
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
|
||||
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
|
||||
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional EsCargo As Boolean = False, Optional PorcentajeIVA As Decimal = 0D, Optional CveTamaño As Integer = 0) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
If Not CvePS > 0 Then
|
||||
Alert("Ocurrió un error al cargar la información del producto a agregar. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
If (Obs.Length + PS.Length > 1000) Then
|
||||
Alert(String.Format("El Nombre y observación del producto tiene longitud de {0} caracteres y excede los 1000 caracteres permitidos.", Obs.Length + PS.Length), TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
Dim Row As DataRow = Nothing
|
||||
Dim TotalCalculableImpuestos As Decimal = 0
|
||||
PU = Math.Round(PU, 6) ' el precio unitario puede llevar hasta 6 decimales permitidos
|
||||
|
||||
Row = TmpDT.NewRow()
|
||||
Row("CveProyecto") = CveProyecto
|
||||
Row("Proyecto") = Proyecto
|
||||
Row("CveSubProyecto") = CveSubProyecto
|
||||
Row("SubProyecto") = SubProyecto
|
||||
Row("SerieLote") = SerieLote
|
||||
Row("TiempoEntrega") = TiempoEntrega
|
||||
Row("Orden") = TmpDT.Rows.Count + 1
|
||||
Row("Cantidad") = Cantidad
|
||||
Row("CveUM") = CveUM
|
||||
Row("UM") = UM
|
||||
Row("CveClasificacion") = CveClasificacion
|
||||
Row("Clasificacion") = Clasificacion
|
||||
Row("CvePS") = CvePS
|
||||
Row("Obs") = Obs
|
||||
|
||||
|
||||
|
||||
Dim DrPS As DataRow = Nothing
|
||||
|
||||
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1
|
||||
|
||||
If DrPS Is Nothing Then
|
||||
Alert("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
DrPS("IEPSPorcentaje") = 0
|
||||
|
||||
'verifica si tiene ventaminima
|
||||
If Cantidad > 0 AndAlso DrPS("VentaMinima").ToString.ToDecimal > 0 Then
|
||||
'verifico que la cantidad sea multiplo de venta minima, es decir ventaminima =5, solo puede vender 5,10,15...
|
||||
If Cantidad Mod DrPS("VentaMinima").ToString.ToDecimal <> 0 Then
|
||||
Alert(String.Format("El producto se vende solo en cantidades de {0}", DrPS("VentaMinima").ToString))
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
|
||||
TotalCalculableImpuestos = (Cantidad * (PU)) - Descuento
|
||||
|
||||
Row("PU") = PU
|
||||
Row("Codigo") = DrPS("Codigo")
|
||||
Row("NoIdentificacion") = DrPS("Codigo")
|
||||
Row("ClaveSATFraccionArancelaria") = DrPS("ClaveSATFraccionArancelaria")
|
||||
Row("ClaveSATUnidadAduana") = DrPS("ClaveSATUnidadAduana")
|
||||
Row("ClaveSATFraccionArancelariaDescripcion") = DrPS("ClaveSATFraccionArancelariaDescripcion")
|
||||
Row("ClaveSATUnidadAduanaDescripcion") = DrPS("ClaveSATUnidadAduanaDescripcion")
|
||||
Row("Consec") = TmpDT.Rows.Count + 1
|
||||
|
||||
Row("PS") = DrPS("PS")
|
||||
Row("CodigoPS") = DrPS("PSCodigo").ToString
|
||||
Row("CveTipoPS") = DrPS("CveTipoPS")
|
||||
Row("CveTipoInvPS") = DrPS("Inv_CveMetodoInventario")
|
||||
Row("CveTamaño") = DrPS("CveTamaño")
|
||||
|
||||
If CveClasificacion <= 0 Then Row("CveClasificacion") = DrPS("CveClasificacion")
|
||||
If Clasificacion = "" Then Row("Clasificacion") = DrPS("Clasificacion")
|
||||
|
||||
Row("PorcentajeIVA") = PorcentajeIVA
|
||||
|
||||
Row("IVA") = Row("PorcentajeIVA")
|
||||
Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, 2)
|
||||
|
||||
|
||||
Row("ImporteRetIVA") = 0
|
||||
Row("ImporteRetISR") = 0
|
||||
Row("PorcentajeRetIVA") = 0
|
||||
Row("PorcentajeRetISR") = 0
|
||||
Row("PorcentajeIEPS") = DrPS("IEPSPorcentaje")
|
||||
Row("ImporteIEPS") = Math.Round(DrPS("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos, 2)
|
||||
Row("IEPS") = Row("ImporteIEPS")
|
||||
Row("Descuento") = Math.Round(Descuento, 2)
|
||||
Row("TipoDescuento") = 0
|
||||
Row("Total") = (Cantidad * PU)
|
||||
Row("TotalImporte") = Math.Round(Cantidad * PU, 2)
|
||||
'Row("AsientoContableVentas") = DrPS("AsientoContableVentas")
|
||||
' Row("IdCtaContVentas") = IdCtaContable
|
||||
' Row("AplicaParaConcepto") = AplicaParaConcepto
|
||||
|
||||
Row("SATClaveProdServ") = DrPS("SATClavePS")
|
||||
Row("SATClaveUM") = DrPS("SATClaveUnidadMedida")
|
||||
|
||||
|
||||
Row("EntregaDirecta") = EntregaDirecta
|
||||
'Contratos
|
||||
Row("CveContratoDetalle") = CveContratoDetalle
|
||||
Row("CveVentaDetalle") = CveVentaDetalle
|
||||
Row("CveMovimientoDetallePedido") = CveVentaDetalle
|
||||
Row("CveOrdenCompraDetalle") = CveOrdenCompraDetalle
|
||||
Row("CveVentaDetalleRemision") = CveVentaDetalleRemision
|
||||
Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion
|
||||
Row("CveVentaDetallePedido2") = CveVentaDetallePedido2
|
||||
Row("CuentaPredial") = CuentaPredial
|
||||
Row("EsCargo") = EsCargo
|
||||
Private Function AddPSRNC(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 SerieLote As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
|
||||
Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
|
||||
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
|
||||
Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional EsCargo As Boolean = False, Optional PorcentajeIVA As Decimal = 0D, Optional CveTamaño As Integer = 0) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
If Not CvePS > 0 Then
|
||||
Alert("Ocurrió un error al cargar la información del producto a agregar. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
If (Obs.Length + PS.Length > 1000) Then
|
||||
Alert(String.Format("El Nombre y observación del producto tiene longitud de {0} caracteres y excede los 1000 caracteres permitidos.", Obs.Length + PS.Length), TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
Dim Row As DataRow = Nothing
|
||||
Dim TotalCalculableImpuestos As Decimal = 0
|
||||
PU = Math.Round(PU, 6) ' el precio unitario puede llevar hasta 6 decimales permitidos
|
||||
|
||||
Row = TmpDT.NewRow()
|
||||
Row("CveProyecto") = CveProyecto
|
||||
Row("Proyecto") = Proyecto
|
||||
Row("CveSubProyecto") = CveSubProyecto
|
||||
Row("SubProyecto") = SubProyecto
|
||||
Row("SerieLote") = SerieLote
|
||||
Row("TiempoEntrega") = TiempoEntrega
|
||||
Row("Orden") = TmpDT.Rows.Count + 1
|
||||
Row("Cantidad") = Cantidad
|
||||
Row("CveUM") = CveUM
|
||||
Row("UM") = UM
|
||||
Row("CveClasificacion") = CveClasificacion
|
||||
Row("Clasificacion") = Clasificacion
|
||||
Row("CvePS") = CvePS
|
||||
Row("Obs") = Obs
|
||||
|
||||
|
||||
|
||||
Dim DrPS As DataRow = Nothing
|
||||
|
||||
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1
|
||||
|
||||
If DrPS Is Nothing Then
|
||||
Alert("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
DrPS("IEPSPorcentaje") = 0
|
||||
|
||||
'verifica si tiene ventaminima
|
||||
If Cantidad > 0 AndAlso DrPS("VentaMinima").ToString.ToDecimal > 0 Then
|
||||
'verifico que la cantidad sea multiplo de venta minima, es decir ventaminima =5, solo puede vender 5,10,15...
|
||||
If Cantidad Mod DrPS("VentaMinima").ToString.ToDecimal <> 0 Then
|
||||
Alert(String.Format("El producto se vende solo en cantidades de {0}", DrPS("VentaMinima").ToString))
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
|
||||
TotalCalculableImpuestos = (Cantidad * (PU)) - Descuento
|
||||
|
||||
Row("PU") = PU
|
||||
Row("Codigo") = DrPS("Codigo")
|
||||
Row("NoIdentificacion") = DrPS("Codigo")
|
||||
Row("ClaveSATFraccionArancelaria") = DrPS("ClaveSATFraccionArancelaria")
|
||||
Row("ClaveSATUnidadAduana") = DrPS("ClaveSATUnidadAduana")
|
||||
Row("ClaveSATFraccionArancelariaDescripcion") = DrPS("ClaveSATFraccionArancelariaDescripcion")
|
||||
Row("ClaveSATUnidadAduanaDescripcion") = DrPS("ClaveSATUnidadAduanaDescripcion")
|
||||
Row("Consec") = TmpDT.Rows.Count + 1
|
||||
|
||||
Row("PS") = DrPS("PS")
|
||||
Row("CodigoPS") = DrPS("PSCodigo").ToString
|
||||
Row("CveTipoPS") = DrPS("CveTipoPS")
|
||||
Row("CveTipoInvPS") = DrPS("Inv_CveMetodoInventario")
|
||||
Row("CveTamaño") = DrPS("CveTamaño")
|
||||
|
||||
If CveClasificacion <= 0 Then Row("CveClasificacion") = DrPS("CveClasificacion")
|
||||
If Clasificacion = "" Then Row("Clasificacion") = DrPS("Clasificacion")
|
||||
|
||||
Row("PorcentajeIVA") = PorcentajeIVA
|
||||
|
||||
Row("IVA") = Row("PorcentajeIVA")
|
||||
Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, 2)
|
||||
|
||||
|
||||
Row("ImporteRetIVA") = 0
|
||||
Row("ImporteRetISR") = 0
|
||||
Row("PorcentajeRetIVA") = 0
|
||||
Row("PorcentajeRetISR") = 0
|
||||
Row("PorcentajeIEPS") = DrPS("IEPSPorcentaje")
|
||||
Row("ImporteIEPS") = Math.Round(DrPS("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos, 2)
|
||||
Row("IEPS") = Row("ImporteIEPS")
|
||||
Row("Descuento") = Math.Round(Descuento, 2)
|
||||
Row("TipoDescuento") = 0
|
||||
Row("Total") = (Cantidad * PU)
|
||||
Row("TotalImporte") = Math.Round(Cantidad * PU, 2)
|
||||
'Row("AsientoContableVentas") = DrPS("AsientoContableVentas")
|
||||
' Row("IdCtaContVentas") = IdCtaContable
|
||||
' Row("AplicaParaConcepto") = AplicaParaConcepto
|
||||
|
||||
Row("SATClaveProdServ") = DrPS("SATClavePS")
|
||||
Row("SATClaveUM") = DrPS("SATClaveUnidadMedida")
|
||||
|
||||
|
||||
Row("EntregaDirecta") = EntregaDirecta
|
||||
'Contratos
|
||||
Row("CveContratoDetalle") = CveContratoDetalle
|
||||
Row("CveVentaDetalle") = CveVentaDetalle
|
||||
Row("CveMovimientoDetallePedido") = CveVentaDetalle
|
||||
Row("CveOrdenCompraDetalle") = CveOrdenCompraDetalle
|
||||
Row("CveVentaDetalleRemision") = CveVentaDetalleRemision
|
||||
Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion
|
||||
Row("CveVentaDetallePedido2") = CveVentaDetallePedido2
|
||||
Row("CuentaPredial") = CuentaPredial
|
||||
Row("EsCargo") = EsCargo
|
||||
Row("CveTamaño") = CveTamaño
|
||||
|
||||
'RECARGAR GV
|
||||
TmpDT.Rows.Add(Row)
|
||||
TmpDT.AcceptChanges()
|
||||
Retorno = True
|
||||
Return Retorno
|
||||
|
||||
TmpDT.Rows.Add(Row)
|
||||
TmpDT.AcceptChanges()
|
||||
Retorno = True
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
Protected Function CreaDTDetalleRNC() As DataTable
|
||||
Dim TmpDT = New DataTable
|
||||
TmpDT.Columns.Add("CveVenta", GetType(Integer))
|
||||
TmpDT.Columns.Add("Consec", GetType(Integer))
|
||||
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Codigo", GetType(String))
|
||||
TmpDT.Columns.Add("CveUM", GetType(Integer))
|
||||
TmpDT.Columns.Add("UM", GetType(String))
|
||||
TmpDT.Columns.Add("SATClaveUM", GetType(String))
|
||||
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
|
||||
TmpDT.Columns.Add("Clasificacion", GetType(String))
|
||||
TmpDT.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDT.Columns.Add("PS", GetType(String))
|
||||
TmpDT.Columns.Add("CodigoPS", GetType(String))
|
||||
TmpDT.Columns.Add("SATClaveProdServ", GetType(String))
|
||||
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
|
||||
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("SerieLote", GetType(String))
|
||||
TmpDT.Columns.Add("CuentaPredial", GetType(String))
|
||||
TmpDT.Columns.Add("Obs", GetType(String))
|
||||
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
|
||||
TmpDT.Columns.Add("PU", GetType(Decimal))
|
||||
TmpDT.Columns.Add("IVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteRetIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteRetISR", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeRetIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeRetISR", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteIEPS", GetType(Decimal))
|
||||
TmpDT.Columns.Add("IEPS", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeIEPS", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Descuento", GetType(Decimal))
|
||||
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
|
||||
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Total", GetType(Decimal))
|
||||
'Para uso del módulo contable
|
||||
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
|
||||
TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer))
|
||||
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
|
||||
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("Proyecto", GetType(String))
|
||||
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("SubProyecto", GetType(String))
|
||||
TmpDT.Columns.Add("CveVentaDetallePadre", GetType(Integer))
|
||||
|
||||
'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto
|
||||
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveFuenteRecaudacion", GetType(Integer))
|
||||
'Contratos
|
||||
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
|
||||
'Remisiones a Facturas
|
||||
TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveVentaDetalleRemision", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer))
|
||||
|
||||
'Pedido2 a Facturas
|
||||
TmpDT.Columns.Add("CveVentaDetallePedido2", GetType(Integer))
|
||||
|
||||
TmpDT.Columns.Add("Origen", GetType(Integer))
|
||||
'Ordenes Servicio
|
||||
TmpDT.Columns.Add("CveOS", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveOSDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("SeFacturara", GetType(Integer))
|
||||
TmpDT.Columns.Add("Folio", GetType(Integer))
|
||||
TmpDT.Columns.Add("Estatus", GetType(String))
|
||||
'Ordenamiento
|
||||
TmpDT.Columns.Add("Orden", GetType(Integer))
|
||||
TmpDT.Columns.Add("TipoDocto", GetType(String))
|
||||
'OC
|
||||
TmpDT.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
||||
|
||||
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||
TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CantidadFacturadaCot", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CantidadFacturadaPed2", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CantidadInventario", GetType(Decimal))
|
||||
|
||||
TmpDT.Columns.Add("ClaveSATFraccionArancelaria", GetType(String))
|
||||
TmpDT.Columns.Add("ClaveSATUnidadAduana", GetType(String))
|
||||
TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String))
|
||||
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
|
||||
|
||||
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||
|
||||
Return TmpDT
|
||||
Protected Function CreaDTDetalleRNC() As DataTable
|
||||
Dim TmpDT = New DataTable
|
||||
TmpDT.Columns.Add("CveVenta", GetType(Integer))
|
||||
TmpDT.Columns.Add("Consec", GetType(Integer))
|
||||
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Codigo", GetType(String))
|
||||
TmpDT.Columns.Add("CveUM", GetType(Integer))
|
||||
TmpDT.Columns.Add("UM", GetType(String))
|
||||
TmpDT.Columns.Add("SATClaveUM", GetType(String))
|
||||
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
|
||||
TmpDT.Columns.Add("Clasificacion", GetType(String))
|
||||
TmpDT.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDT.Columns.Add("PS", GetType(String))
|
||||
TmpDT.Columns.Add("CodigoPS", GetType(String))
|
||||
TmpDT.Columns.Add("SATClaveProdServ", GetType(String))
|
||||
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
|
||||
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("SerieLote", GetType(String))
|
||||
TmpDT.Columns.Add("CuentaPredial", GetType(String))
|
||||
TmpDT.Columns.Add("Obs", GetType(String))
|
||||
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
|
||||
TmpDT.Columns.Add("PU", GetType(Decimal))
|
||||
TmpDT.Columns.Add("IVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteRetIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteRetISR", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeRetIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeRetISR", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteIEPS", GetType(Decimal))
|
||||
TmpDT.Columns.Add("IEPS", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeIEPS", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Descuento", GetType(Decimal))
|
||||
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
|
||||
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Total", GetType(Decimal))
|
||||
'Para uso del módulo contable
|
||||
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
|
||||
TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer))
|
||||
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
|
||||
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("Proyecto", GetType(String))
|
||||
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("SubProyecto", GetType(String))
|
||||
TmpDT.Columns.Add("CveVentaDetallePadre", GetType(Integer))
|
||||
|
||||
'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto
|
||||
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveFuenteRecaudacion", GetType(Integer))
|
||||
'Contratos
|
||||
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
|
||||
'Remisiones a Facturas
|
||||
TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveVentaDetalleRemision", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer))
|
||||
|
||||
'Pedido2 a Facturas
|
||||
TmpDT.Columns.Add("CveVentaDetallePedido2", GetType(Integer))
|
||||
|
||||
TmpDT.Columns.Add("Origen", GetType(Integer))
|
||||
'Ordenes Servicio
|
||||
TmpDT.Columns.Add("CveOS", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveOSDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("SeFacturara", GetType(Integer))
|
||||
TmpDT.Columns.Add("Folio", GetType(Integer))
|
||||
TmpDT.Columns.Add("Estatus", GetType(String))
|
||||
'Ordenamiento
|
||||
TmpDT.Columns.Add("Orden", GetType(Integer))
|
||||
TmpDT.Columns.Add("TipoDocto", GetType(String))
|
||||
'OC
|
||||
TmpDT.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
||||
|
||||
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||
TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CantidadFacturadaCot", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CantidadFacturadaPed2", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CantidadInventario", GetType(Decimal))
|
||||
|
||||
TmpDT.Columns.Add("ClaveSATFraccionArancelaria", GetType(String))
|
||||
TmpDT.Columns.Add("ClaveSATUnidadAduana", GetType(String))
|
||||
TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String))
|
||||
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
|
||||
|
||||
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||
|
||||
Return TmpDT
|
||||
End Function
|
||||
Protected Sub CargaDTDetalleRNC()
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ Partial Class Inventarios_Remanufactura
|
||||
If CveMovimiento > 0 Then
|
||||
If GlobalDTPS(UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero).Rows.Count > 0 Then
|
||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero).Rows(0)
|
||||
ObjInv.AddMovimientoDetalle(CveMovimiento, TxtCantidad.Text.ToDouble, DrPS("CveUnidadMedida").ToString().ToEntero(), DdlPS.SelectedValue.ToEntero, TxtPrecio.Text.ToDouble, -1)
|
||||
ObjInv.AddMovimientoDetalle(CveMovimiento, TxtCantidad.Text.ToDouble, DrPS("CveUnidadMedida").ToString().ToEntero(), DdlPS.SelectedValue.ToEntero, TxtPrecio.Text.ToDecimal, -1)
|
||||
If ObjInv.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||
FolioMov = ObjInv.DtResultados.Rows(0)("Folio").ToString
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1475,7 +1475,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
CveCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyecto:=CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
|
||||
@@ -2667,7 +2667,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
End If
|
||||
|
||||
'al gasto,Subtotal
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, SubtotalMovto, SubTotal, gr.DataKey("SerieFolio").ToString, CveConceptoDeduccion, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCuentaContableNoDeducible, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=SubTotal, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, SubtotalMovto, SubTotal, gr.DataKey("SerieFolio").ToString, CveConceptoDeduccion, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCuentaContableNoDeducible, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=SubTotal, CveSubProyecto:=CveSubProyecto, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
|
||||
@@ -13173,7 +13173,7 @@ Partial Class Ventas
|
||||
|
||||
Dim Cantidad As Double = MovDet("Cantidad").ToString.ToDouble
|
||||
Dim CveUnidad As Integer = MovDet("CveUM").ToString.ToEntero
|
||||
Dim PU As Double = MovDet("PU").ToString.ToDouble
|
||||
Dim PU As Decimal = MovDet("PU").ToString.ToDecimal
|
||||
Dim CveProducto As Integer = MovDet("CvePS").ToString.ToEntero
|
||||
Dim SerieLote As String = MovDet("SerieLote").ToString
|
||||
|
||||
@@ -16350,7 +16350,7 @@ Partial Class Ventas
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
Dim PU As Decimal = RowUsado("PU").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
|
||||
@@ -20321,7 +20321,7 @@ Partial Class Ventas
|
||||
If CveMovimientoEntradaGeneral > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
|
||||
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.ToDouble, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
Return False
|
||||
End If
|
||||
Next
|
||||
@@ -20335,7 +20335,7 @@ Partial Class Ventas
|
||||
If CveMovimientoEntradaGeneral > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
|
||||
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.ToDouble, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
Return False
|
||||
End If
|
||||
Next
|
||||
|
||||
Reference in New Issue
Block a user