Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -197,6 +197,22 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Set(value As Integer)
|
||||
ViewState("FolioAsignado") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveRemisionRecibida As Integer
|
||||
Get
|
||||
Return IfNull(ViewState("CveRemisionRecibida"), -1, CType(ViewState("CveRemisionRecibida"), Integer)).ToString().ToEntero()
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveRemisionRecibida") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property EsDistribuidor As Boolean
|
||||
Get
|
||||
Return CBool(IfNull(ViewState("EsDistribuidor"), False, CBool(ViewState("EsDistribuidor"))))
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("EsDistribuidor") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
@@ -270,6 +286,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
CreaDT()
|
||||
CargaCombos()
|
||||
TxtFecha.Text = Now.ToShortDateString
|
||||
TxtFechaPendientes.Text = Now.ToShortDateString
|
||||
RVFecha.MaximumValue = Now.ToShortDateString
|
||||
InicializaClientes()
|
||||
|
||||
@@ -298,6 +315,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End If
|
||||
End If
|
||||
|
||||
CargaSubProyectosUsados()
|
||||
InicializaBitacoraTemporal()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
|
||||
@@ -506,9 +524,31 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End Sub
|
||||
Private Sub CargaSubProyectos()
|
||||
DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1))
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.DataBind()
|
||||
|
||||
|
||||
'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSubProyectosUsados()
|
||||
If UsuarioActual.CveEmpresa = 140 Then
|
||||
DivRecepcionUsados.Visible = True
|
||||
|
||||
If Not UsuarioActual.TienePermisoProceso(190) Then
|
||||
'CARGA SOLO LAS SUCURSALES DE LOS ALMCENES QUE TIENE ASIGNADO EL USUARIO
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetSucursalesAlmacenUsuario(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
DdlSubProyectos.DataSource = ObjInventarios.DtResultados
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
Else
|
||||
DdlSubProyectos.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
End If
|
||||
DdlSubProyectos.DataBind()
|
||||
DdlSubProyectos.SelectedValueExist(UsuarioActual.CveSubProyecto.ToString)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargaPersonal()
|
||||
TrPersonal.Visible = True
|
||||
Dim dt As DataTable = Nothing
|
||||
@@ -940,16 +980,12 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
End Sub
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
|
||||
|
||||
|
||||
|
||||
If GvM.Rows.Count > 0 Then
|
||||
|
||||
'Dim CveMovimiento As Integer
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim ObjAcum As New ClsAcumuladores(ObjInventario.IniciaTransacSQL())
|
||||
|
||||
Dim ObjVentas As New ClsVentas(ObjInventario.IniciaTransacSQL())
|
||||
|
||||
Dim ErrorMovInv As Boolean = False
|
||||
Dim ErrorAC As Boolean = False
|
||||
@@ -978,9 +1014,12 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End If
|
||||
Dim tCveProveedor As Integer = -1
|
||||
If DdlProveedor.SelectedValue.ToEntero > 0 Then tCveProveedor = DdlProveedor.SelectedValue.ToEntero
|
||||
|
||||
Dim CveVenta As Integer = -1
|
||||
If CveRemisionRecibida > 0 Then
|
||||
CveVenta = CveRemisionRecibida
|
||||
End If
|
||||
'Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/ES", 53, 0, 0, 1, TxtFecha.Text.ToDate, $" {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
|
||||
CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, CveConcepto, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1,
|
||||
CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, CveConcepto, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta,
|
||||
CveSubProyecto, ActivoFijo, Guia:=TxtGuia.Text, Observaciones:=TxtObservaciones.Text, CvePersonal:=DdlPersonal.SelectedValue.ToEntero,
|
||||
Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text,
|
||||
PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor)
|
||||
@@ -1007,23 +1046,31 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If Not ObjVentas.UpdateVentaUsadoRecibido(CveRemisionRecibida, Dr("CvePS").ToString.ToEntero, True) Then
|
||||
Mensaje = "Error al actualizar el recibo de los usados"
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 2, 1, 2)
|
||||
|
||||
|
||||
If RBLOpcion.SelectedValue.ToEntero <> 3 Then
|
||||
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, -1, UsuarioActual.CveUsuario,
|
||||
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
|
||||
|
||||
|
||||
'CveCliente As Integer, Cantidad As Integer, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
|
||||
'CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String
|
||||
|
||||
Mensaje = "Error al guardar Movimientos de distribuidor"
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
If EsDistribuidor Then
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, -1, UsuarioActual.CveUsuario,
|
||||
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
|
||||
|
||||
|
||||
'CveCliente As Integer, Cantidad As Integer, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
|
||||
'CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String
|
||||
|
||||
Mensaje = "Error al guardar Movimientos de distribuidor"
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
@@ -1091,11 +1138,11 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Alert("No hay ningun registro para generar el movimiento. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgError)
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region " ADD INVENTARIO INICIAL "
|
||||
Protected Sub BtnCodigoBarras_Click(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -1931,6 +1978,64 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End If
|
||||
SiguienteFolio()
|
||||
UpGenerales.Update()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultarPendientes_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVentasUsados(-1, DdlSubProyectos.SelectedValue.ToEntero(), TxtFechaPendientes.Text.ToDateTime(), UsuarioActual.CveEmpresa) Then
|
||||
GVPendientes.DataSource = ObjVentas.DtResultados
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
GVPendientes.DataBind()
|
||||
|
||||
UpGenerales.Update()
|
||||
End Sub
|
||||
Protected Sub BtnRecibir_Click(sender As Object, e As EventArgs)
|
||||
DtMovimientos.Rows.Clear()
|
||||
|
||||
Me.CveRemisionRecibida = -1
|
||||
Me.CveRemisionRecibida = CType(CType(sender, LinkButton).NamingContainer, GridViewRow).DataKey("CveVenta").ToEntero()
|
||||
|
||||
|
||||
Dim DtUsados As DataTable = Nothing
|
||||
Dim CveCliente As Integer = -1
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveRemisionRecibida, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
EsDistribuidor = CBool(ObjVentas.DtResultados.Rows(0)("EsDistribuidor").ToString())
|
||||
CveCliente = ObjVentas.DtResultados.Rows(0)("CveCliente").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
If EsDistribuidor Then
|
||||
DivCliente.Visible = True
|
||||
Else
|
||||
DivCliente.Visible = False
|
||||
End If
|
||||
DdlClientes.SelectedValueExist(CveCliente)
|
||||
|
||||
If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
|
||||
DtUsados = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If DtUsados IsNot Nothing Then
|
||||
For Each RowUsado As DataRow In DtUsados.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
|
||||
Dim RowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0) '.FiltroPrimeroValor("CveTamaño", $"CvePS = { DdlProducto2.SelectedValue.ToEntero }").ToEntero
|
||||
Dim CveTamaño As Integer = RowPS("CveTamaño").ToString().ToEntero()
|
||||
|
||||
Dim PS As String = RowPS("PS").ToString()
|
||||
Dim CveUM As Integer = RowPS("CveUnidadMedida").ToString().ToEntero()
|
||||
Dim UM As String = RowPS("UnidadMedida").ToString()
|
||||
Dim Cantidad As Double = RowUsado("Cantidad").ToString().ToEntero()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
|
||||
AddNew(CvePS, PS, CveUM, UM, Cantidad, PU, "", "-1", "-1", "-1", "", "", "", DdlAlmacen.SelectedValue.ToEntero, DdlAlmacen.SelectedItem.Text, "", CveTamaño)
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
UpGenerales.Update()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user