diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index 253b1f566..64b381f1d 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -610,7 +610,7 @@ Public Class ClsOS Public Function AddOrdenesServicios(CveCliente As Integer, CveSubProyecto As Integer, PersonaSolicito As String, FechaRecepcion As Date, Descripcion As String, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveCotizacion As Integer, CveVenta As Integer, CveOSPadre As Integer, CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1, Optional Direccion As String = "-1", Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1, Optional Año As String = "-1", Optional Correo As String = "", - Optional Condiciones As String = "", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1) As Boolean + Optional Condiciones As String = "", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1, Optional FechaCita As DateTime = MinFecha) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_OrdenesServiciosAdd") @@ -640,6 +640,7 @@ Public Class ClsOS .Add("@CveMedico", SqlDbType.Int).Value = CveMedico .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento .Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta + .Add("@FechaCita", SqlDbType.DateTime).Value = FechaCita .Add("@CveOS", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output @@ -685,7 +686,7 @@ Public Class ClsOS Public Function UpdateOrdenesServicios(PersonaSolicito As String, FechaRecepcion As String, Descripcion As String, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer, CveOS As Integer, CveUsuarioModifico As Integer, CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1, Optional Direccion As String = "-1", Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1, Optional Año As String = "-1", Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1", Optional Condiciones As String = "", - Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1) As Boolean + Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1, Optional FechaCita As DateTime = MinFecha) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_OrdenesServiciosUpdate") @@ -711,6 +712,7 @@ Public Class ClsOS .Add("@CveMedico", SqlDbType.Int).Value = CveMedico .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento .Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta + .Add("@FechaCita", SqlDbType.DateTime).Value = FechaCita End With diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index d40007c3b..3e8039f23 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -117,6 +117,8 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState Dim ColorIndex As Integer = 0 + + If DtTempSubproyectos.Rows.Count > 0 Then For Each drow As DataRow In DtTempSubproyectos.Rows @@ -140,9 +142,9 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState Dim EsCoordinador As Boolean = False + Dim usuarioActual_ As Usuario = UsuarioActual(context) If context IsNot Nothing AndAlso CveOS = -2 Then - Dim usuario As Usuario = UsuarioActual(context) - If usuario.TienePermisoProceso(348) Then + If usuarioActual_.TienePermisoProceso(348) Then EsCoordinador = True End If End If @@ -234,6 +236,22 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState cevent.backgroundColor = If(cevent.backgroundColor.Trim = "", "#1BBC9B", cevent.backgroundColor.Trim) End If + + If usuarioActual_.Empresa.Funcionalidad(578) = "1" Then + + If dr("TipoEstatusOS").ToString.ToEntero.Contiene(1, 2, 3) Then + cevent.backgroundColor = "#006699" + ElseIf dr("TipoEstatusOS").ToString.ToEntero.Contiene(4) Then + cevent.backgroundColor = "#025716" + ElseIf dr("TipoEstatusOS").ToString.ToEntero.Contiene(5) Then + cevent.backgroundColor = "#730505" + Else + cevent.backgroundColor = "#006699" + End If + + + End If + 'VERIFICAMOS SI TIENE O NO RECURRENCIA If Not cevent.recurrenciatipo > 0 Then @@ -407,4 +425,4 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState End Property -End Class \ No newline at end of file +End Class diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index 68f937f4e..3221ac521 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -330,7 +330,7 @@ public partial class CRM_Acercamiento : ClsPaginas - if (UsuarioActual.Empresa.Funcionalidad(590).ToString().ToEntero() == 1) + if (UsuarioActual.Empresa.Funcionalidad(578).ToString().ToEntero() == 1) { DVTipoVenta.Visible = true; DVAgenteProcedimiento.Visible = true; diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index 431c6c62c..ea0302fdd 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -312,7 +312,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas DdlPS.SelectedValue = "-1"; - if(UsuarioActual.Empresa.Funcionalidad(590).ToString().ToEntero() == 1) + if(UsuarioActual.Empresa.Funcionalidad(578).ToString().ToEntero() == 1) { DVAgenteProcedimiento.Visible = true; DVTipoVenta.Visible = true; diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 9d9280b60..cd06d558c 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -6312,8 +6312,8 @@ if ($get("C_Tab_TabOC_LbRetIVAOC1")) { $get("C_Tab_TabOC_LbRetIVAOC1").innerText = FormatoNumero(SumaRetIVA, 2); } - if ($get("C_Tab_TabOC_LbRetISROC1")) { - $get("C_Tab_TabOC_LbRetISROC1").innerText = FormatoNumero(SumaRetISR, 2); + if ($get("C_Tab_TabOC_LblRetISROC1")) { + $get("C_Tab_TabOC_LblRetISROC1").innerText = FormatoNumero(SumaRetISR, 2); } if ($get("C_Tab_TabOC_LbTotalOC1")) { $get("C_Tab_TabOC_LbTotalOC1").innerText = FormatoNumero(SumaTotal, 2); diff --git a/OS/Asignaciones.aspx b/OS/Asignaciones.aspx index 38ac67998..ee4ad4ec4 100644 --- a/OS/Asignaciones.aspx +++ b/OS/Asignaciones.aspx @@ -155,8 +155,14 @@ Ordenes Sin Asignar
| Nombre: | -+ |
|
- | + | |
| - Rquiere Técnico: + Requiere Técnico: |
Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Exit For Else @@ -8259,7 +8244,7 @@ Partial Class VentasMedicas Private Function GeneraOS(ByRef TransacSQL As SqlTransaction, ByRef errorList As List(Of String)) As Boolean - Dim Respuesta As Boolean = False + Dim Errores As Boolean = False Dim ObjOrdenServicio As New ClsOS(TransacSQL) @@ -8275,45 +8260,40 @@ Partial Class VentasMedicas If ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFecha.Text.Replace(",", "").ToDateTime, $"Venta: {Serie}-{FolioActual}", UsuarioActual.CveUsuario, EstatusOrdenServicio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSubProyectoDatos.SelectedValue.ToEntero, Direccion:="", Telefono:="", CveModeloAuto:=-1, Año:="", CveMedico:=DdlMedico.SelectedValue.ToEntero, - CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero) Then + CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFecha.Text.Replace(",", "").ToDateTime) Then CveOS = ObjOrdenServicio.CveOS Else errorList.Add("Se presento un error al guardar la orden de servicio.") Errores = True End If + Dim CvePSDetalle As Integer = UsuarioActual.Empresa.Funcionalidad(708).ToEntero + + If Not CvePSDetalle > 0 Then + errorList.Add("No se tiene asignado un producto para la orden de servicio (FNC 708).") + Errores = True + End If + If Not Errores Then - For Each Row As DataRow In TmpDT.Rows + Dim CveOsDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(ObjOrdenServicio.CveOS, CvePSDetalle, 1, -1, -1, $"Venta: {Serie}-{FolioActual}", False, True, False, -1, "-1", "-1", "-1", "", UsuarioActual.CveUsuario, Archivo:="") - 'Dim Consecutivo As Integer = Row("Consecutivo").ToString.ToEntero - Dim CvePS As Integer = Row("CvePS").ToString.ToEntero - Dim Obs As String = Row("Obs").ToString - 'Dim SeFacturara As Boolean = CBool(Row("SeFacturara").ToString) - 'Dim CveCuentaEquipo As Integer = Row("CveCuentaEquipo").ToString.ToEntero - 'Dim ComentarioTecnico As String = Row("ComentarioTecnico").ToString - Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero - 'Dim Archivo As New System.IO.FileInfo(String.Format("{0}OS\Temp\{1}", UsuarioActual.Empresa.Ruta, Row("Archivo").ToString)) + If CveOsDetalle > 0 Then + 'MENSAJE PRINCIPAL + Dim MensajeAlertOS As New StringBuilder + MensajeAlertOS.AppendFormat(String.Format(" La Orden de Servicio: {0} se generó correctamente. ", ObjOrdenServicio.Folio)) + MensajeAlert.AppendFormat(" ", Encripta(String.Format("OP=OS&CVEOS={0}", ObjOrdenServicio.CveOS))) + Dim Liga = $"document.location.href=""/OS/RepOrdenesServicios.aspx"";" + Alert(MensajeAlertOS.ToString, TipoMensaje.MsgInformacion, Liga) + Else + errorList.Add("Se presento un error al guardar la el detalle de la orden de servicio.") + Errores = True + End If - Dim CveOsDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(ObjOrdenServicio.CveOS, CvePS, Cantidad, -1, -1, Obs, False, True, False, -1, "-1", "-1", "-1", "", UsuarioActual.CveUsuario, Archivo:="") - - If CveOsDetalle > 0 Then - 'MENSAJE PRINCIPAL - Dim MensajeAlertOS As New StringBuilder - MensajeAlertOS.AppendFormat(String.Format(" La Orden de Servicio: {0} se generó correctamente. ", ObjOrdenServicio.Folio)) - MensajeAlert.AppendFormat(" ", Encripta(String.Format("OP=OS&CVEOS={0}", ObjOrdenServicio.CveOS))) - Dim Liga = $"document.location.href=""/OS/RepOrdenesServicios.aspx"";" - Alert(MensajeAlertOS.ToString, TipoMensaje.MsgInformacion, Liga) - Else - errorList.Add("Se presento un error al guardar la el detalle de la orden de servicio.") - Errores = True - Exit For - End If - Next End If - Return Respuesta + Return If(Errores, False, True) End Function @@ -13798,7 +13778,7 @@ Partial Class VentasMedicas End If If Not PermiteCredito AndAlso TienePagos AndAlso Total > 0 Then - Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC + Dim TotalPago As Decimal = DtPagos.SUM("Importe") + AmortizacionNC If TotalPago < Total Then Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) @@ -14110,7 +14090,7 @@ Partial Class VentasMedicas RowServicio("PorcentajeRetIVA") = ClienteRetIVA Next - TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal().FormatoNumero(2) + TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").FormatoNumero(2) Dim PorcentajeRetIVA As Decimal = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2) If PorcentajeRetIVA > 0 Then |