registro de prepólizas
This commit is contained in:
@@ -644,8 +644,14 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto = 10276 Then
|
||||
ValidaLoteCaducidad = True
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
|
||||
If CveSubProyectoAlmacen = 10276 Then
|
||||
ValidaLoteCaducidad = True
|
||||
Else
|
||||
ValidaLoteCaducidad = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If Not DtDatos.Columns.Contains("Serie") Then DtDatos.Columns.Add("Serie", GetType(String))
|
||||
@@ -967,6 +973,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
e.Row.FCTextBox("TxtCaducidad").readonly = True
|
||||
CType(e.row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
' e.Row.FCTextBox("TxtCaducidad").enabled = True
|
||||
Else
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||
@@ -2253,6 +2260,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Next
|
||||
|
||||
If ErrorMovInv Then Exit For
|
||||
|
||||
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
@@ -2300,6 +2309,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
End If
|
||||
'' TERMINA: APARTADOS
|
||||
Dim TotalGarantia As Decimal = 0
|
||||
|
||||
' COMIENZA: GARANTIAS
|
||||
If Not ErrorMovInv AndAlso TipoDocto.Contiene("Ing", "Rem") AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoMovimiento = 1 Then
|
||||
@@ -2326,6 +2336,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
End If
|
||||
TotalGarantia += (RowGarantia("Cantidad").ToString().ToDecimal() * PU)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
@@ -2576,6 +2587,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim CveAlmacenApartado = -1
|
||||
Dim CveAlmacenOrigen = If(CveAlmacenTraspasoDestino > 0, CveAlmacenTraspasoDestino, DdlAlmacen.SelectedValue.ToEntero())
|
||||
Dim CveSeccionAlmacen As Integer = 0
|
||||
Dim ValorTraspaso As Decimal = 0
|
||||
For Each Dr As DataRow In DtTempApartados.Rows
|
||||
|
||||
If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString().ToEntero() Then
|
||||
@@ -2613,46 +2625,58 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
For Each Dr1 As DataRow In DtTraspasos.Rows
|
||||
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero()
|
||||
|
||||
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString().ToEntero(), 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
If Not ErrorMovInv Then
|
||||
|
||||
Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Apart", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Traspaso Apartado", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CvePrePolizaTraspaso > 0 Then
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalidaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
For Each Dr1 As DataRow In DtTraspasos.Rows
|
||||
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero()
|
||||
|
||||
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString().ToEntero(), 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
-1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(),
|
||||
CveMovimientoRelacionado:=CveMovimientoSalida, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor,
|
||||
CveCliente:=CveCliente, Modulo:="RE/G10")
|
||||
FolioEntrada = ObjInventario.Folio
|
||||
|
||||
If Not CveMovimientoEntradaApartado > 0 Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado
|
||||
Dr1("FolioEntrada") = FolioEntrada
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
'If CBool(Dr("AplicaSeccion")) Then
|
||||
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr1("CveAlmacen").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero()
|
||||
' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr1("CveAlmacen").ToString().ToEntero(), Dr("CvePS"), CveSeccionAlmacen)
|
||||
'Else
|
||||
' CveSeccionAlmacen = -1
|
||||
'End If
|
||||
CveSeccionAlmacen = -3
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If ErrorMovInv Then Exit For
|
||||
|
||||
Next
|
||||
CveCliente:=CveCliente, Modulo:="RE/G10")
|
||||
FolioEntrada = ObjInventario.Folio
|
||||
|
||||
If Not CveMovimientoEntradaApartado > 0 Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado
|
||||
Dr1("FolioEntrada") = FolioEntrada
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
ValorTraspaso = ObjInventario.DtResultados.SUMD("Total").RoundSQL
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
|
||||
CveSeccionAlmacen = -3
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
|
||||
ErrorMovInv = True
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If ErrorMovInv Then Exit For
|
||||
|
||||
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntradaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -2701,6 +2725,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
Dim TotalVirtual As Decimal = 0
|
||||
|
||||
' COMIENZA: VIRTUAL
|
||||
If Not ErrorMovInv AndAlso TipoDocto.Contiene("Ing", "Dev") AndAlso UsuarioActual.Empresa.Funcionalidad(573) = "1" AndAlso CveMovimiento > 0 Then
|
||||
@@ -2758,7 +2783,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
@@ -2767,7 +2792,14 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
TotalVirtual += (CantidadUsado * PU)
|
||||
Next
|
||||
'insertar en prepóliza de la salida virtual
|
||||
If Not ErrorMovInv Then
|
||||
ErrorMovInv = Not GenerarPrePoliza(ObjInventario, ObjVentas, ObjConta, CveMovimientoVirtual, TextoError)
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
@@ -2920,7 +2952,6 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero()
|
||||
'Dim CveCuentaAlmacen As Integer = 0 'GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero()
|
||||
Dim IdCtaContable As Integer = 0
|
||||
Dim CveCuenta As Integer = 0
|
||||
If tmpCostos.Rows.Count > 0 Then
|
||||
|
||||
|
||||
@@ -2929,7 +2960,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString().ToEntero()
|
||||
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString()
|
||||
Dim Serie As String = ObjVentas.DtResultados(0)("SerieFolio").ToString()
|
||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
|
||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL()
|
||||
Dim TotalCostoAcumulado As Decimal = 0
|
||||
Dim cont As Integer = 1
|
||||
|
||||
@@ -2949,7 +2980,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If CvePrePoliza > 0 Then
|
||||
|
||||
For Each RowInv As DataRow In tmpCostos.Rows
|
||||
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundAD()
|
||||
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL()
|
||||
TotalCostoAcumulado += ValorInventario
|
||||
|
||||
'cuando es el último movimiento y hay diferencias en los importes
|
||||
@@ -2959,10 +2990,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString())
|
||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorMultiplicador * ValorInventario, Serie, 69, Serie, Fecha, IdCtaContable, -1, CveVenta:=CveVentaSurtir, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=CveSubProyecto, ImporteMX:=ValorMultiplicador * ValorInventario, CveCuenta:=CveCuenta, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero()) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorMultiplicador * ValorInventario, Serie, 69, Serie, Fecha, IdCtaContable, -1, CveVenta:=CveVentaSurtir, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=CveSubProyecto, ImporteMX:=ValorMultiplicador * ValorInventario, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero()) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user