cambios 17/02/2026
This commit is contained in:
@@ -120,6 +120,8 @@ Public Class ucAlbaran
|
||||
_idAlbaran = Nothing
|
||||
ra.Fecha = DateOnly.FromDateTime(Today)
|
||||
ra.NumeroBultos = 1
|
||||
ra.idEmpresa = EmpresaActual.idEmpresa
|
||||
ra.Tipo = _Tipo
|
||||
NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
|
||||
Else
|
||||
ra = bd.albaranes.First(Function(x) x.idAlbaran = _idAlbaran)
|
||||
@@ -182,8 +184,8 @@ Public Class ucAlbaran
|
||||
' Return "idAlbaranEntrega"
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Public Sub New(Optional idAlbaran As Integer? = Nothing)
|
||||
Private _Tipo As TipoAlbaranEnum
|
||||
Public Sub New(Tipo As albaranes.TipoAlbaranEnum, Optional idAlbaran As Integer? = Nothing)
|
||||
|
||||
' Llamada necesaria para el diseñador.
|
||||
InitializeComponent()
|
||||
@@ -584,7 +586,7 @@ Public Class ucAlbaran
|
||||
' bCancelar = Me.Guardar(Nothing, Nothing,, True, 5)
|
||||
' End If
|
||||
' If Not bCancelar Then
|
||||
' Dim dxnc = New dxwEnvioCorreo(ra.entidades.Email, ra.entidades.Email2, "", "Producciones Romian, S.L. - Adjunto le remitimos albarán de entrega nº " & ra.NumeroAlbaran, "Distinguidos Sres., " & vbCrLf & "Adjunto le remitimos albarán entrega nº " & ra.NumeroAlbaran, "AlbaranEntrega_" & ra.NumeroAlbaran.Replace("/", "-") & ".pdf")
|
||||
' Dim dxnc = New dxwEnvioCorreo(ra.entidades.Email, ra.entidades.Email2, "", "Producciones SanchoToro, S.L. - Adjunto le remitimos albarán de entrega nº " & ra.NumeroAlbaran, "Distinguidos Sres., " & vbCrLf & "Adjunto le remitimos albarán entrega nº " & ra.NumeroAlbaran, "AlbaranEntrega_" & ra.NumeroAlbaran.Replace("/", "-") & ".pdf")
|
||||
' If dxnc.ShowDialog Then
|
||||
' Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO")
|
||||
' Dim bAlbaran = GeneraPdfAlbaran(bd, ra)
|
||||
@@ -742,22 +744,26 @@ Public Class ucAlbaran
|
||||
Else
|
||||
ra.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario
|
||||
Dim bdtmp = tscGrupoSanchoToro.NuevoContexto
|
||||
|
||||
Select Case Estado
|
||||
Case tsUtilidades.EstadosAplicacion.Nuevo
|
||||
For Each d In ra.detallesalbaranesidAlbaranNavigation
|
||||
d.idAlbaranNavigation = ra
|
||||
d.ActualizaProducto(bdtmp, 1)
|
||||
d.ActualizaProducto(bdtmp, ra.Tipo, 1, ra.idEmpresa)
|
||||
Next
|
||||
Case tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||
Dim das = bdtmp.detallesalbaranes.Where(Function(x) x.idAlbaran = ra.idAlbaran).ToList
|
||||
For Each d In das
|
||||
d.ActualizaProducto(bdtmp, -1)
|
||||
If d.idAlbaranNavigation Is Nothing Then d.idAlbaranNavigation = ra
|
||||
d.ActualizaProducto(bdtmp, d.idAlbaranNavigation.Tipo, -1, d.idAlbaranNavigation.idEmpresa)
|
||||
If d.idAlbaranRecogida.HasValue Then d.ActualizaProducto(bdtmp, d.idAlbaranRecogidaNavigation.Tipo, -1, ra.idEmpresa)
|
||||
Next
|
||||
For Each d In ra.detallesalbaranesidAlbaranNavigation
|
||||
d.ActualizaProducto(bdtmp, 1)
|
||||
If d.idAlbaranNavigation Is Nothing Then d.idAlbaranNavigation = ra
|
||||
d.ActualizaProducto(bdtmp, d.idAlbaranNavigation.Tipo, 1, d.idAlbaranNavigation.idEmpresa)
|
||||
If d.idAlbaranRecogida.HasValue Then d.ActualizaProducto(bdtmp, d.idAlbaranRecogidaNavigation.Tipo, 1, d.idAlbaranRecogidaNavigation.idEmpresa)
|
||||
Next
|
||||
End Select
|
||||
bdtmp.GuardarCambios()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -765,8 +771,10 @@ Public Class ucAlbaran
|
||||
Dim bdtmp = tscGrupoSanchoToro.NuevoContexto
|
||||
Dim das = bdtmp.detallesalbaranes.Where(Function(x) x.idAlbaran = ra.idAlbaran).ToList
|
||||
For Each d In das
|
||||
d.ActualizaProducto(bdtmp, -1)
|
||||
d.ActualizaProducto(bdtmp, d.idAlbaranNavigation.Tipo, -1, d.idAlbaranNavigation.idEmpresa)
|
||||
If d.idAlbaranRecogida.HasValue Then d.ActualizaProducto(bdtmp, d.idAlbaranRecogidaNavigation.Tipo, -1, d.idAlbaranRecogidaNavigation.idEmpresa)
|
||||
Next
|
||||
bdtmp.SaveChanges()
|
||||
End Sub
|
||||
|
||||
Private Sub btIrAContrato_Click(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
Reference in New Issue
Block a user