From 572b81e1f71add4fde58d21ce2428134fdf7c4a1 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Fri, 12 Jan 2024 10:55:31 -0700 Subject: [PATCH 1/7] modificar salario imss --- RH/Personal.aspx | 9 +++------ RH/Personal.aspx.vb | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/RH/Personal.aspx b/RH/Personal.aspx index 7b6ff7988..3c9d224d2 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -5732,7 +5732,7 @@
- + Fecha: @@ -5751,19 +5751,16 @@
- + Salario diario(IMSS):
diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 82e464beb..a339f499b 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -1142,11 +1142,11 @@ Partial Class RH_Personal tdCliente2.Visible = True GVAsistencia.Columns(1).Visible = True End If - - If UsuarioActual.TienePermisoProceso(372) Then - TxtSalarioDiarioImSS.Enabled = True - TxtSalarioDiarioIntegrado.Enabled = True - End If + 'no sedeben habilitar ya que solo son informativos + 'If UsuarioActual.TienePermisoProceso(372) Then + ' TxtSalarioDiarioImSS.Enabled = True + ' TxtSalarioDiarioIntegrado.Enabled = True + 'End If End Sub Private Sub SetPermisos() @@ -6961,7 +6961,7 @@ Partial Class RH_Personal Dim DiasVacaciones As Decimal = TxtFIDiasVacaciones.Text.ToDecimal() Dim diasaguinaldo As Decimal = TxtFIAguinaldo.Text.ToDecimal() Dim FI As Decimal = (365D + diasaguinaldo + (DiasVacaciones * (primav / 100D))) / 365D - Dim SDI As Decimal = (SD * FI) + Dim SDI As Decimal = Math.Round((SD * FI), 2) TxtFactordeIntegracion.Text = FI.ToString() TxtFISalarioDiarioIntegrado.Text = String.Format("{0:###0.########}", SDI) UpFactordeintegracion.Update() @@ -7044,15 +7044,17 @@ Partial Class RH_Personal Using ObjPersonal As ClsRH = New ClsRH() ObjPersonal.IniciaTransacSQL() - If ObjPersonal.UpdateSalarios(CvePersonal, TxtFechamodIMSS.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, + If ObjPersonal.UpdateSalarios(CvePersonal, TxtFechamodIMSSSalario.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtSalarioDiario.Text.ToDecimal(), TxtSDI.Text.ToDecimal(), TxtMImssSalarioDiarioImSS.Text.ToDecimal(), - TxtSalarioDiario.Text.ToDecimal()) Then + -1) Then ObjPersonal.Commit() TxtSalarioCotizado.Text = TxtMImssSalarioDiarioImSS.Text - + Dim sdi As Decimal = TxtSDI.Text.ToDecimal() + Dim sbc As Decimal = TxtMImssSalarioDiarioImSS.Text.ToDecimal() + salarioVariable = If(sbc > sdi, sbc - sdi, 0) UpModSalario.Update() UpDatos.Update() Alert("Se ha actualizado el salario", TipoMensaje.ToastInformacion) @@ -7063,7 +7065,7 @@ Partial Class RH_Personal End Sub Protected Sub LnkModsalarioIMSS_Click(sender As Object, e As EventArgs) - + TxtFechamodIMSSSalario.Text = NowADS().ToString("dd/MM/yyyy") TxtMImssSalarioDiarioImSS.Text = TxtSalarioCotizado.Text RegistraScript("$('#DmodamodificarsalarioIMSS').modal()") UpModSalarioIMSS.Update() From f4ca50d8c084d0b05d8656ff116682a9df068141 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Fri, 12 Jan 2024 13:23:52 -0700 Subject: [PATCH 2/7] edicion SDIManual --- RH/Personal.aspx | 4 ++++ RH/Personal.aspx.vb | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RH/Personal.aspx b/RH/Personal.aspx index 3c9d224d2..bdfafa4e1 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -5754,6 +5754,10 @@ Salario diario(IMSS):
+
+ + Salario Diario Integrado(SDI): +
diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index a339f499b..20952eeca 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -7045,13 +7045,14 @@ Partial Class RH_Personal Using ObjPersonal As ClsRH = New ClsRH() ObjPersonal.IniciaTransacSQL() If ObjPersonal.UpdateSalarios(CvePersonal, TxtFechamodIMSSSalario.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, - TxtSalarioDiario.Text.ToDecimal(), TxtSDI.Text.ToDecimal(), TxtMImssSalarioDiarioImSS.Text.ToDecimal(), + TxtSalarioDiario.Text.ToDecimal(), TxtMImssSDI.Text.ToDecimal(), TxtMImssSalarioDiarioImSS.Text.ToDecimal(), -1) Then ObjPersonal.Commit() TxtSalarioCotizado.Text = TxtMImssSalarioDiarioImSS.Text + TxtSDI.Text = TxtMImssSDI.Text Dim sdi As Decimal = TxtSDI.Text.ToDecimal() Dim sbc As Decimal = TxtMImssSalarioDiarioImSS.Text.ToDecimal() salarioVariable = If(sbc > sdi, sbc - sdi, 0) @@ -7067,6 +7068,7 @@ Partial Class RH_Personal Protected Sub LnkModsalarioIMSS_Click(sender As Object, e As EventArgs) TxtFechamodIMSSSalario.Text = NowADS().ToString("dd/MM/yyyy") TxtMImssSalarioDiarioImSS.Text = TxtSalarioCotizado.Text + TxtMImssSDI.Text = TxtSDI.Text RegistraScript("$('#DmodamodificarsalarioIMSS').modal()") UpModSalarioIMSS.Update() End Sub From a9f230b9c678af80b375442d76363843a743e19f Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Fri, 12 Jan 2024 13:25:02 -0700 Subject: [PATCH 3/7] --- RH/Personal.aspx.vb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 20952eeca..0247d02d2 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -7045,8 +7045,7 @@ Partial Class RH_Personal Using ObjPersonal As ClsRH = New ClsRH() ObjPersonal.IniciaTransacSQL() If ObjPersonal.UpdateSalarios(CvePersonal, TxtFechamodIMSSSalario.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, - TxtSalarioDiario.Text.ToDecimal(), TxtMImssSDI.Text.ToDecimal(), TxtMImssSalarioDiarioImSS.Text.ToDecimal(), - -1) Then + TxtSalarioDiario.Text.ToDecimal(), TxtMImssSDI.Text.ToDecimal(), TxtMImssSalarioDiarioImSS.Text.ToDecimal(), -1) Then ObjPersonal.Commit() From 6e8294cc01122b5eb4114cdc33ef2b569215645a Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Fri, 12 Jan 2024 13:27:40 -0700 Subject: [PATCH 4/7] --- RH/Personal.aspx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RH/Personal.aspx b/RH/Personal.aspx index bdfafa4e1..9053f04f4 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -5755,8 +5755,8 @@ Salario diario(IMSS):
- - Salario Diario Integrado(SDI): + + Salario Diario Integrado(SDI):
From 8dce44280f004db7472bdc116f549002dccf0465 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Fri, 12 Jan 2024 13:28:59 -0700 Subject: [PATCH 5/7] b --- RH/Personal.aspx.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 0247d02d2..4c1d92725 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -7050,6 +7050,7 @@ Partial Class RH_Personal ObjPersonal.Commit() + RegistraScript("$('#DmodamodificarsalarioIMSS').modal('hide')") TxtSalarioCotizado.Text = TxtMImssSalarioDiarioImSS.Text TxtSDI.Text = TxtMImssSDI.Text Dim sdi As Decimal = TxtSDI.Text.ToDecimal() From 7314a278da976a87d0973cdd4c5e8f25f07ec53c Mon Sep 17 00:00:00 2001 From: rakcsle Date: Fri, 12 Jan 2024 15:58:46 -0700 Subject: [PATCH 6/7] =?UTF-8?q?SMS=20-=20Ajustes=202024.01.10=20guardar=20?= =?UTF-8?q?material=20os=20tipo=20venta=20=20Consignaci=C3=B3n=20-=20=20Us?= =?UTF-8?q?o=20material?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsOS.vb | 26 +++ OS/OrdenesServicios.aspx.vb | 315 ++++++++++++++++++++++-------------- 2 files changed, 224 insertions(+), 117 deletions(-) diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index 4aaabb0e2..950871f6f 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -1871,6 +1871,32 @@ Public Class ClsOS #End Region + Public Function AddOrdenesServicioMateriales(CveOS As Integer, CvePS As Integer, Cantidad As Decimal, Serie As String, Lote As String, FechaCaducidad As Date, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_OS_OrdenesServicioMaterialesAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOS", SqlDbType.Int).Value = CveOS + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad + .Add("@Serie", SqlDbType.VarChar).Value = Serie + .Add("@Lote", SqlDbType.VarChar).Value = Lote + .Add("@FechaCaducidad", SqlDbType.Date).Value = FechaCaducidad + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch ex As Exception + OnError("Ocurrió un error al guardar el material.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + 'Public Function GetCveCliente(CveVenta As Integer) As Boolean ' Dim Retorno As Boolean = False ' DataAdapter("PA_OS_ClienteGet") diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 36b7a9574..b7536f248 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -8,6 +8,8 @@ Imports Telerik.Web.UI Imports System.Data.SqlClient Imports Stimulsoft.Report.StiOptions.Export Imports Modelos +Imports System.Runtime.InteropServices.ComTypes +Imports APP_Code_CSharp Partial Class OS_OrdenesServicios Inherits ClsPaginas @@ -670,7 +672,7 @@ Partial Class OS_OrdenesServicios ' End If 'End If - ElseIf TipoEstatus = 4 Then + ElseIf TipoEstatus = 4 AndAlso Not UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then 'DisableAll() If SeFacturara = "True" Then HplFacturar.Visible = True @@ -2955,6 +2957,20 @@ Partial Class OS_OrdenesServicios LnkModalMaterialUtilizado.Visible = True DTSolicitudDev = New DataTable Dim Opcion As Integer = If(DdlTipoVenta.SelectedValue.Contiene("2", "3"), 2, 1) + + + Select Case DdlTipoVenta.SelectedValue.ToEntero + Case 2, 3 + Opcion = 2 + Exit Select + Case 5 + Opcion = 3 + Exit Select + Case Else + Opcion = 1 + Exit Select + End Select + Dim ObjOS As New ClsOS If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, Opcion, UsuarioActual.CveEmpresa) Then DTSolicitudDev = ObjOS.DtResultados @@ -2996,176 +3012,241 @@ Partial Class OS_OrdenesServicios Dim CveVentaPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveVenta").ToEntero Dim CveAlmacenDestino As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 10).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {CveSubProyectoPedido}").ToEntero - If Not CveAlmacenDestino > 0 Then - Alert("No se encontró almacen de entrega por adelantado", TipoMensaje.MsgAdvertencia) - Exit Sub + If DdlTipoVenta.SelectedValue.ToEntero = 5 Then + Dim TotalSeleccionado As Decimal = 0 + + For Each GVRow As GridViewRow In GvMU.Rows + TotalSeleccionado = TotalSeleccionado + GVRow.FCTextBox("TxtUtilizado").Text.ToDecimal + Next + + If TotalSeleccionado = 0 Then + Alert("No se selecciono ningun material", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Else + + If Not CveAlmacenDestino > 0 Then + Alert("No se encontró almacen de entrega por adelantado", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + + Dim ProcesoOK As Boolean = True Dim ObjV As New ClsVentas - Dim ClsOS As New ClsOS(ObjV.IniciaTransacSQL()) + Dim ObjOS As New ClsOS(ObjV.IniciaTransacSQL()) Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL()) Dim ObjConta As New ClsContabilidad(ObjV.IniciaTransacSQL()) - Dim GenrarRemisionMovimientos As Boolean = False - If ProcesoOK Then - Dim AplicaDevolucion As Boolean = False - For Each GvRow As GridViewRow In GvMU.Rows - Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero - Dim CantidadDev As Decimal = GvRow.DataKey("Cantidad").ToDecimal - GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal - If CantidadDev > 0 Then - AplicaDevolucion = True - If Not ObjV.UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle, CantidadDev) Then + + + If DdlTipoVenta.SelectedValue.ToEntero = 5 Then + + For Each GVRow As GridViewRow In GvMU.Rows + Dim CantidadRegistro As Decimal = GVRow.FCTextBox("TxtUtilizado").Text.ToDecimal + Dim CvePS As Integer = GVRow.DataKey("CvePS").ToEntero + + If CantidadRegistro > 0 Then + + Dim Serie As String = If(GVRow.DataKey("Serie") = "", "-1", GVRow.DataKey("Serie")) + Dim Lote As String = If(GVRow.DataKey("Lote") = "", "-1", GVRow.DataKey("Lote")) + Dim FechaCaducidad As DateTime = If(GVRow.DataKey("FechaCaducidad") = "", MinFecha, GVRow.DataKey("FechaCaducidad").ToDate) + + If Not ObjOS.AddOrdenesServicioMateriales(CveOS, CvePS, CantidadRegistro, Serie, Lote, FechaCaducidad, UsuarioActual.CveUsuario) Then + Alert("Ocurrió un error al guardar el material.", TipoMensaje.MsgAdvertencia) ProcesoOK = False - GenrarRemisionMovimientos = False - AplicaDevolucion = False Exit For End If - End If - If GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal > 0 Then - GenrarRemisionMovimientos = True End If - Next - If AplicaDevolucion Then - If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then + + If ProcesoOK Then + + Dim CveOSEstatusFinalizada As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 4").ToEntero + + If CveOSEstatusFinalizada > 0 Then + If Not ObjOS.UpdateOrdenesServiciosEstatus(CveOSEstatusFinalizada, UsuarioActual.CveUsuario, CveOS) Then + ProcesoOK = False + End If + Else + Alert("No se pudo obtener el estado para finalizar la orden de servicio.") ProcesoOK = False End If + + End If - End If - Dim Respuesta As New RespuestaFacturacion() - Dim DtVentaDetalle As New DataTable - Dim CveMovimientoSalida, CveMovimientoEntrada As Integer - Dim ImporteAlmacen As Decimal - Dim Fecha As DateTime = ClsPaginas.NowADS() - - If GenrarRemisionMovimientos AndAlso ProcesoOK Then - Respuesta = GeneraRemision(CveVentaPedido, ObjV.IniciaTransacSQL()) - - If Respuesta.CveVenta > 0 Then - If ObjV.GetVentaDetalle(Respuesta.CveVenta) Then - Dim dtClon As DataTable = ObjV.DtResultados.Copy - dtClon.DefaultView.Sort = "CveVentaDetalle ASC" - DtVentaDetalle = dtClon.DefaultView.ToTable() - End If - Else - ProcesoOK = False - End If - End If - - If GenrarRemisionMovimientos AndAlso ProcesoOK Then - - CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenActual, 8, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Respuesta.CveVenta, CveSubProyectoPedido, -1, CveOS:=CveOS, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="OS/MatUtil") - Dim Folio As Integer = ObjInventario.Folio - - If CveMovimientoSalida > 0 Then - - Dim IndexMov1 As Integer = 0 + Else + If ProcesoOK Then + Dim AplicaDevolucion As Boolean = False For Each GvRow As GridViewRow In GvMU.Rows + Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero + Dim CantidadDev As Decimal = GvRow.DataKey("Cantidad").ToDecimal - GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal - Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal - Dim CantidadRegistro As Decimal = GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal - Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero - Dim CveUM As Integer = GvRow.DataKey("CveUM").ToEntero - Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal - - If CantidadRegistro > 0 Then - Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero ' DtVentaDetalle.Rows(IndexMov1)("CveVentaDetalle").ToString.ToEntero - Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero - - Dim Serie As String = GvRow.DataKey("Serie") - Dim Lote As String = GvRow.DataKey("Lote") - Dim FechaCaducidad As DateTime = GvRow.DataKey("FechaCaducidad").ToDate - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadRegistro, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then - Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia) + If CantidadDev > 0 Then + AplicaDevolucion = True + If Not ObjV.UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle, CantidadDev) Then ProcesoOK = False + GenrarRemisionMovimientos = False + AplicaDevolucion = False Exit For End If End If - IndexMov1 = IndexMov1 + 1 + + If GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal > 0 Then + GenrarRemisionMovimientos = True + End If + Next + If AplicaDevolucion Then + If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then + ProcesoOK = False + End If + End If + End If + Dim Respuesta As New RespuestaFacturacion() + Dim DtVentaDetalle As New DataTable + Dim CveMovimientoSalida, CveMovimientoEntrada As Integer + Dim ImporteAlmacen As Decimal + Dim Fecha As DateTime = ClsPaginas.NowADS() - If ProcesoOK Then + If GenrarRemisionMovimientos AndAlso ProcesoOK Then + Respuesta = GeneraRemision(CveVentaPedido, ObjV.IniciaTransacSQL()) - CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Respuesta.CveVenta, CveSubProyectoPedido, -1, CveOS:=CveOS, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="OS/MatUtil2") + If Respuesta.CveVenta > 0 Then + If ObjV.GetVentaDetalle(Respuesta.CveVenta) Then + Dim dtClon As DataTable = ObjV.DtResultados.Copy + dtClon.DefaultView.Sort = "CveVentaDetalle ASC" + DtVentaDetalle = dtClon.DefaultView.ToTable() + End If + Else + ProcesoOK = False + End If + End If - If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then - ImporteAlmacen = ObjInventario.DtResultados.SUM("Total") - Dim IndexMov2 As Integer = 0 - For Each dRow As DataRow In ObjInventario.DtResultados.Rows + If GenrarRemisionMovimientos AndAlso ProcesoOK Then - Dim Cantidad As Decimal = dRow("Cantidad").ToString.ToDecimal - Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero - Dim CveUM As Integer = dRow("CveUM").ToString.ToEntero - Dim PU As Decimal = dRow("PU").ToString.ToDecimal - Dim CveVentaDetalle As Integer = dRow("CveVentaDetalle").ToString.ToEntero - Dim CveMovimientoDetalle As Integer = dRow("CveMovimientoDetalle").ToString.ToEntero + CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenActual, 8, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Respuesta.CveVenta, CveSubProyectoPedido, -1, CveOS:=CveOS, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="OS/MatUtil") + Dim Folio As Integer = ObjInventario.Folio - Dim Lote As String = dRow("Lote").ToString - Dim Serie As String = dRow("Serie").ToString - Dim FechaCaducidad As DateTime = dRow("FechaCaducidad").ToString.ToDateTime + If CveMovimientoSalida > 0 Then - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then + Dim IndexMov1 As Integer = 0 + For Each GvRow As GridViewRow In GvMU.Rows + + Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal + Dim CantidadRegistro As Decimal = GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal + Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero + Dim CveUM As Integer = GvRow.DataKey("CveUM").ToEntero + Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal + + If CantidadRegistro > 0 Then + Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero ' DtVentaDetalle.Rows(IndexMov1)("CveVentaDetalle").ToString.ToEntero + Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero + + Dim Serie As String = GvRow.DataKey("Serie") + Dim Lote As String = GvRow.DataKey("Lote") + Dim FechaCaducidad As DateTime = GvRow.DataKey("FechaCaducidad").ToDate + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadRegistro, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia) ProcesoOK = False Exit For End If - IndexMov2 = IndexMov2 + 1 - Next - If ProcesoOK Then - Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL) - Dim LigaVenta As String = String.Format("Venta {2} en Folio: {1}", CveMovimientoEntrada, Folio, "Material utilizado") + End If + IndexMov1 = IndexMov1 + 1 + Next - If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=Respuesta.CveVenta, CveOS:=CveOS) Then + If ProcesoOK Then + + CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Respuesta.CveVenta, CveSubProyectoPedido, -1, CveOS:=CveOS, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="OS/MatUtil2") + + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then + ImporteAlmacen = ObjInventario.DtResultados.SUM("Total") + Dim IndexMov2 As Integer = 0 + For Each dRow As DataRow In ObjInventario.DtResultados.Rows + + Dim Cantidad As Decimal = dRow("Cantidad").ToString.ToDecimal + Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero + Dim CveUM As Integer = dRow("CveUM").ToString.ToEntero + Dim PU As Decimal = dRow("PU").ToString.ToDecimal + Dim CveVentaDetalle As Integer = dRow("CveVentaDetalle").ToString.ToEntero + Dim CveMovimientoDetalle As Integer = dRow("CveMovimientoDetalle").ToString.ToEntero + + Dim Lote As String = dRow("Lote").ToString + Dim Serie As String = dRow("Serie").ToString + Dim FechaCaducidad As DateTime = dRow("FechaCaducidad").ToString.ToDateTime + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then + Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia) + ProcesoOK = False + Exit For + End If + IndexMov2 = IndexMov2 + 1 + Next + If ProcesoOK Then + Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL) + Dim LigaVenta As String = String.Format("Venta {2} en Folio: {1}", CveMovimientoEntrada, Folio, "Material utilizado") + + If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=Respuesta.CveVenta, CveOS:=CveOS) Then + ProcesoOK = False + End If + End If + Else + ProcesoOK = False + End If + End If + If ProcesoOK Then + If Not ObjOS.UpdateOrdenesServiciosFinaliza(CveOS, -1, -1, UsuarioActual.CveEmpresa) Then + ProcesoOK = False + End If + End If + If ProcesoOK Then + Dim Contabilizable As Boolean = False + Dim Concepto As String = "Material utilizado" + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("OS-MatUtil", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveMovimientoSalida > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAlmacen, ImporteAlmacen, 68, "", Concepto, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable) Then ProcesoOK = False End If End If - Else - ProcesoOK = False - End If - End If - If ProcesoOK Then - If Not ClsOS.UpdateOrdenesServiciosFinaliza(CveOS, -1, -1, UsuarioActual.CveEmpresa) Then - ProcesoOK = False - End If - End If - If ProcesoOK Then - Dim Contabilizable As Boolean = False - Dim Concepto As String = "Material utilizado" - Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("OS-MatUtil", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If CveMovimientoSalida > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAlmacen, ImporteAlmacen, 68, "", Concepto, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable) Then - ProcesoOK = False + If CveMovimientoEntrada > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteAlmacen, ImporteAlmacen, 68, "", Concepto, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable) Then + ProcesoOK = False + End If End If - End If - If CveMovimientoEntrada > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteAlmacen, ImporteAlmacen, 68, "", Concepto, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable) Then - ProcesoOK = False - End If - End If + End If + Else + ProcesoOK = False End If - Else - ProcesoOK = False End If End If + + If ProcesoOK Then + ObjV.Commit() - If GenrarRemisionMovimientos = False Then - Alert("El material sera recibido en almacén.") + If DdlTipoVenta.SelectedValue.ToEntero = 5 Then + Dim Liga As String = $" document.location.href=""/OS/OrdenesServicios.aspx?CveOS={CveOS}""; " + Alert("El material utilizado se guardó correctamente", TipoMensaje.MsgInformacion, Liga) Else - Alert("El material utilizado se guardó correctamente") + If GenrarRemisionMovimientos = False Then + Alert("El material sera recibido en almacén.") + Else + Alert("El material utilizado se guardó correctamente") + End If End If RegistraScript("$('#DivModalMaterialUtilizado').modal('hide');") Else ObjV.RollBack() - Alert("El material utilizado no se guardó correctamente", TipoMensaje.MsgAdvertencia) + Alert("Se presento un error al guardar el material", TipoMensaje.MsgAdvertencia) End If ObjV.Dispose() From 6071da164bb5cc72f408b0944994fdca03d1dfe2 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Fri, 12 Jan 2024 17:02:46 -0700 Subject: [PATCH 7/7] Clientes Abonar activar Deducciones Pago para empresa 15 --- Ventas/ClientesAbonar.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index acb39c93c..2bcfd0459 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -236,7 +236,7 @@ Partial Class Ventas_ClientesAbonar LnkAccionesModalSeleccionLayout.Visible = True End If - If UsuarioActual.CveEmpresa.Contiene(13, 1) Then + If UsuarioActual.CveEmpresa.Contiene(13, 1, 15) Then DVImporteDeduccionesPago.Visible = True End If