diff --git a/Acarreos/CatChoferes.aspx b/Acarreos/CatChoferes.aspx index 1886db78c..9680d08b3 100644 --- a/Acarreos/CatChoferes.aspx +++ b/Acarreos/CatChoferes.aspx @@ -27,7 +27,7 @@ " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> - + @@ -69,10 +69,43 @@ +
+
+
+ + <%----%> + +
+
+
+ + <%----%> + +
+
+
+ + + <%----%> + +
+
+
+ + <%----%> + +
+
+
+ + <%----%> + +
+
diff --git a/Acarreos/CatChoferes.aspx.vb b/Acarreos/CatChoferes.aspx.vb index 33eb8925e..251fd78bb 100644 --- a/Acarreos/CatChoferes.aspx.vb +++ b/Acarreos/CatChoferes.aspx.vb @@ -47,12 +47,12 @@ Partial Class Acarreos_CatChoferes Dim Estatus = 0 If ChkEstatus.Checked Then Estatus = 1 If HdnModalidad.Value = "A" Then - If ObjAcar.AddChofer(TxtChofer.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTransportista.SelectedValue) Then + If ObjAcar.AddChofer(TxtChofer.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTransportista.SelectedValue, TxtIdentificacion.Text.Trim, TxtDomicilio.Text.Trim, TxtTelefono.Text.Trim, TxtCiudad.Text.Trim, TxtLicencia.Text.Trim) Then CargaDatos() Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion) End If ElseIf HdnModalidad.Value = "U" Then - If ObjAcar.UpdateChofer(HdnID.Value, TxtChofer.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Estatus, DdlTransportista.SelectedValue) Then + If ObjAcar.UpdateChofer(HdnID.Value, TxtChofer.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Estatus, DdlTransportista.SelectedValue, TxtIdentificacion.Text.Trim, TxtDomicilio.Text.Trim, TxtTelefono.Text.Trim, TxtCiudad.Text.Trim, TxtLicencia.Text.Trim) Then CargaDatos() Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion) End If @@ -71,6 +71,11 @@ Partial Class Acarreos_CatChoferes BtnAgregarChofer.Text = "Actualizar" myModalLabel.InnerText = "Actualizar Chofer" TxtChofer.Text = GvRow.DataKey("Chofer") + TxtIdentificacion.Text = GvRow.DataKey("Identificacion") + TxtDomicilio.Text = GvRow.DataKey("Domicilio") + TxtTelefono.Text = GvRow.DataKey("Telefono") + TxtCiudad.Text = GvRow.DataKey("Ciudad") + TxtLicencia.Text = GvRow.DataKey("Licencia") DdlTransportista.SelectedValueExist(GvRow.DataKey("CveTransportista")) divEstatus.Visible = True ChkEstatus.Checked = CBool(GvRow.DataKey("Estatus")) @@ -84,6 +89,11 @@ Partial Class Acarreos_CatChoferes BtnAgregarChofer.Text = "Agregar" myModalLabel.InnerText = "Agregar Chofer" TxtChofer.Text = "" + TxtIdentificacion.Text = "" + TxtDomicilio.Text = "" + TxtTelefono.Text = "" + TxtCiudad.Text = "" + TxtLicencia.Text = "" ChkEstatus.Checked = True divEstatus.Visible = False UpAddChofer.Update() diff --git a/App_Code/ClsAcarreos.vb b/App_Code/ClsAcarreos.vb index c85f93087..e039cb589 100644 --- a/App_Code/ClsAcarreos.vb +++ b/App_Code/ClsAcarreos.vb @@ -109,7 +109,7 @@ Public Class ClsAcarreos #Region "Choferes" - Public Function AddChofer(Chofer As String, CveUsuario As Integer, CveEmpresa As Integer, CveTransportista As Integer) As Boolean + Public Function AddChofer(Chofer As String, CveUsuario As Integer, CveEmpresa As Integer, CveTransportista As Integer, Identificacion As String, Domicilio As String, Telefono As String, Ciudad As String, Licencia As String) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Acar_ChoferesAdd") With SqlAdapter.SelectCommand.Parameters @@ -117,6 +117,11 @@ Public Class ClsAcarreos .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveTransportista", SqlDbType.Int).Value = CveTransportista + .Add("@Identificacion", SqlDbType.VarChar).Value = Identificacion + .Add("@Domicilio", SqlDbType.VarChar).Value = Domicilio + .Add("@Telefono", SqlDbType.VarChar).Value = Telefono + .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad + .Add("@Licencia", SqlDbType.VarChar).Value = Licencia End With Try SqlAdapter.Fill(Data) @@ -128,7 +133,7 @@ Public Class ClsAcarreos Return Retorno End Function - Public Function UpdateChofer(CveChofer As Integer, Chofer As String, CveUsuario As Integer, CveEmpresa As Integer, Estatus As Integer, CveTransportista As Integer) As Boolean + Public Function UpdateChofer(CveChofer As Integer, Chofer As String, CveUsuario As Integer, CveEmpresa As Integer, Estatus As Integer, CveTransportista As Integer, Identificacion As String, Domicilio As String, Telefono As String, Ciudad As String, Licencia As String) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Acar_ChoferesUpdate") With SqlAdapter.SelectCommand.Parameters @@ -138,7 +143,11 @@ Public Class ClsAcarreos .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@CveTransportista", SqlDbType.Int).Value = CveTransportista - + .Add("@Identificacion", SqlDbType.VarChar).Value = Identificacion + .Add("@Domicilio", SqlDbType.VarChar).Value = Domicilio + .Add("@Telefono", SqlDbType.VarChar).Value = Telefono + .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad + .Add("@Licencia", SqlDbType.VarChar).Value = Licencia End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index 1cfb6672d..c425d7c80 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -1574,16 +1574,16 @@ Public Class ClsOS Return Retorno End Function - Public Function RemoveEstatusUsuarios(CveEstatusUsuarios As Integer) As Boolean + Public Function RemoveEstatusUsuarios(CveEstatus As Integer, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_EstatusUsuariosRemove") With SqlAdapter.SelectCommand.Parameters - SqlAdapter.SelectCommand.Parameters.Add("@CveEstatusUsuario", SqlDbType.Int).Value = CveEstatusUsuarios + .Add("@CveEstatusOrdenServicio", SqlDbType.Int).Value = CveEstatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With - Try SqlAdapter.Fill(Data) Retorno = True diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index bb6ac059f..08c098bd7 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -7951,7 +7951,7 @@ Partial Class Compras_Compras ImporteMovimiento = 0 IdCtaContable = 0 CveCuenta = 0 - Dim Concepto As String = "" + Dim Concepto As String = String.Format("{0}-{1}", TxtSerie.Text, TxtFolio.Text) Dim importeMN As Decimal = 0 Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1) Dim PorcentajeImpuesto As Decimal = 0 @@ -13440,7 +13440,7 @@ Partial Class Compras_Compras Protected Sub BtnRefacturacionVer_Click(sender As Object, e As EventArgs) Handles BtnRefacturacionVer.Click Dim Opcion As Integer = 1 - If UsuarioActual.CveEmpresa = 119 Then Opcion = 2 + If UsuarioActual.CveEmpresa.Contiene(119, 72) Then Opcion = 2 Dim ObjCompras As New ClsCompras @@ -14553,7 +14553,7 @@ Partial Class Compras_Compras End If End If - If Math.Abs(HdnIEPSModificadoOC.Value.ToDecimal - LbIEPSOC2.Text.ToDecimal) > 0.05 Then + If Math.Abs(HdnIEPSModificadoOC.Value.ToDecimal - LbIEPSOC2.Text.ToDecimal) > 0.05 AndAlso UsuarioActual.CveEmpresa.Contiene(119) Then Alert($"Hay una diferencia de IEPS entre la factura y la OC. Dif: {HdnIEPSModificadoOC.Value.ToDecimal - LbIEPSOC2.Text.ToDecimal}", TipoMensaje.MsgAdvertencia) Exit Sub End If diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 2c0623c7f..4bb7f050d 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -2111,7 +2111,17 @@ Partial Class Inventarios_RecepcionAlmacen 'ENTREGA DIRECTA If EntregaDirecta Then If Not ErrorMovInv Then - CveMovtoSalidaDirecta = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimiento, Remision:=TxtRemision.Text, CveVendedor:=CveVendedor, CveCliente:=CveCliente) + Dim CveVenta As Integer = 0 + Dim Dt As DataTable + + If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then + If ObjInventario.DtResultados.Rows.Count > 0 Then + Dt = ObjInventario.DtResultados + CveVenta = ObjInventario.DtResultados.Rows(0)("CveVenta").ToString.ToEntero + End If + End If + + CveMovtoSalidaDirecta = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimiento, Remision:=TxtRemision.Text, CveVendedor:=CveVendedor, CveCliente:=CveCliente) FolioSalidaDirecta = ObjInventario.Folio If Not CveMovtoSalidaDirecta > 0 Then @@ -2119,14 +2129,12 @@ Partial Class Inventarios_RecepcionAlmacen End If If Not ErrorMovInv Then - If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaDirecta, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then - ErrorMovInv = True - Exit For - End If - Next - End If + For Each Dr As DataRow In Dt.Rows + If Not ObjInventario.AddMovimientoDetalle(CveMovtoSalidaDirecta, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + ErrorMovInv = True + Exit For + End If + Next End If If Not ErrorMovInv Then diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index 234eb59d3..0dc78ba79 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -172,14 +172,14 @@
- -
- -
+ +
+ +
@@ -256,7 +256,8 @@
- + +
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 7dc7cd4a5..9a928c671 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -377,7 +377,7 @@ Partial Class Inventarios_TraspasoAlmacen 'Llena Choferes Dim ObjAcar As New ClsAcarreos() - If ObjAcar.GetChofer(-1, UsuarioActual.CveEmpresa, -1, -1) Then + If ObjAcar.GetChofer(-1, UsuarioActual.CveEmpresa, 1, -1) Then DldChofer.DataSource = ObjAcar.DtResultados DldChofer.DataBind() End If @@ -2408,5 +2408,19 @@ Partial Class Inventarios_TraspasoAlmacen #End Region + Protected Sub DldChofer_SelectedIndexChanged(sender As Object, e As EventArgs) + Dim ObjAcar As New ClsAcarreos() + If ObjAcar.GetChofer(DldChofer.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1, -1) Then + Dim dr As DataRow = ObjAcar.DtResultados.Rows(0) + If dr IsNot Nothing Then + TxtIdentificacion.Text = dr("Identificacion").ToString + TxtDomicilio.Text = dr("Domicilio").ToString + TxtTelefono.Text = dr("Telefono").ToString + TxtCiudad.Text = dr("Ciudad").ToString + TxtLicencia.Text = dr("Licencia").ToString + End If + End If + ObjAcar.Dispose() + End Sub End Class diff --git a/LogMail.txt b/LogMail.txt index 0ac18eb14..f636678cd 100644 --- a/LogMail.txt +++ b/LogMail.txt @@ -4,4 +4,4 @@ en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\WWWSIGIT\App_Code\ClsSisMail.vb:línea 129 05/09/2019:12:31 p. m. From:'signotificaciones@adssistemas.mx' - Para:';' - Asunto:'Envío de complemento de pago' - CCP: '' - Adjuntos: 2 - Ocurrió un error al mandar correo.System.InvalidOperationException: Se debe especificar un destinatario. en System.Net.Mail.SmtpClient.Send(MailMessage message) - en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\WWWSIGIT\App_Code\ClsSisMail.vb:línea 129 10/09/2019:10:34 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - Se programaron las siguientes facturas' - CCP: '' - Adjuntos: 0 10/09/2019:10:36 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - Se programaron las siguientes facturas' - CCP: '' - Adjuntos: 0 10/09/2019:10:39 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - Se programaron las siguientes facturas' - CCP: '' - Adjuntos: 0 \ No newline at end of file + en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\WWWSIGIT\App_Code\ClsSisMail.vb:línea 129 10/09/2019:12:16 p. m. From:'signotificaciones@adssistemas.mx' - Para:'DSDDS@hotmail.com' - Asunto:'SIG - La Orden Compra #26598 cambió de estatus.' - CCP: '' - Adjuntos: 0 10/09/2019:02:58 p. m. No se especifico a remitente - SIG - La Orden Compra #28107 cambió de estatus. \ No newline at end of file diff --git a/OS/CatEstatusOrdenServicio.aspx b/OS/CatEstatusOrdenServicio.aspx index 4d4360e96..650836c10 100644 --- a/OS/CatEstatusOrdenServicio.aspx +++ b/OS/CatEstatusOrdenServicio.aspx @@ -119,7 +119,7 @@ - + @@ -302,70 +302,6 @@ - - - - - - - - - - - - - - - diff --git a/OS/CatEstatusOrdenServicio.aspx.vb b/OS/CatEstatusOrdenServicio.aspx.vb index c147d4075..2c6c42f99 100644 --- a/OS/CatEstatusOrdenServicio.aspx.vb +++ b/OS/CatEstatusOrdenServicio.aspx.vb @@ -30,7 +30,7 @@ Partial Class OS_CatEstatusOrdenServicio Get Return CType(ViewState("DTEstatusUsuarios"), DataTable) End Get - Set(value As DataTable) + Set(value As Data.DataTable) ViewState("DTEstatusUsuarios") = value End Set End Property @@ -39,17 +39,12 @@ Partial Class OS_CatEstatusOrdenServicio Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then + CargaDatos() CreaGrid("Req") - CreaGrid("OC") CargaGridEstatusUsuarios() ViewState("Orden") = "" - 'ViewState("TipoSeleccionado") = DdlTipo.SelectedValue CveEstatuOS = -1 - CargaDatos() - - 'CargaProyectos() - CargaUsuarios() End If End Sub @@ -66,6 +61,12 @@ Partial Class OS_CatEstatusOrdenServicio Else Me.GvDatos.DataSource = Nothing End If + + If ObjEstatusOrdenServicios.GetEstatusUsuarios(-1, -1) Then + DTEstatusUsuarios = ObjEstatusOrdenServicios.DtResultados + Dim PermisosDeUsuario As DataTable = DTEstatusUsuarios + End If + OrdenaDatos() ObjEstatusOrdenServicios.Dispose() GvDatos.DataBind() @@ -148,16 +149,8 @@ Partial Class OS_CatEstatusOrdenServicio Dim Estado As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked Dim CveEstatusOrdenServicio As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero - 'If ObjEstatusOrdenServicios.UpdateEstatusOrdenServicio(EstatusOrdenServicio, Estado, CveEstatusOrdenServicio) Then - ' GvDatos.EditIndex = -1 - ' ViewState("DTEstatusOrdenServicios") = ObjEstatusOrdenServicios.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - ' GlobalDTEstatusOrdenServicios = ObjEstatusOrdenServicios.DtResultados - ' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) - 'End If - ObjEstatusOrdenServicios.Dispose() - End Sub #End Region @@ -173,85 +166,50 @@ Partial Class OS_CatEstatusOrdenServicio #End Region #Region "Configuracion" - Protected Sub ibOpciones1_Click(sender As Object, e As ImageClickEventArgs) - Dim imgBtn As ImageButton = DirectCast(sender, System.Web.UI.WebControls.ImageButton) - - ddlSuperior.Items.Clear() - - If imgBtn.CommandArgument <> "" Then - 'chkMostrarLimites.Visible = If(GlobalDTOCEstatus.FiltraParametros("CveEstatusSiguiente = " + imgBtn.CommandArgument)(0)("TipoTermino").ToString.ToEntero = 3, False, True) - chkMostrarLimites.Style("display") = If(GlobalDTOCEstatus(UsuarioActual.CveEmpresa).FiltraParametros("CveEstatusSiguiente = " + imgBtn.CommandArgument)(0)("TipoTermino").ToString.ToEntero = 3, "none", "inline") - - - 'ddlSuperior.DataSource = DTEstatusUsuarios.FiltraParametros(String.Format("CveEstatus = {0}", imgBtn.CommandArgument), "Nombre DESC") - ddlSuperior.DataBind() - ddlSuperior.Items.Insert(0, New ListItem("Todos los Superiores", "-1")) - Try - ddlSuperior.SelectedValue = hdnCveSuperior.Value - Catch ex As Exception - - End Try - tblSuperior.Visible = True - Else - tblSuperior.Visible = False - End If - - UPSuperior.Update() - UPPEmp.Update() - RegistraScript("$('#DivSuperior').show(1000); PosicionaObjeto('" + imgBtn.ClientID + "','DivSuperior'); chkMostrarLimitesCambio();") - End Sub Private Sub CreaGrid(Tipo As String) Dim i As Integer = 1 For Each Row As DataRow In GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).Rows - GvEstatusUsuariosREQ.Columns(i).HeaderText = Row("EstatusOrdenServicio").ToString.ToUpper - GvEstatusUsuariosREQ.Columns(i).FooterText = Row("CveEstatusOrdenServicio").ToString + GvEstatusUsuarios.Columns(i).HeaderText = Row("EstatusOrdenServicio").ToString.ToUpper + GvEstatusUsuarios.Columns(i).FooterText = Row("CveEstatusOrdenServicio").ToString i += 1 Next While i <= 10 - GvEstatusUsuariosREQ.Columns(i).Visible = False + GvEstatusUsuarios.Columns(i).Visible = False i += 1 End While End Sub Protected Sub CargaGridEstatusUsuarios() - GvEstatusUsuariosREQ.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa) - GvEstatusUsuariosREQ.DataBind() + GvEstatusUsuarios.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa) + GvEstatusUsuarios.DataBind() UPPEmp.Update() End Sub - Public Sub CargaUsuarios() - ddlSuperior.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa) - ddlSuperior.DataBind() - End Sub - Protected Sub btnGuardarEstatusUsuariosREQ_Click(sender As Object, e As EventArgs) Handles btnGuardarEstatusUsuariosREQ.Click Dim objEstatusOC As New ClsOS objEstatusOC.IniciaTransacSQL() Dim HuboErrores As Boolean = False Dim CveSubProyecto = 59 - - For Each Row As GridViewRow In GvEstatusUsuariosREQ.Rows - Dim aux As String = Row.DataKey("CveUsuario").ToString + For Each Row As GridViewRow In GvEstatusUsuarios.Rows Dim r As Integer = 1 For i = 0 To Row.Cells.Count - 1 - Dim CveEstatus As Integer = If(IsNumeric(GvEstatusUsuariosREQ.Columns(i).FooterText), GvEstatusUsuariosREQ.Columns(i).FooterText.ToEntero, 0) + Dim CveEstatus As Integer = If(IsNumeric(GvEstatusUsuarios.Columns(i).FooterText), GvEstatusUsuarios.Columns(i).FooterText.ToEntero, 0) If CveEstatus > 0 Then - If Row.FCCheckBox("chkEstatus" + r.ToString).Checked = False And Row.FCHiddenField("hdnCveEstatusUsuarios" + r.ToString).Value.ToEntero > 0 Then + If Row.FCCheckBox("chkEstatus" + r.ToString).Checked = False Then 'Eliminar el registro existente - If Not objEstatusOC.RemoveEstatusUsuarios(Row.FCHiddenField("hdnCveEstatusUsuarios" + r.ToString).Value.ToEntero) Then + If Not objEstatusOC.RemoveEstatusUsuarios(CveEstatus, Row.DataKey("CveUsuario").ToString.ToEntero) Then HuboErrores = True Exit For End If ElseIf Row.FCCheckBox("chkEstatus" + r.ToString).Checked = True Then - 'And Row.FCHiddenField("hdnCveEstatusUsuarios" + r.ToString).Value.ToEntero = -1 'Guardado masivo cuando sea SubProyecto "Todos" If CveSubProyecto = -2 Then For Each dr As DataRow In GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).Rows @@ -292,7 +250,25 @@ Partial Class OS_CatEstatusOrdenServicio End If objEstatusOC.Dispose() + CargaDatos() CargaGridEstatusUsuarios() End Sub + + Protected Sub GvEstatusUsuarios_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstatusUsuarios.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + Dim PermisosDeUsuario As DataTable = DTEstatusUsuarios.FiltraParametros(String.Format("CveUsuario = {0}", e.Row.DBCampo("CveUsuario").ToString)) + Dim CveUsuario As String = e.Row.DBCampo("CveUsuario").ToString + For i As Integer = 1 To 10 + Dim CveEstatus As Integer = GvEstatusUsuarios.Columns(i).FooterText.ToEntero + If CveEstatus > 0 Then + Dim auxiliarBandera As DataRow = PermisosDeUsuario.FiltroPrimero(String.Format("CveEstatusOrdenServicio = {0}", CveEstatus.ToString)) + If auxiliarBandera IsNot Nothing Then + Dim chkEstatus As CheckBox = e.Row.FCCheckBox(String.Format("chkEstatus{0}", i)) + chkEstatus.Checked = True + End If + End If + Next + End If + End Sub #End Region End Class diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index fdc5e0ec5..3c65c9dda 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -9370,8 +9370,8 @@ Partial Class Ventas Importe91 = Dr("Importe").ToString.ToDecimal ImporteMN91 = Dr("Importe").ToString.ToDecimal * TipoCambioNC ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then - Importe251 = Dr("Importe").ToString.ToDecimal - Importe91 = Dr("Importe").ToString.ToDecimal + + Importe91 = Dr("Importe").ToString.ToDecimal / TipoCambioNC ImporteMN91 = Dr("Importe").ToString.ToDecimal End If @@ -9385,7 +9385,8 @@ Partial Class Ventas ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then - ImporteMN251 = Dr("Importe").ToString.ToDecimal / TipoCambioNC + Importe251 = Dr("Importe").ToString.ToDecimal / TCFluctuacion + ImporteMN251 = Dr("Importe").ToString.ToDecimal Else ImporteMN251 = Dr("Importe").ToString.ToDecimal End If @@ -19934,7 +19935,7 @@ Partial Class Ventas Private Sub CargaCxC() Dim ObjMovtos As New ClsMovimientos() - If ObjMovtos.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, "-1", "-1", DdlMoneda.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, DdlSucursalCliente.SelectedValue.ToEntero) Then + If ObjMovtos.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, DdlSucursalCliente.SelectedValue.ToEntero) Then Dim DtTemporal As DataTable = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act' AND CveVenta > 0", "Moneda, OrdenVencimiento, FechaVencimiento") GvCxC.DataSource = DtTemporal End If