SMS Agregar OS link desde ventas, de ventas a OS
This commit is contained in:
@@ -718,39 +718,82 @@ Partial Class OS_OrdenesServicios
|
||||
Private Sub CargaVenta()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveCotizacion, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
'Carga Cliente
|
||||
|
||||
ViewState("CveCliente") = ObjVentas.DtResultados.Rows(0)("CveCliente").ToString.ToEntero
|
||||
CargaCliente(CveCliente)
|
||||
End If
|
||||
If ObjVentas.GetVentaDetalle(CveCotizacion) Then
|
||||
Dim Cons As Integer = 1
|
||||
For Each dr As DataRow In ObjVentas.DtResultados.Rows
|
||||
|
||||
|
||||
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}"
|
||||
|
||||
If dr("CveTipoPS").ToString.ToEntero = 2 Then
|
||||
drt("Consecutivo") = Cons
|
||||
drt("CveOSDetalle") = -1
|
||||
drt("CvePS") = dr("CvePS")
|
||||
drt("PS") = dr("PS")
|
||||
drt("Cantidad") = dr("Cantidad")
|
||||
drt("Observaciones") = dr("Obs")
|
||||
drt("SeFacturara") = True
|
||||
drt("SeSuperviso") = False
|
||||
drt("Archivo") = -1
|
||||
drt("CveCuentaEquipo") = "-1"
|
||||
drt("CuentaEquipoMostrar") = "Cuentas y/o Equipos"
|
||||
drt("Especificaciones") = "-1"
|
||||
drt("SeFacturara") = True
|
||||
drt("SeSuperviso") = False
|
||||
drt("Archivo") = -1
|
||||
drt("CveCuentaEquipo") = "-1"
|
||||
drt("CuentaEquipoMostrar") = ""
|
||||
drt("Especificaciones") = "-1"
|
||||
|
||||
TmpDT.Rows.Add(drt)
|
||||
Cons = Cons + 1
|
||||
Else
|
||||
TmpDT.Rows.Add(drt)
|
||||
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
|
||||
Else
|
||||
If ObjVentas.GetVentaDetalle(CveCotizacion) Then
|
||||
|
||||
Dim Cons As Integer = 1
|
||||
For Each dr As DataRow In ObjVentas.DtResultados.Rows
|
||||
Dim drt As DataRow = TmpDT.NewRow
|
||||
|
||||
If dr("CveTipoPS").ToString.ToEntero = 2 Then
|
||||
drt("Consecutivo") = Cons
|
||||
drt("CveOSDetalle") = -1
|
||||
drt("CvePS") = dr("CvePS")
|
||||
drt("PS") = dr("PS")
|
||||
drt("Cantidad") = dr("Cantidad")
|
||||
drt("Observaciones") = dr("Obs")
|
||||
drt("SeFacturara") = True
|
||||
drt("SeSuperviso") = False
|
||||
drt("Archivo") = -1
|
||||
drt("CveCuentaEquipo") = "-1"
|
||||
drt("CuentaEquipoMostrar") = "Cuentas y/o Equipos"
|
||||
drt("Especificaciones") = "-1"
|
||||
|
||||
TmpDT.Rows.Add(drt)
|
||||
Cons = Cons + 1
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
End If
|
||||
'CargaDetalle
|
||||
End If
|
||||
|
||||
@@ -380,6 +380,10 @@
|
||||
<%-- <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>
|
||||
</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>
|
||||
<Triggers>
|
||||
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />
|
||||
|
||||
@@ -3397,6 +3397,11 @@ Partial Class Ventas
|
||||
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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user