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
- - + + + + + + +
+
@@ -175,7 +181,8 @@
- @@ -216,7 +223,6 @@ > - diff --git a/OS/Asignaciones.aspx.vb b/OS/Asignaciones.aspx.vb index 4044f2a1d..66c3de3e1 100644 --- a/OS/Asignaciones.aspx.vb +++ b/OS/Asignaciones.aspx.vb @@ -4,6 +4,7 @@ Option Strict On Imports System.Data Imports Extensiones Imports Microsoft.Reporting.WebForms +Imports MKB.TimePicker Partial Class OS_Asignaciones Inherits ClsPaginas @@ -248,7 +249,7 @@ Partial Class OS_Asignaciones Dim CorreoAsignado As String = GlobalDTUsuarios(DdlTecnico.SelectedValue.ToEntero).Rows(0)("Correo").ToString If Not TieneError Then - MandaCorreOS(row.DataKey("CveOS").ToEntero, CorreoAsignado) + MandaCorreOS(row.DataKey("CveOS").ToEntero, CorreoAsignado, TrasaccionSql:=ObjOS.IniciaTransacSQL) End If @@ -278,11 +279,11 @@ Partial Class OS_Asignaciones UpOS.Update() End Sub - Private Sub MandaCorreOS(CveOS As Integer, CorreoUsuarioAsignado As String) + Private Sub MandaCorreOS(CveOS As Integer, CorreoUsuarioAsignado As String, ByRef TrasaccionSql As SqlClient.SqlTransaction) - Dim ObjOS As New ClsOS() + Dim ObjOS As New ClsOS(TrasaccionSql) Dim params As New List(Of ReportParameter) Dim CveFolio = "" @@ -453,6 +454,7 @@ Partial Class OS_Asignaciones #Region "GV" Private Sub GvNA_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvNA.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DataKey("CveUsuarioAtendio") <> "" Then e.Row.FCCheckBox("ChbxAsignar").Visible = False e.Row.FCTextBox("FechaOS").Visible = False @@ -471,6 +473,21 @@ Partial Class OS_Asignaciones e.Row.FindControl("TimeSelector").Visible = True End If + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + + Dim FechaCita = e.Row.DataKey("FechaCitaOS").ToDateTime + e.Row.FCTextBox("FechaOS").Text = FechaCita.ToString("dd/MM/yyyy") + e.Row.FCTextBox("FechaOS").Visible = True + + e.Row.FindControl("TimeSelector").Visible = True + + Dim TMSelector = DirectCast(e.Row.FindControl("TimeSelector"), TimeSelector) + TMSelector.Date = FechaCita + + + End If + + End If UpOS.Update() diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx index a860a6096..09c1fde9c 100644 --- a/OS/OrdenesServicios.aspx +++ b/OS/OrdenesServicios.aspx @@ -86,10 +86,11 @@
-
+ +
Fecha Recibido:
-
+
@@ -103,6 +104,14 @@
+ +
+ Fecha De Cita: +
+
+ +
+
@@ -112,7 +121,7 @@ Sucursal del Cliente:
-
+
@@ -130,7 +139,7 @@
- Sub Proyecto: + Sub Proyecto:
@@ -203,10 +212,10 @@
-
+
- Agente: + Medico:
diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index dbe2026ce..424c967c2 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -418,10 +418,17 @@ Partial Class OS_OrdenesServicios End If - If UsuarioActual.Empresa.Funcionalidad(590).ToEntero = 1 Then - DVAgenteProcedimiento.Visible = True + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + DVAMedicoProcedimiento.Visible = True DVTipoVenta.Visible = True DVTipoVenta.Visible = True + + DvFechaRecivido1.Visible = False + DvFechaRecivido2.Visible = False + + DVFechaCita1.Visible = True + DVFechaCita2.Visible = True + End If End If @@ -591,6 +598,7 @@ Partial Class OS_OrdenesServicios CveOsDetalle = ObjOS.CveOSDetalle TxtFechaRecibido.Text = ObjOS.FechaRecepcion.ToString("dd/MM/yyyy") + TxtFechaCita.Text = ObjOS.FechaCita.ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T") CveFolio = ObjOS.Folio LblFolio.Text = ObjOS.Folio.ToString @@ -1198,6 +1206,19 @@ Partial Class OS_OrdenesServicios #Region "M E T O D O S" Protected Sub Guardar(Entregar As Boolean) + + Dim FechaCita As DateTime = MinFecha + + If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + If Not IsDate(TxtFechaCita.Text.Replace(",", "")) Then + Alert("El campo Fecha De Cita no es valido.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + FechaCita = TxtFechaCita.Text.Replace(",", "").ToDateTime + End If + + + Dim ObjOrdenServicio As New ClsOS() Dim ObjGenerales As New ClsGenerales(ObjOrdenServicio.IniciaTransacSQL) MensajeAlert = New StringBuilder @@ -1212,7 +1233,7 @@ Partial Class OS_OrdenesServicios If Not ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyecto.SelectedValue.ToEntero, TxtSolicito.Text, TxtFechaRecibido.Text.ToDateTime, TxtDescripcion.Text, UsuarioActual.CveUsuario, EstatusOrdenServicio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCotizacion, -1, -1, DdlTipoOrdenOS.SelectedValue.ToEntero, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero, Direccion:=TxtDireccion.Text, Telefono:=TxtTelefono.Text, CveModeloAuto:=DdlModeloAuto.SelectedValue.ToEntero, Año:=TxtAnio.Text, CveMedico:=DdlMedico.SelectedValue.ToEntero, - CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero) Then + CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero, FechaCita:=FechaCita) Then Errores = True End If CargaCliente(CveCliente) @@ -1308,11 +1329,12 @@ Partial Class OS_OrdenesServicios End If Else - If CveTecnico = UsuarioActual.CveUsuario Then + If CveTecnico = UsuarioActual.CveUsuario Or UpGuardar.Visible Then + If ObjOrdenServicio.UpdateOrdenesServicios(TxtSolicito.Text, TxtFechaRecibido.Text, TxtDescripcion.Text, UsuarioActual.CveUsuario, DdlEstatusOS.SelectedValue.ToEntero, CveOS, UsuarioActual.CveUsuario, DdlTipoOrdenOS.SelectedValue.ToEntero, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero, Direccion:=TxtDireccion.Text, Telefono:=TxtTelefono.Text, CveModeloAuto:=DdlModeloAuto.SelectedValue.ToEntero, Año:=TxtAnio.Text, CveMedico:=DdlMedico.SelectedValue.ToEntero, - CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero) Then + CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero, FechaCita:=FechaCita) Then For Each Row As DataRow In TmpDT.Rows If Not Errores Then Dim CvePS As Integer = Row("CvePS").ToString.ToEntero diff --git a/OS/RepServicioDomicilio.aspx.vb b/OS/RepServicioDomicilio.aspx.vb index e66cc2b5a..084df90aa 100644 --- a/OS/RepServicioDomicilio.aspx.vb +++ b/OS/RepServicioDomicilio.aspx.vb @@ -310,8 +310,16 @@ Partial Class OS_RepServicioDomicilio DTTecnicos = New DataTable Dim ObjUsuarios As New ClsSisUsuarios + + + If ObjUsuarios.GetPermisosPorUsuarioProcesos(-1, -1, -1, -1, 351, UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Then - DTTecnicos = ObjUsuarios.DtResultados.FiltraParametros(" CveProcesoUsuarioAcceso > 0") + If UsuarioActual.CveRol = 1 Then + DTTecnicos = ObjUsuarios.DtResultados.FiltraParametros(" CveProcesoUsuarioAcceso > 0") + Else + DTTecnicos = ObjUsuarios.DtResultados.FiltraParametros(" CveProcesoUsuarioAcceso > 0 and CveUsuario <> 100") + End If + End If ObjUsuarios.Dispose() diff --git a/Ventas/VentasMedicas.aspx b/Ventas/VentasMedicas.aspx index 3e6489868..82c40dfee 100644 --- a/Ventas/VentasMedicas.aspx +++ b/Ventas/VentasMedicas.aspx @@ -207,7 +207,7 @@
- +
@@ -233,14 +233,14 @@
- +
- - @@ -337,7 +337,7 @@
Nombre:  + +
- Rquiere Técnico: + Requiere Técnico: diff --git a/Ventas/VentasMedicas.aspx.vb b/Ventas/VentasMedicas.aspx.vb index 0e8ea43b0..c69f6c102 100644 --- a/Ventas/VentasMedicas.aspx.vb +++ b/Ventas/VentasMedicas.aspx.vb @@ -5991,22 +5991,7 @@ Partial Class VentasMedicas End If End If - 'Try - ' 'RMF, cuando es pedido, se manda autorización. - ' If ObjFactura.TipoDocto.Contiene("PA") Then - ' Dim Titulo As String = "Solicitud de autorización" 'usuarios de crédito y cobranza - ' Dim Msg As String = String.Format("{0} - Folio {1} ", DdlSubProyectoDatos.SelectedItem.Text, TxtFolio.Text) - ' 'If UsuarioActual.CveEmpresa = 119 Then - ' ' ClsSisNotificaciones.SendNotificacionERP(1715, Titulo, Msg, 1) - ' ' ClsSisNotificaciones.SendNotificacionERP(1815, Titulo, Msg, 1) - ' ' ClsSisNotificaciones.SendNotificacionERP(1830, Titulo, Msg, 1) - ' 'End If - - ' End If - 'Catch ex As Exception - ' OnError("Ocurrió un error al mandar las notificaciones de autorización", ex) - 'End Try Try ViewState("CveVenta") = ObjFactura.CveVenta @@ -6516,8 +6501,8 @@ Partial Class VentasMedicas ObjFactura.UsuarioCreo = LblUsuario.Text.Trim ObjFactura.CveCondicionEntrega = --1 ObjFactura.CondicionEntrega = "-1" - ObjFactura.CondicionesPago = 0 ' 0 - Contado, 1 - Credito, 2 - termianl - ObjFactura.FormaPago = 0 'DdlFormaPago.SelectedValue.ToEntero() + ObjFactura.CondicionesPago = 2 ' 0 - Contado, 1 - Credito, 2 - termianl + ObjFactura.FormaPago = 0 ObjFactura.AtencionA = "" ObjFactura.FordGSDB = "" @@ -6732,13 +6717,13 @@ Partial Class VentasMedicas End If Next - ObjFactura.SubTotal = TmpDT.SUM("Total").ToDecimal - ObjFactura.Descuento = TmpDT.SUM("Descuento").ToDecimal + ObjFactura.SubTotal = TmpDT.SUM("Total") + ObjFactura.Descuento = TmpDT.SUM("Descuento") ObjFactura.Amortizacion = Math.Round(LblAmortizacion.Text.Trim.ToDecimal * ObjFactura.TipoCambio, NumeroDecimales) - ObjFactura.IVA = TmpDT.SUM("ImporteIVA").ToDecimal - ObjFactura.RetIVA = TmpDT.SUM("ImporteRetIVA").ToDecimal - ObjFactura.RetISR = TmpDT.SUM("ImporteRetISR").ToDecimal - ObjFactura.IEPS = TmpDT.SUM("ImporteIEPS").ToDecimal + ObjFactura.IVA = TmpDT.SUM("ImporteIVA") + ObjFactura.RetIVA = TmpDT.SUM("ImporteRetIVA") + ObjFactura.RetISR = TmpDT.SUM("ImporteRetISR") + ObjFactura.IEPS = TmpDT.SUM("ImporteIEPS") ObjFactura.Total = (ObjFactura.SubTotal - ObjFactura.Descuento - ObjFactura.Amortizacion + ObjFactura.IVA + ObjFactura.IEPS - ObjFactura.RetIVA - ObjFactura.RetISR - ImpuestosLocales).ToDecimal TipoCambioRemision = ObjFactura.TipoCambio @@ -6767,13 +6752,13 @@ Partial Class VentasMedicas End If Next - ObjFactura.SubTotal = TmpDT.SUM("Total").ToDecimal - ObjFactura.Descuento = TmpDT.SUM("Descuento").ToDecimal + ObjFactura.SubTotal = TmpDT.SUM("Total") + ObjFactura.Descuento = TmpDT.SUM("Descuento") ObjFactura.Amortizacion = Math.Round(LblAmortizacion.Text.Trim.ToDecimal / ObjFactura.TipoCambioDolares, NumeroDecimales) - ObjFactura.IVA = TmpDT.SUM("ImporteIVA").ToDecimal - ObjFactura.RetIVA = TmpDT.SUM("ImporteRetIVA").ToDecimal - ObjFactura.RetISR = TmpDT.SUM("ImporteRetISR").ToDecimal - ObjFactura.IEPS = TmpDT.SUM("ImporteIEPS").ToDecimal + ObjFactura.IVA = TmpDT.SUM("ImporteIVA") + ObjFactura.RetIVA = TmpDT.SUM("ImporteRetIVA") + ObjFactura.RetISR = TmpDT.SUM("ImporteRetISR") + ObjFactura.IEPS = TmpDT.SUM("ImporteIEPS") ObjFactura.Total = (ObjFactura.SubTotal - ObjFactura.Descuento - ObjFactura.Amortizacion + ObjFactura.IVA + ObjFactura.IEPS - ObjFactura.RetIVA - ObjFactura.RetISR - ImpuestosLocales).ToDecimal TipoCambioRemision = ObjFactura.TipoCambioDolares @@ -8074,11 +8059,11 @@ Partial Class VentasMedicas 'Se agregan los PS For Each Row As DataRow In TmpDTDetalle.Rows - If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDouble, Row("CveUM").ToString().ToEntero(), - Row("PU").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6), - Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(), - CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDouble, - PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDouble, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal()) Then + If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDecimal, Row("CveUM").ToString().ToEntero(), + Row("PU").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString().ToDecimal, Math.Round((Row("Total").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6), + Row("Obs").ToString(), Row("Descuento").ToString().ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(), + CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDecimal, + PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal()) Then ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.
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