SMS Agregar OS link desde ventas, de ventas a OS

This commit is contained in:
rakcsle
2024-01-03 17:29:01 -07:00
parent f8310f2f10
commit c44c8b2010
3 changed files with 76 additions and 24 deletions

View File

@@ -718,12 +718,52 @@ Partial Class OS_OrdenesServicios
Private Sub CargaVenta() Private Sub CargaVenta()
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetVenta(CveCotizacion, UsuarioActual.CveEmpresa) Then If ObjVentas.GetVenta(CveCotizacion, UsuarioActual.CveEmpresa) Then
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
'Carga Cliente
ViewState("CveCliente") = ObjVentas.DtResultados.Rows(0)("CveCliente").ToString.ToEntero ViewState("CveCliente") = ObjVentas.DtResultados.Rows(0)("CveCliente").ToString.ToEntero
CargaCliente(CveCliente) CargaCliente(CveCliente)
End If
Dim Drow As DataRow = ObjVentas.DtResultados.Rows(0)
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
TxtDescripcion.Text = Drow("SerieFolio").ToString
TxtSolicito.Text = UsuarioActual.Nombre
DdlMedico.SelectedValueExist(Drow("CveMedico").ToString)
DdlProcedimiento.SelectedValueExist(Drow("CveProcedimiento").ToString)
DdlTipoVenta.SelectedValueExist(Drow("CveTipoVenta").ToString)
DdlSubProyecto.SelectedValueExist(Drow("CveSubProyecto").ToString)
'If dr("CveTipoPS").ToString.ToEntero = 2 Then
Dim CvePSDetalle As Integer = UsuarioActual.Empresa.Funcionalidad(708).ToEntero
Dim CodigoPS As String = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("PSCodigo", $"CvePS={CvePSDetalle}")
TxtFechaCita.Text = NowADS.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
Dim drt As DataRow = TmpDT.NewRow
drt("Consecutivo") = 1
drt("CveOSDetalle") = -1
drt("CvePS") = CvePSDetalle
drt("PS") = CodigoPS
drt("Cantidad") = 1
drt("Observaciones") = $"Venta: {Drow("SerieFolio").ToString}"
drt("SeFacturara") = True
drt("SeSuperviso") = False
drt("Archivo") = -1
drt("CveCuentaEquipo") = "-1"
drt("CuentaEquipoMostrar") = ""
drt("Especificaciones") = "-1"
TmpDT.Rows.Add(drt)
GvPS.DataSource = TmpDT
GvPS.DataBind()
Else
If ObjVentas.GetVentaDetalle(CveCotizacion) Then If ObjVentas.GetVentaDetalle(CveCotizacion) Then
Dim Cons As Integer = 1 Dim Cons As Integer = 1
For Each dr As DataRow In ObjVentas.DtResultados.Rows For Each dr As DataRow In ObjVentas.DtResultados.Rows
Dim drt As DataRow = TmpDT.NewRow Dim drt As DataRow = TmpDT.NewRow
@@ -744,7 +784,7 @@ Partial Class OS_OrdenesServicios
TmpDT.Rows.Add(drt) TmpDT.Rows.Add(drt)
Cons = Cons + 1 Cons = Cons + 1
Else
End If End If
@@ -752,6 +792,9 @@ Partial Class OS_OrdenesServicios
GvPS.DataSource = TmpDT GvPS.DataSource = TmpDT
GvPS.DataBind() GvPS.DataBind()
End If End If
End If
End If
'CargaDetalle 'CargaDetalle
End If End If

View File

@@ -380,6 +380,10 @@
<%-- <li> <%-- <li>
<asp:LinkButton ID="LnkCancelarSoloCFDI" Visible="false" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea cancelar el CFDI?" data-btn-ok-label="si" OnClick="LnkCancelarSoloCFDI_Click"><i class="fa fa-plus"></i>Cancelar solo CFDI</asp:LinkButton> <asp:LinkButton ID="LnkCancelarSoloCFDI" Visible="false" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea cancelar el CFDI?" data-btn-ok-label="si" OnClick="LnkCancelarSoloCFDI_Click"><i class="fa fa-plus"></i>Cancelar solo CFDI</asp:LinkButton>
</li>--%> </li>--%>
<li>
<asp:HyperLink ID="HLFAgregarOS" Target="_blank" runat="server" Visible="false"> <i class="fa fa-plus"></i> Agregar Orden de Servicio</asp:HyperLink>
</li>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />

View File

@@ -3397,6 +3397,11 @@ Partial Class Ventas
End If End If
End If End If
If CveVenta >= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
HLFAgregarOS.Visible = True
HLFAgregarOS.NavigateUrl = $"/OS/OrdenesServicios.aspx?CveVenta={CveVenta}"
End If
End If End If