This commit is contained in:
2019-12-02 12:21:49 -07:00
21 changed files with 349 additions and 329 deletions

View File

@@ -179,7 +179,7 @@ Partial Class Inventarios_PrestamosdeProveedor
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, tValorInventario, TxtObservacionesEntrega.Text.Trim, 68, TxtObservacionesEntrega.Text.Trim, Fecha, idCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=tValorInventario) Then
ErrorMovInv = True
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, -tValorInventario, TxtObservacionesEntrega.Text.Trim, CveConceptoContable, TxtObservacionesEntrega.Text.Trim, Fecha, IdCtaContableOtro, -1, CveMovimientoAlmacen:=CveMovimientoSalida, CveClasificacion:=CveClasifCosto, ImporteMX:=tValorInventario) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, -tValorInventario, TxtObservacionesEntrega.Text.Trim, CveConceptoContable, TxtObservacionesEntrega.Text.Trim, Fecha, IdCtaContableOtro, -1, CveMovimientoAlmacen:=CveMovimientoSalida, CveClasificacion:=CveClasifCosto, ImporteMX:=-tValorInventario) Then
ErrorMovInv = True
End If
End If

View File

@@ -321,7 +321,7 @@
<Columns>
<asp:TemplateField HeaderText="Serie-Folio" ItemStyle-Width="20%">
<ItemTemplate>
<asp:Label runat="server" ID="LblFolio" Text='<%# Eval("SerieFolio")%>' />
<asp:HyperLink runat="server" ID="HplFolio" Text='<%# Eval("SerieFolio")%>' NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="NombreComercial" HeaderText="Cliente"/>

View File

