This commit is contained in:
2024-04-24 21:52:57 -07:00
4 changed files with 206 additions and 71 deletions

View File

@@ -603,7 +603,7 @@
<asp:CheckBox ID="ChkRequiereTecnico" runat="server" CssClass="chksino" OnCheckedChanged="ChkRequiereTecnico_CheckedChanged" AutoPostBack="true" Text="Requiere Técnico:" Checked="false" />
</td>
<td runat="server" id="TdFechaOS1" visible="true">
<b>Fecha de Cirugia:</b>
<b>Fecha de Cirugía:</b>
</td>
<td runat="server" id="TdFechaOS2" visible="true">
<asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CausesValidation="true" CssClass="fechahora" Style="width: 130px; line-height: 22px;"></asp:TextBox>
@@ -8801,7 +8801,7 @@
<asp:CheckBox ID="ChkRequiereTecnicoModal" CssClass="chksino" runat="server" OnCheckedChanged="ChkRequiereTecnicoModal_CheckedChanged" AutoPostBack="true" Text="Requiere Técnico" />
</div>
<div class="form-group col-md-6 form-md-line-input input-iconright " runat="server" id="DvModalRequiereOSFecha" visible="false">
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="TxtFechaModal">Fecha de Cirugia:</asp:Label>
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="TxtFechaModal">Fecha de Cirugía:</asp:Label>
<asp:TextBox ID="TxtFechaModal" type="datetime-local" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 100%"></asp:TextBox>
</div>
</div>

View File

@@ -996,7 +996,7 @@ Partial Class Ventas
Private Property CveOSVentaMedica As Integer
Get
Return ViewState("CveOSVentaMedica").ToString().ToEntero()
Return IfNull(ViewState("CveOSVentaMedica"), "-1").ToString().ToEntero()
End Get
Set(value As Integer)
ViewState("CveOSVentaMedica") = value
@@ -2650,6 +2650,20 @@ Partial Class Ventas
'CargarCamiones()
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
'SI ES COTIZACION CARGAR CLIENTE PUBLICO GENERAL
If Opcion = "Cot" Then
Dim CveClientePG As Integer = -1
If UsuarioActual.CveEmpresa = 186 Then
CveClientePG = 1151377
ViewState("CveCliente") = CveClientePG
HdnCveCliente.Value = CveClientePG.ToString()
CargaCliente(CveCliente)
TrVentasMedicas2.Visible = False
TrVentasMedicas3.Visible = False
End If
End If
CargaMedicos()
CargaProcedimientos()
CargaDdlClientesSucursal()
@@ -14161,6 +14175,17 @@ Partial Class Ventas
End If
End If
If EsVentaMedica AndAlso ErrorList.Count = 0 AndAlso ObjEventos IsNot Nothing Then
Dim CveOSAgenda As Integer = -1
If Me.CveOSVentaMedica > 0 Then
CveOSAgenda = Me.CveOSVentaMedica
End If
If Not AgendarCirugia(ObjEventos, CveOSAgenda) Then
ErrorList.Add("Ocurrió un error al guardar la agenda")
End If
End If
'Contratos
If factura.CveContrato > 0 AndAlso Me.CveContratoTipo <> 33 Then
If factura.CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing") Then
@@ -37194,7 +37219,13 @@ Partial Class Ventas
item.Text = $"&nbsp {item.Text}"
Next
RegistraScript("$('#DvModalTipoVenta').modal({ backdrop: 'static', keyboard: false });")
If Opcion <> "Cot" Then
RegistraScript("$('#DvModalTipoVenta').modal({ backdrop: 'static', keyboard: false });")
Else
TrVentasMedicas2.Visible = False
TrVentasMedicas3.Visible = False
End If
End Sub
Private Sub CargaProcedimientos(Optional CveProcedimientSeleccion As Integer = -1)
@@ -38123,7 +38154,66 @@ Partial Class Ventas
End Sub
Protected Function AgendarCirugia(ByRef ObjEventos As ClsOIEventos, CveOS As Integer) As Boolean
Dim TieneError As Boolean = False
Try
If DdlMedico.SelectedValue.ToEntero() > 0 AndAlso TrVentasMedicas2.Visible AndAlso TdFechaOS1.Visible AndAlso TdFechaOS2.Visible Then
Dim FechaCirugia As DateTime = MinFecha
If TxtFechaOS.Text.Replace(",", "").ToDateTime() > MinFecha Then
FechaCirugia = TxtFechaOS.Text.Replace(",", "").ToDateTime()
If FechaCirugia > MinFecha Then
Dim CveUsuarioAgendar = -1
Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero()
If CveVendedor > 0 Then
Dim strVendedores = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvesUsuariosAsignados", $"CveVendedor = {CveVendedor}")
If strVendedores.Split(","c).Length > 0 Then
CveUsuarioAgendar = strVendedores.Split(","c)(0).ToEntero()
End If
End If
If CveUsuarioAgendar > 0 Then
Dim Asunto As String = "Cirugía"
Dim Descripcion As New StringBuilder
If DdlMedico.SelectedValue.ToEntero() > 0 Then
Descripcion.AppendFormat("Dr {0} {1}", DdlMedico.SelectedItem.Text, "<br/>")
End If
If DdlProcedimiento.SelectedValue.ToEntero() > 0 Then
Descripcion.AppendFormat("Cirugía {0} {1}", DdlProcedimiento.SelectedItem.Text, "<br/>")
End If
Descripcion.AppendFormat("Fecha de Cirugía {0} {1}", FechaCirugia.ToString("dd/MM/yyyy HH:mm"), "<br/>")
If DdlClienteSucursal.SelectedValue.ToEntero() > 0 Then
Descripcion.AppendFormat("{0} {1}", DdlClienteSucursal.SelectedItem.Text, "<br/>")
ElseIf DdlSucursalCliente.SelectedValue.ToEntero() > 0 Then
Descripcion.AppendFormat("{0} {1}", DdlSucursalCliente.SelectedItem.Text, "<br/>")
Else
Descripcion.AppendFormat("{0} {1}", Me.NombreCliente, vbCrLf)
End If
If Not ObjEventos.AddEventoAgenda(4, Asunto, Descripcion.ToString(), 3, FechaCirugia, FechaCirugia.AddHours(1), CveUsuarioAgendar, UsuarioActual.CveEmpresa, RecurrenciaTipo:=0, CveTipoEvento:=2, CveOS:=CveOS) Then
TieneError = True
End If
End If
End If
End If
End If
Catch ex As Exception
TieneError = True
OnError("Ocurrió un error al generar la agenda", ex)
End Try
Return Not TieneError
End Function