@@ -1052,68 +1052,80 @@ Partial Class Inventarios_RecepcionUsados
Else
Dim Mensaje As String = ""
If Not ErrorMovInv AndAlso GenerarRNC AndAlso ObjRemisionNC IsNot Nothing Then
CargaDTDetalleRNC()
Dim Resp = ObjRemisionNC.EmitirFactura(False)
For Each mensaje2 As String In Resp.Mensajes
Msg.AppendFormat("<br>{0}", mensaje2)
Next
Alert(Msg.ToString, If(Resp.CveVenta > 0, TipoMensaje.MsgInformacion, TipoMensaje.MsgAdvertencia))
CveVenta = Resp.CveVenta
End If
For Each Dr As DataRow In DtMovimientos.Rows
If CveConcepto = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then
ImporteConcepto = Dr("PU").ToString.ToDouble * GlobalTipoCambio(TxtFecha.Text.ToDate)
Else
ImporteConcepto = Dr("PU").ToString.ToDouble
End If
If CveConcepto = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then
ImporteConcepto = Dr("PU").ToString.ToDouble * GlobalTipoCambio(TxtFecha.Text.ToDate)
Else
ImporteConcepto = Dr("PU").ToString.ToDouble
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
Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
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
Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
End If
If Not ObjVentas.UpdateVentaUsadoRecibido(CveVenta, Dr("CvePS").ToString.ToEntero, True) Then
If CveVenta > 0 AndAlso Not ObjVentas.UpdateVentaUsadoRecibido(CveVenta, Dr("CvePS").ToString.ToEntero, True) Then
Mensaje = "Error al actualizar el recibo de los usados"
ErrorMovInv = True
Exit For
End If
'si es selectedvalue = 2, es entrada ,3 -salida
Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 2, 1, 2)
If RBLOpcion.SelectedValue.ToEntero <> 3 AndAlso Not GenerarRNC Then
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, CveVenta, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
Mensaje = "Error al guardar Movimientos de distribuidor"
ErrorMovInv = True
Exit For
End If
If RBLOpcion.SelectedValue.ToEntero = 2 AndAlso EsDistribuidor Then
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
Mensaje = "Error al guardar Movimientos de distribuidor"
ErrorMovInv = True
Exit For
End If
End If
Next
Next
If Not ErrorMovInv Then
If Not ErrorMovInv Then
Msg.AppendFormat("<br/>El Movimiento se registro con el Folio: <b>{0}</b>", ObjInventario.Folio)
Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
Msg.AppendFormat("<br/>El Movimiento se registro con el Folio: <b>{0}</b>", ObjInventario.Folio)
Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
If IDPoliza > 0 Then Msg = Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza)
If IDPoliza > 0 Then Msg = Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza)
ObjInventario.Commit() ' aplica los movimientos insertados
ObjInventario.Commit() ' aplica los movimientos insertados
'Limpia Valores cuando inserta de campos especiales
If UsuarioActual.CveEmpresa = 66 Then
DdlSubProyecto.SelectedValueExist("-1")
'Limpia Valores cuando inserta de campos especiales
If UsuarioActual.CveEmpresa = 66 Then
DdlSubProyecto.SelectedValueExist("-1")
End If
EnvioCorreo()
CargaPendientesRecibir()
UPDatos.Update()
Else
ObjInventario.RollBack() 'deshace lo insertado
CveMovimiento = 0
Alert("ocurrió un Error al registrar los movimientos", TipoMensaje.MsgError)
End If
EnvioCorreo()
CargaPendientesRecibir()
UPDatos.Update()
Else
ObjInventario.RollBack() 'deshace lo insertado
CveMovimiento = 0
Alert("ocurrió un Error al registrar los movimientos", TipoMensaje.MsgError)
End If
End If
End If
Catch ex As Exception
ObjInventario.RollBack() 'deshace lo insertado
CveMovimiento = 0
@@ -1125,17 +1137,7 @@ Partial Class Inventarios_RecepcionUsados
ObjAcum.Dispose()
ObjVentas.Dispose()
If Not ErrorMovInv AndAlso GenerarRNC AndAlso ObjRemisionNC IsNot Nothing Then
CargaDTDetalleRNC()
Dim Resp = ObjRemisionNC.EmitirFactura(False)
For Each mensaje As String In Resp.Mensajes
Msg.AppendFormat("<br>{0}", mensaje)
Next
Alert(Msg.ToString, If(Resp.CveVenta > 0, TipoMensaje.MsgInformacion, TipoMensaje.MsgAdvertencia))
ElseIf Not ErrorMovInv Then
If Not ErrorMovInv Then
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
End If
@@ -1639,51 +1641,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub
#End Region
#Region " CONSUMO INTERNO "
'Private Sub ActivaConsumoInterno()
' EsConsumoInterno = True
' DdlAlmacen.AutoPostBack = False
' DivFolio1.Visible = False
' DivFolio2.Visible = False
' divMonedaSeccion.Visible = False
' divGuia.Visible = False
' TrResponsable.Visible = False
' CargaPersonal()
' 'RECARGA ALMACENES SOLO DE CONSUMO INTERNO
' DdlAlmacen.Items.Clear()
' DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 22) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
' DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
' DdlAlmacen.SelectedValue = "-1"
' DdlAlmacen.DataBind()
' If IsNothing(Request("CveMovimiento")) Then
' DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
' End If
'End Sub
#End Region
#Region "PAQUETERIA GUIA"
'Protected Sub LnkAgregarGuia_Click(sender As Object, e As EventArgs)
' RegistraScript(String.Format("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveMovimiento={0}',800,620);", CveMovimiento))
'End Sub
#End Region
#Region "DDL CLIENTE / CLIENTE SUCURSAL - SELECTED INDEX CHANGED"
@@ -1845,22 +1802,6 @@ Partial Class Inventarios_RecepcionUsados
#End Region
Private Sub GuardarBitacora(CveVenta As Integer, RutaAdjunto As String, Obser As String)
Dim ObjEventos As New ClsOIEventos()
Try
If ObjEventos.AddEventoBitacora(Obser, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
End If
Catch ex As Exception
OnError("Se presento un error al guardar la Bitacora", ex)
End Try
ObjEventos.Dispose()
End Sub
Protected Sub LnkAgregarUsado_Click(sender As Object, e As EventArgs)
AgregarUsado = True