Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -1871,6 +1871,32 @@ Public Class ClsOS
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
Public Function AddOrdenesServicioMateriales(CveOS As Integer, CvePS As Integer, Cantidad As Decimal, Serie As String, Lote As String, FechaCaducidad As Date, CveUsuario As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_OS_OrdenesServicioMaterialesAdd")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveOS", SqlDbType.Int).Value = CveOS
|
||||||
|
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||||
|
.Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad
|
||||||
|
.Add("@Serie", SqlDbType.VarChar).Value = Serie
|
||||||
|
.Add("@Lote", SqlDbType.VarChar).Value = Lote
|
||||||
|
.Add("@FechaCaducidad", SqlDbType.Date).Value = FechaCaducidad
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al guardar el material.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
'Public Function GetCveCliente(CveVenta As Integer) As Boolean
|
'Public Function GetCveCliente(CveVenta As Integer) As Boolean
|
||||||
' Dim Retorno As Boolean = False
|
' Dim Retorno As Boolean = False
|
||||||
' DataAdapter("PA_OS_ClienteGet")
|
' DataAdapter("PA_OS_ClienteGet")
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1449,8 +1449,10 @@ Namespace Modelos
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function AgregarPS(CvePS As Integer, Cantidad As Decimal, PU As Decimal, Descuento As Decimal, Obs As String,
|
Public Function AgregarPS(CvePS As Integer, Cantidad As Decimal, PU As Decimal, Descuento As Decimal, Obs As String,
|
||||||
Optional CveUM As Integer = -1, Optional CveProyecto As Integer = -1, Optional Proyecto As String = "", Optional CveSubProyecto As Integer = -1,
|
Optional CveUM As Integer = -1, Optional CveProyecto As Integer = -1, Optional Proyecto As String = "",
|
||||||
Optional SubProyecto As String = "", Optional PorcentajeIVA As Decimal = -1, Optional CuentaPredial As String = "") As Boolean
|
Optional CveSubProyecto As Integer = -1,
|
||||||
|
Optional SubProyecto As String = "", Optional PorcentajeIVA As Decimal = -1,
|
||||||
|
Optional CuentaPredial As String = "", Optional CveVentaDetallePadre As Integer = -1) As Boolean
|
||||||
|
|
||||||
If Not CvePS > 0 Then
|
If Not CvePS > 0 Then
|
||||||
Alert("Ocurrió un error al cargar la información del producto a agregar. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgError)
|
Alert("Ocurrió un error al cargar la información del producto a agregar. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgError)
|
||||||
@@ -1626,7 +1628,7 @@ Namespace Modelos
|
|||||||
Row("EntregaDirecta") = 0
|
Row("EntregaDirecta") = 0
|
||||||
'Contratos
|
'Contratos
|
||||||
Row("CveContratoDetalle") = -1
|
Row("CveContratoDetalle") = -1
|
||||||
Row("CveVentaDetalle") = -1
|
Row("CveVentaDetalle") = CveVentaDetallePadre
|
||||||
Row("CveMovimientoDetallePedido") = -1
|
Row("CveMovimientoDetallePedido") = -1
|
||||||
Row("CveOrdenCompraDetalle") = -1
|
Row("CveOrdenCompraDetalle") = -1
|
||||||
Row("CveVentaDetalleRemision") = -1
|
Row("CveVentaDetalleRemision") = -1
|
||||||
@@ -2154,7 +2156,7 @@ Namespace Modelos
|
|||||||
CveMetodoPago33:=factura.CveMetodoPago33, CveUsoCFDI:=factura.CveUsoCFDI, OrdenCompra:=factura.OrdenCompra, CveCuentaTerminal:=factura.CveCuentaTerminal, CveTipoRelacion:=factura.CveTipoRelacion, ImpuestoLocal:=TotalImpuestoLocal,
|
CveMetodoPago33:=factura.CveMetodoPago33, CveUsoCFDI:=factura.CveUsoCFDI, OrdenCompra:=factura.OrdenCompra, CveCuentaTerminal:=factura.CveCuentaTerminal, CveTipoRelacion:=factura.CveTipoRelacion, ImpuestoLocal:=TotalImpuestoLocal,
|
||||||
CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)),
|
CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)),
|
||||||
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, ServicioDomicilio:=factura.ServicioDomicilio, RFCReceptor:=RFCReceptor, EsGarantia:=factura.EsGarantia, DescripcionVenta:=factura.DescripcionVenta,
|
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, ServicioDomicilio:=factura.ServicioDomicilio, RFCReceptor:=RFCReceptor, EsGarantia:=factura.EsGarantia, DescripcionVenta:=factura.DescripcionVenta,
|
||||||
CveMedico:=factura.CveMedico, CveProcedimiento:=factura.CveProcedimiento, CveTipoVenta:=factura.CveTipoVenta) Then
|
CveMedico:=factura.CveMedico, CveProcedimiento:=factura.CveProcedimiento, CveTipoVenta:=factura.CveTipoVenta, FechaParaSurtir:=factura.FechaParaSurtir) Then
|
||||||
|
|
||||||
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||||
|
|
||||||
|
|||||||
49
Ashx/SIGDesc.ashx
Normal file
49
Ashx/SIGDesc.ashx
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<%@ WebHandler Language="VB" Class="SIGDesc" %>
|
||||||
|
|
||||||
|
Option Strict Off
|
||||||
|
Imports System.Data
|
||||||
|
Imports System.IO
|
||||||
|
Imports Extensiones
|
||||||
|
Imports Microsoft.Reporting.WebForms
|
||||||
|
Imports Newtonsoft.Json
|
||||||
|
|
||||||
|
Public Class SIGDesc : Implements IHttpHandler, IRequiresSessionState
|
||||||
|
|
||||||
|
ReadOnly Property UsuarioActual(ByVal context As HttpContext) As Usuario
|
||||||
|
Get
|
||||||
|
UsuarioActual = DirectCast(context.Session("UsuarioSIG"), Usuario)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||||
|
If context.Request("metodo") IsNot Nothing AndAlso context.Request("metodo").ToString() = "descargarPDFVenta" Then
|
||||||
|
Dim CveVenta As Integer = context.Request("CveVenta").ToEntero()
|
||||||
|
DescargarPDFVenta(context, CveVenta)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub DescargarPDFVenta(ByVal context As HttpContext, CveVenta As Integer)
|
||||||
|
Dim usuario As Usuario = UsuarioActual(context)
|
||||||
|
If Not IsNothing(usuario) Then
|
||||||
|
Dim ObjFactura As New Modelos.Factura(usuario, CveVenta, usuario.CveEmpresa, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False)
|
||||||
|
|
||||||
|
Dim ArchivoPDF = String.Format("{0}Empresas\{1}\PDF\{2}\{3}.pdf", ModExtensiones.DirectorioBaseEmpresas, usuario.CveEmpresa, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
|
||||||
|
Dim FileInfo As FileInfo = New FileInfo(ArchivoPDF)
|
||||||
|
If FileInfo.Exists Then
|
||||||
|
context.Response.ContentType = "application/pdf"
|
||||||
|
context.Response.Flush()
|
||||||
|
context.Response.WriteFile(FileInfo.FullName)
|
||||||
|
context.Response.End()
|
||||||
|
End If
|
||||||
|
FileInfo = Nothing
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
|
||||||
|
Get
|
||||||
|
Return False
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
End Class
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -86,7 +86,6 @@
|
|||||||
border: 1px solid #999999;
|
border: 1px solid #999999;
|
||||||
border-top: 0;
|
border-top: 0;
|
||||||
font-family: verdana,tahoma,helvetica;
|
font-family: verdana,tahoma,helvetica;
|
||||||
font-size: 12px;
|
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -165,14 +165,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<asp:UpdatePanel ID="UpDatosGvVentas" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpDatosGvVentas" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:GridView ID="GvVentas" ClientIDMode="Static" Width="100%" runat="server" GridLines="None" BorderWidth="0" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
<asp:GridView ID="GvVentas" ClientIDMode="Static" Width="100%" runat="server" GridLines="None" BorderWidth="0" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField HeaderText="Tipo Documento" DataField="TipoDocto" ItemStyle-Width="125px" />
|
<asp:BoundField HeaderText="Tipo Docto" DataField="TipoDocto" ItemStyle-Width="55px" />
|
||||||
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" Target="_blank" ItemStyle-Width="15%" HeaderText="SerieFolio" ControlStyle-CssClass="Texto" DataTextField="SerieFolio" />
|
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" Target="_blank" ItemStyle-Width="80px" HeaderText="SerieFolio" ControlStyle-CssClass="Texto" DataTextField="SerieFolio" />
|
||||||
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center" />
|
||||||
<asp:HyperLinkField DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="~/Ventas/Clientes.aspx?CveCliente={0}" Target="_blank" HeaderText="Cliente" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataTextField="Nombre" />
|
<asp:HyperLinkField DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="~/Ventas/Clientes.aspx?CveCliente={0}" Target="_blank" HeaderText="Cliente" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataTextField="Nombre" />
|
||||||
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="Sucursal" DataField="SubProyecto" />
|
<asp:BoundField HeaderText="Sucursal" DataField="SubProyecto" ItemStyle-Width="100px" />
|
||||||
|
<asp:BoundField HeaderText="Médico" DataField="Medico" Visible="false" />
|
||||||
|
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" Visible="false" />
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
|
|||||||
@@ -74,7 +74,16 @@ Partial Class RepNotasSinAlmacen
|
|||||||
Dim TienePermisoDesmarcar As Boolean = UsuarioActual.TienePermisoProceso(278)
|
Dim TienePermisoDesmarcar As Boolean = UsuarioActual.TienePermisoProceso(278)
|
||||||
GvVentas.Columns(5).Visible = TienePermisoImportes
|
GvVentas.Columns(5).Visible = TienePermisoImportes
|
||||||
GvCompras.Columns(4).Visible = TienePermisoImportes
|
GvCompras.Columns(4).Visible = TienePermisoImportes
|
||||||
GvCompras.Columns(5).Visible = TienePermisoDesmarcar
|
GvCompras.Columns(5).Visible = TienePermisoDesmarcar
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then ' es empresa hospitalaria
|
||||||
|
GvVentas.Columns(3).HeaderText = "Hospital"
|
||||||
|
GvVentas.Columns(6).Visible = True
|
||||||
|
GvVentas.Columns(7).Visible = True
|
||||||
|
CType(GvVentas.Columns(2), BoundField).DataFormatString = "{0:dd/MM/yyyy HH:mm}"
|
||||||
|
CType(GvVentas.Columns(2), BoundField).ItemStyle.Width = Unit.Pixel(120)
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaCombos()
|
Private Sub CargaCombos()
|
||||||
TxtFechaF.Text = NowADS().ToShortDateString
|
TxtFechaF.Text = NowADS().ToShortDateString
|
||||||
@@ -88,18 +97,10 @@ Partial Class RepNotasSinAlmacen
|
|||||||
DdlProveedor.setEsWebService(True)
|
DdlProveedor.setEsWebService(True)
|
||||||
DdlProveedor.Attributes.Add("data-metodo", "getproveedores")
|
DdlProveedor.Attributes.Add("data-metodo", "getproveedores")
|
||||||
DdlProveedor.SelectedText = "Todos"
|
DdlProveedor.SelectedText = "Todos"
|
||||||
DdlProveedor.SelectedValue = "-1"
|
DdlProveedor.SelectedValue = "-1"
|
||||||
|
|
||||||
'DdlSucursal.DataSource = GlobalDTSucursales(UsuarioActual.CveEmpresa)
|
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto)
|
||||||
'DdlSucursal.DataBind()
|
|
||||||
|
|
||||||
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto)
|
|
||||||
'DdlSubProyecto.Items.Clear()
|
|
||||||
'DdlSubProyecto.SelectedValue = Nothing
|
|
||||||
'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1)
|
|
||||||
'DdlSubProyecto.DataBind()
|
|
||||||
|
|
||||||
'DdlSubProyecto.Items.Insert(0, New ListItem("Sin SubProyecto Asignado", "-1"))
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
||||||
@@ -131,13 +132,8 @@ Partial Class RepNotasSinAlmacen
|
|||||||
GvVentas.DataSource = Nothing
|
GvVentas.DataSource = Nothing
|
||||||
End If
|
End If
|
||||||
|
|
||||||
GvVentas.DataBind()
|
GvVentas.DataBind()
|
||||||
|
|
||||||
'If (GvVentas.Rows.Count > 0) Then
|
|
||||||
' GvVentas.UseAccessibleHeader = True
|
|
||||||
' GvVentas.HeaderRow.TableSection = TableRowSection.TableHeader
|
|
||||||
' RegistraScript("OrdenarGvVentas();")
|
|
||||||
'End If
|
|
||||||
Else
|
Else
|
||||||
'Compras
|
'Compras
|
||||||
If Not DdlProveedor.SelectedValue.ToEntero > 0 Then
|
If Not DdlProveedor.SelectedValue.ToEntero > 0 Then
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ Imports Telerik.Web.UI
|
|||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports Stimulsoft.Report.StiOptions.Export
|
Imports Stimulsoft.Report.StiOptions.Export
|
||||||
Imports Modelos
|
Imports Modelos
|
||||||
|
Imports System.Runtime.InteropServices.ComTypes
|
||||||
|
Imports APP_Code_CSharp
|
||||||
|
|
||||||
Partial Class OS_OrdenesServicios
|
Partial Class OS_OrdenesServicios
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -372,8 +374,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
'CargaEstatusOS()
|
'CargaEstatusOS()
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
'PermisosSegunEstatus()
|
'PermisosSegunEstatus()
|
||||||
CargaDetalles()
|
|
||||||
CargaMateriales()
|
|
||||||
|
|
||||||
DivSeFactura.Visible = True
|
DivSeFactura.Visible = True
|
||||||
BtnGuardar.Text = "Guardar Cambios"
|
BtnGuardar.Text = "Guardar Cambios"
|
||||||
@@ -670,7 +671,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
' End If
|
' End If
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
ElseIf TipoEstatus = 4 Then
|
ElseIf TipoEstatus = 4 AndAlso Not UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
||||||
'DisableAll()
|
'DisableAll()
|
||||||
If SeFacturara = "True" Then
|
If SeFacturara = "True" Then
|
||||||
HplFacturar.Visible = True
|
HplFacturar.Visible = True
|
||||||
@@ -704,7 +705,8 @@ Partial Class OS_OrdenesServicios
|
|||||||
|
|
||||||
CargaEventoBitacora()
|
CargaEventoBitacora()
|
||||||
CargaHistorial()
|
CargaHistorial()
|
||||||
|
CargaDetalles()
|
||||||
|
CargaMateriales()
|
||||||
|
|
||||||
If TipoEstatus.Contiene(1, 2, 3) Then
|
If TipoEstatus.Contiene(1, 2, 3) Then
|
||||||
LnkAccionesMaterialUtilizado.Visible = True
|
LnkAccionesMaterialUtilizado.Visible = True
|
||||||
@@ -2955,6 +2957,20 @@ Partial Class OS_OrdenesServicios
|
|||||||
LnkModalMaterialUtilizado.Visible = True
|
LnkModalMaterialUtilizado.Visible = True
|
||||||
DTSolicitudDev = New DataTable
|
DTSolicitudDev = New DataTable
|
||||||
Dim Opcion As Integer = If(DdlTipoVenta.SelectedValue.Contiene("2", "3"), 2, 1)
|
Dim Opcion As Integer = If(DdlTipoVenta.SelectedValue.Contiene("2", "3"), 2, 1)
|
||||||
|
|
||||||
|
|
||||||
|
Select Case DdlTipoVenta.SelectedValue.ToEntero
|
||||||
|
Case 2, 3
|
||||||
|
Opcion = 2
|
||||||
|
Exit Select
|
||||||
|
Case 5
|
||||||
|
Opcion = 3
|
||||||
|
Exit Select
|
||||||
|
Case Else
|
||||||
|
Opcion = 1
|
||||||
|
Exit Select
|
||||||
|
End Select
|
||||||
|
|
||||||
Dim ObjOS As New ClsOS
|
Dim ObjOS As New ClsOS
|
||||||
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, Opcion, UsuarioActual.CveEmpresa) Then
|
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, Opcion, UsuarioActual.CveEmpresa) Then
|
||||||
DTSolicitudDev = ObjOS.DtResultados
|
DTSolicitudDev = ObjOS.DtResultados
|
||||||
@@ -2996,176 +3012,228 @@ Partial Class OS_OrdenesServicios
|
|||||||
Dim CveVentaPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveVenta").ToEntero
|
Dim CveVentaPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveVenta").ToEntero
|
||||||
Dim CveAlmacenDestino As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 10).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {CveSubProyectoPedido}").ToEntero
|
Dim CveAlmacenDestino As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 10).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {CveSubProyectoPedido}").ToEntero
|
||||||
|
|
||||||
If Not CveAlmacenDestino > 0 Then
|
If DdlTipoVenta.SelectedValue.ToEntero = 5 Then
|
||||||
Alert("No se encontró almacen de entrega por adelantado", TipoMensaje.MsgAdvertencia)
|
Dim TotalSeleccionado As Decimal = 0
|
||||||
Exit Sub
|
|
||||||
|
For Each GVRow As GridViewRow In GvMU.Rows
|
||||||
|
TotalSeleccionado = TotalSeleccionado + GVRow.FCTextBox("TxtUtilizado").Text.ToDecimal
|
||||||
|
Next
|
||||||
|
|
||||||
|
If TotalSeleccionado = 0 Then
|
||||||
|
Alert("No se selecciono ningun material", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
|
||||||
|
If Not CveAlmacenDestino > 0 Then
|
||||||
|
Alert("No se encontró almacen de entrega por adelantado", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim ProcesoOK As Boolean = True
|
Dim ProcesoOK As Boolean = True
|
||||||
Dim ObjV As New ClsVentas
|
Dim ObjV As New ClsVentas
|
||||||
Dim ClsOS As New ClsOS(ObjV.IniciaTransacSQL())
|
Dim ObjOS As New ClsOS(ObjV.IniciaTransacSQL())
|
||||||
Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL())
|
Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL())
|
||||||
Dim ObjConta As New ClsContabilidad(ObjV.IniciaTransacSQL())
|
Dim ObjConta As New ClsContabilidad(ObjV.IniciaTransacSQL())
|
||||||
|
|
||||||
Dim GenrarRemisionMovimientos As Boolean = False
|
Dim GenrarRemisionMovimientos As Boolean = False
|
||||||
If ProcesoOK Then
|
|
||||||
Dim AplicaDevolucion As Boolean = False
|
|
||||||
For Each GvRow As GridViewRow In GvMU.Rows
|
|
||||||
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
|
|
||||||
Dim CantidadDev As Decimal = GvRow.DataKey("Cantidad").ToDecimal - GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal
|
|
||||||
|
|
||||||
If CantidadDev > 0 Then
|
If DdlTipoVenta.SelectedValue.ToEntero = 5 Then
|
||||||
AplicaDevolucion = True
|
|
||||||
If Not ObjV.UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle, CantidadDev) Then
|
For Each GVRow As GridViewRow In GvMU.Rows
|
||||||
|
Dim CantidadRegistro As Decimal = GVRow.FCTextBox("TxtUtilizado").Text.ToDecimal
|
||||||
|
Dim CvePS As Integer = GVRow.DataKey("CvePS").ToEntero
|
||||||
|
|
||||||
|
If CantidadRegistro > 0 Then
|
||||||
|
|
||||||
|
Dim Serie As String = If(GVRow.DataKey("Serie") = "", "-1", GVRow.DataKey("Serie"))
|
||||||
|
Dim Lote As String = If(GVRow.DataKey("Lote") = "", "-1", GVRow.DataKey("Lote"))
|
||||||
|
Dim FechaCaducidad As DateTime = If(GVRow.DataKey("FechaCaducidad") = "", MinFecha, GVRow.DataKey("FechaCaducidad").ToDate)
|
||||||
|
If Not ObjOS.AddOrdenesServicioMateriales(CveOS, CvePS, CantidadRegistro, Serie, Lote, FechaCaducidad, UsuarioActual.CveUsuario) Then
|
||||||
|
Alert("Ocurrió un error al guardar el material.", TipoMensaje.MsgAdvertencia)
|
||||||
ProcesoOK = False
|
ProcesoOK = False
|
||||||
GenrarRemisionMovimientos = False
|
|
||||||
AplicaDevolucion = False
|
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal > 0 Then
|
|
||||||
GenrarRemisionMovimientos = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
If AplicaDevolucion Then
|
If ProcesoOK Then
|
||||||
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then
|
Dim CveOSEstatusFinalizada As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 4").ToEntero
|
||||||
|
If CveOSEstatusFinalizada > 0 Then
|
||||||
|
If Not ObjOS.UpdateOrdenesServiciosEstatus(CveOSEstatusFinalizada, UsuarioActual.CveUsuario, CveOS) Then
|
||||||
|
ProcesoOK = False
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Alert("No se pudo obtener el estado para finalizar la orden de servicio.")
|
||||||
ProcesoOK = False
|
ProcesoOK = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
Else
|
||||||
Dim Respuesta As New RespuestaFacturacion()
|
If ProcesoOK Then
|
||||||
Dim DtVentaDetalle As New DataTable
|
Dim AplicaDevolucion As Boolean = False
|
||||||
Dim CveMovimientoSalida, CveMovimientoEntrada As Integer
|
|
||||||
Dim ImporteAlmacen As Decimal
|
|
||||||
Dim Fecha As DateTime = ClsPaginas.NowADS()
|
|
||||||
|
|
||||||
If GenrarRemisionMovimientos AndAlso ProcesoOK Then
|
|
||||||
Respuesta = GeneraRemision(CveVentaPedido, ObjV.IniciaTransacSQL())
|
|
||||||
|
|
||||||
If Respuesta.CveVenta > 0 Then
|
|
||||||
If ObjV.GetVentaDetalle(Respuesta.CveVenta) Then
|
|
||||||
Dim dtClon As DataTable = ObjV.DtResultados.Copy
|
|
||||||
dtClon.DefaultView.Sort = "CveVentaDetalle ASC"
|
|
||||||
DtVentaDetalle = dtClon.DefaultView.ToTable()
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
ProcesoOK = False
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If GenrarRemisionMovimientos AndAlso ProcesoOK Then
|
|
||||||
|
|
||||||
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenActual, 8, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Respuesta.CveVenta, CveSubProyectoPedido, -1, CveOS:=CveOS, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="OS/MatUtil")
|
|
||||||
Dim Folio As Integer = ObjInventario.Folio
|
|
||||||
|
|
||||||
If CveMovimientoSalida > 0 Then
|
|
||||||
|
|
||||||
Dim IndexMov1 As Integer = 0
|
|
||||||
For Each GvRow As GridViewRow In GvMU.Rows
|
For Each GvRow As GridViewRow In GvMU.Rows
|
||||||
|
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
|
||||||
|
Dim CantidadDev As Decimal = GvRow.DataKey("Cantidad").ToDecimal - GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal
|
||||||
|
|
||||||
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
|
If CantidadDev > 0 Then
|
||||||
Dim CantidadRegistro As Decimal = GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal
|
AplicaDevolucion = True
|
||||||
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
If Not ObjV.UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle, CantidadDev) Then
|
||||||
Dim CveUM As Integer = GvRow.DataKey("CveUM").ToEntero
|
|
||||||
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
|
|
||||||
|
|
||||||
If CantidadRegistro > 0 Then
|
|
||||||
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero ' DtVentaDetalle.Rows(IndexMov1)("CveVentaDetalle").ToString.ToEntero
|
|
||||||
Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
|
||||||
|
|
||||||
Dim Serie As String = GvRow.DataKey("Serie")
|
|
||||||
Dim Lote As String = GvRow.DataKey("Lote")
|
|
||||||
Dim FechaCaducidad As DateTime = GvRow.DataKey("FechaCaducidad").ToDate
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadRegistro, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
|
|
||||||
Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia)
|
|
||||||
ProcesoOK = False
|
ProcesoOK = False
|
||||||
|
GenrarRemisionMovimientos = False
|
||||||
|
AplicaDevolucion = False
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
IndexMov1 = IndexMov1 + 1
|
|
||||||
|
If GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal > 0 Then
|
||||||
|
GenrarRemisionMovimientos = True
|
||||||
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
If AplicaDevolucion Then
|
||||||
|
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then
|
||||||
|
ProcesoOK = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Dim Respuesta As New RespuestaFacturacion()
|
||||||
|
Dim DtVentaDetalle As New DataTable
|
||||||
|
Dim CveMovimientoSalida, CveMovimientoEntrada As Integer
|
||||||
|
Dim ImporteAlmacen As Decimal
|
||||||
|
Dim Fecha As DateTime = ClsPaginas.NowADS()
|
||||||
|
|
||||||
If ProcesoOK Then
|
If GenrarRemisionMovimientos AndAlso ProcesoOK Then
|
||||||
|
Respuesta = GeneraRemision(CveVentaPedido, ObjV.IniciaTransacSQL())
|
||||||
|
|
||||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Respuesta.CveVenta, CveSubProyectoPedido, -1, CveOS:=CveOS, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="OS/MatUtil2")
|
If Respuesta.CveVenta > 0 Then
|
||||||
|
If ObjV.GetVentaDetalle(Respuesta.CveVenta) Then
|
||||||
|
Dim dtClon As DataTable = ObjV.DtResultados.Copy
|
||||||
|
dtClon.DefaultView.Sort = "CveVentaDetalle ASC"
|
||||||
|
DtVentaDetalle = dtClon.DefaultView.ToTable()
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ProcesoOK = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
If GenrarRemisionMovimientos AndAlso ProcesoOK Then
|
||||||
ImporteAlmacen = ObjInventario.DtResultados.SUM("Total")
|
|
||||||
Dim IndexMov2 As Integer = 0
|
|
||||||
For Each dRow As DataRow In ObjInventario.DtResultados.Rows
|
|
||||||
|
|
||||||
Dim Cantidad As Decimal = dRow("Cantidad").ToString.ToDecimal
|
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenActual, 8, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Respuesta.CveVenta, CveSubProyectoPedido, -1, CveOS:=CveOS, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="OS/MatUtil")
|
||||||
Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
|
Dim Folio As Integer = ObjInventario.Folio
|
||||||
Dim CveUM As Integer = dRow("CveUM").ToString.ToEntero
|
|
||||||
Dim PU As Decimal = dRow("PU").ToString.ToDecimal
|
|
||||||
Dim CveVentaDetalle As Integer = dRow("CveVentaDetalle").ToString.ToEntero
|
|
||||||
Dim CveMovimientoDetalle As Integer = dRow("CveMovimientoDetalle").ToString.ToEntero
|
|
||||||
|
|
||||||
Dim Lote As String = dRow("Lote").ToString
|
If CveMovimientoSalida > 0 Then
|
||||||
Dim Serie As String = dRow("Serie").ToString
|
|
||||||
Dim FechaCaducidad As DateTime = dRow("FechaCaducidad").ToString.ToDateTime
|
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
|
Dim IndexMov1 As Integer = 0
|
||||||
|
For Each GvRow As GridViewRow In GvMU.Rows
|
||||||
|
|
||||||
|
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
|
||||||
|
Dim CantidadRegistro As Decimal = GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal
|
||||||
|
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
||||||
|
Dim CveUM As Integer = GvRow.DataKey("CveUM").ToEntero
|
||||||
|
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
|
||||||
|
|
||||||
|
If CantidadRegistro > 0 Then
|
||||||
|
Dim CveVentaDetalle As Integer = DtVentaDetalle.FiltroPrimeroValor("CveVentaDetalle", $"CveVentaDetallePadre = {GvRow.DataKey("CveVentaDetalle")}").ToEntero
|
||||||
|
Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
||||||
|
|
||||||
|
Dim Serie As String = GvRow.DataKey("Serie")
|
||||||
|
Dim Lote As String = GvRow.DataKey("Lote")
|
||||||
|
Dim FechaCaducidad As DateTime = GvRow.DataKey("FechaCaducidad").ToDate
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadRegistro, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
|
||||||
Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia)
|
Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia)
|
||||||
ProcesoOK = False
|
ProcesoOK = False
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
IndexMov2 = IndexMov2 + 1
|
End If
|
||||||
Next
|
IndexMov1 = IndexMov1 + 1
|
||||||
If ProcesoOK Then
|
Next
|
||||||
Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL)
|
|
||||||
Dim LigaVenta As String = String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoEntrada, Folio, "Material utilizado")
|
|
||||||
|
|
||||||
If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=Respuesta.CveVenta, CveOS:=CveOS) Then
|
If ProcesoOK Then
|
||||||
|
|
||||||
|
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Respuesta.CveVenta, CveSubProyectoPedido, -1, CveOS:=CveOS, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="OS/MatUtil2")
|
||||||
|
|
||||||
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||||
|
ImporteAlmacen = ObjInventario.DtResultados.SUM("Total")
|
||||||
|
Dim IndexMov2 As Integer = 0
|
||||||
|
For Each dRow As DataRow In ObjInventario.DtResultados.Rows
|
||||||
|
|
||||||
|
Dim Cantidad As Decimal = dRow("Cantidad").ToString.ToDecimal
|
||||||
|
Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
|
||||||
|
Dim CveUM As Integer = dRow("CveUM").ToString.ToEntero
|
||||||
|
Dim PU As Decimal = dRow("PU").ToString.ToDecimal
|
||||||
|
Dim CveVentaDetalle As Integer = dRow("CveVentaDetalle").ToString.ToEntero
|
||||||
|
Dim CveMovimientoDetalle As Integer = dRow("CveMovimientoDetalle").ToString.ToEntero
|
||||||
|
|
||||||
|
Dim Lote As String = dRow("Lote").ToString
|
||||||
|
Dim Serie As String = dRow("Serie").ToString
|
||||||
|
Dim FechaCaducidad As DateTime = dRow("FechaCaducidad").ToString.ToDateTime
|
||||||
|
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
|
||||||
|
Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia)
|
||||||
|
ProcesoOK = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
IndexMov2 = IndexMov2 + 1
|
||||||
|
Next
|
||||||
|
If ProcesoOK Then
|
||||||
|
Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL)
|
||||||
|
Dim LigaVenta As String = String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoEntrada, Folio, "Material utilizado")
|
||||||
|
|
||||||
|
If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=Respuesta.CveVenta, CveOS:=CveOS) Then
|
||||||
|
ProcesoOK = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ProcesoOK = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If ProcesoOK Then
|
||||||
|
If Not ObjOS.UpdateOrdenesServiciosFinaliza(CveOS, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||||
|
ProcesoOK = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If ProcesoOK Then
|
||||||
|
Dim Contabilizable As Boolean = False
|
||||||
|
Dim Concepto As String = "Material utilizado"
|
||||||
|
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("OS-MatUtil", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
If CveMovimientoSalida > 0 Then
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAlmacen, ImporteAlmacen, 68, "", Concepto, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable) Then
|
||||||
ProcesoOK = False
|
ProcesoOK = False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Else
|
If CveMovimientoEntrada > 0 Then
|
||||||
ProcesoOK = False
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteAlmacen, ImporteAlmacen, 68, "", Concepto, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable) Then
|
||||||
End If
|
ProcesoOK = False
|
||||||
End If
|
End If
|
||||||
If ProcesoOK Then
|
|
||||||
If Not ClsOS.UpdateOrdenesServiciosFinaliza(CveOS, -1, -1, UsuarioActual.CveEmpresa) Then
|
|
||||||
ProcesoOK = False
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
If ProcesoOK Then
|
|
||||||
Dim Contabilizable As Boolean = False
|
|
||||||
Dim Concepto As String = "Material utilizado"
|
|
||||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("OS-MatUtil", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
||||||
If CveMovimientoSalida > 0 Then
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAlmacen, ImporteAlmacen, 68, "", Concepto, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable) Then
|
|
||||||
ProcesoOK = False
|
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
If CveMovimientoEntrada > 0 Then
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteAlmacen, ImporteAlmacen, 68, "", Concepto, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable) Then
|
|
||||||
ProcesoOK = False
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ProcesoOK = False
|
||||||
End If
|
End If
|
||||||
Else
|
|
||||||
ProcesoOK = False
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If ProcesoOK Then
|
If ProcesoOK Then
|
||||||
ObjV.Commit()
|
|
||||||
|
|
||||||
If GenrarRemisionMovimientos = False Then
|
ObjV.Commit()
|
||||||
Alert("El material sera recibido en almacén.")
|
If DdlTipoVenta.SelectedValue.ToEntero = 5 Then
|
||||||
|
Dim Liga As String = $" document.location.href=""/OS/OrdenesServicios.aspx?CveOS={CveOS}""; "
|
||||||
|
Alert("El material utilizado se guardó correctamente", TipoMensaje.MsgInformacion, Liga)
|
||||||
Else
|
Else
|
||||||
Alert("El material utilizado se guardó correctamente")
|
If GenrarRemisionMovimientos = False Then
|
||||||
|
Alert("El material sera recibido en almacén.")
|
||||||
|
Else
|
||||||
|
Alert("El material utilizado se guardó correctamente")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
RegistraScript("$('#DivModalMaterialUtilizado').modal('hide');")
|
RegistraScript("$('#DivModalMaterialUtilizado').modal('hide');")
|
||||||
Else
|
Else
|
||||||
ObjV.RollBack()
|
ObjV.RollBack()
|
||||||
Alert("El material utilizado no se guardó correctamente", TipoMensaje.MsgAdvertencia)
|
Alert("Se presento un error al guardar el material", TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjV.Dispose()
|
ObjV.Dispose()
|
||||||
@@ -3194,6 +3262,9 @@ Partial Class OS_OrdenesServicios
|
|||||||
ObjFactura.CveMedico = DdlMedico.SelectedValue.ToEntero
|
ObjFactura.CveMedico = DdlMedico.SelectedValue.ToEntero
|
||||||
ObjFactura.CveProcedimiento = DdlProcedimiento.SelectedValue.ToEntero
|
ObjFactura.CveProcedimiento = DdlProcedimiento.SelectedValue.ToEntero
|
||||||
ObjFactura.CveTipoVenta = DdlTipoVenta.SelectedValue.ToEntero
|
ObjFactura.CveTipoVenta = DdlTipoVenta.SelectedValue.ToEntero
|
||||||
|
ObjFactura.FechaParaSurtir = TxtFechaCita.Text.ToDateTime
|
||||||
|
ObjFactura.CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero
|
||||||
|
ObjFactura.CveVentaRelacion = CveVentaPedido
|
||||||
|
|
||||||
For Each GvRow As GridViewRow In GvMU.Rows
|
For Each GvRow As GridViewRow In GvMU.Rows
|
||||||
|
|
||||||
@@ -3204,7 +3275,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
Dim Obs As String = GvRow.DataKey("Observaciones")
|
Dim Obs As String = GvRow.DataKey("Observaciones")
|
||||||
|
|
||||||
If CantidadRegistro > 0 Then
|
If CantidadRegistro > 0 Then
|
||||||
If Not ObjFactura.AgregarPS(CvePS, CantidadRegistro, PU, Descuento, Obs, CveSubProyecto:=CveSubProyectoPedido) Then
|
If Not ObjFactura.AgregarPS(CvePS, CantidadRegistro, PU, Descuento, Obs, CveSubProyecto:=CveSubProyectoPedido, CveVentaDetallePadre:=GvRow.DataKey("CveVentaDetalle").ToEntero) Then
|
||||||
Alert("Error al agregar producto", TipoMensaje.MsgAdvertencia)
|
Alert("Error al agregar producto", TipoMensaje.MsgAdvertencia)
|
||||||
ProcesoOK = False
|
ProcesoOK = False
|
||||||
Exit For
|
Exit For
|
||||||
|
|||||||
@@ -5732,7 +5732,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div style="width: 200px; display: inline-block;">
|
<div style="width: 200px; display: inline-block;">
|
||||||
<div class="form-group form-md-line-input">
|
<div class="form-group form-md-line-input">
|
||||||
<asp:TextBox ID="TxtFechamodIMSS" CssClass="form-control" runat="server"></asp:TextBox>
|
<asp:TextBox ID="TxtFechamodIMSSSalario" CssClass="form-control" runat="server"></asp:TextBox>
|
||||||
<asp:Label runat="server" AssociatedControlID="TxtFechamodIMSSSalario">Fecha:</asp:Label>
|
<asp:Label runat="server" AssociatedControlID="TxtFechamodIMSSSalario">Fecha:</asp:Label>
|
||||||
<ajax:MaskedEditExtender ID="MEETxtFechamodIMSSS" runat="server" TargetControlID="TxtFechamodIMSSSalario" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
<ajax:MaskedEditExtender ID="MEETxtFechamodIMSSS" runat="server" TargetControlID="TxtFechamodIMSSSalario" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
<ajax:CalendarExtender runat="server" ID="CEETxtFechamodIMSSS" TargetControlID="TxtFechamodIMSSSalario" PopupButtonID="LnkFechaModImssSalario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
<ajax:CalendarExtender runat="server" ID="CEETxtFechamodIMSSS" TargetControlID="TxtFechamodIMSSSalario" PopupButtonID="LnkFechaModImssSalario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
@@ -5751,19 +5751,20 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="form-group form-md-line-input">
|
<div class="form-group form-md-line-input">
|
||||||
<asp:TextBox ID="TxtMImssSalarioDiarioImSS" Enabled="false" CssClass="form-control" runat="server"></asp:TextBox>
|
<asp:TextBox ID="TxtMImssSalarioDiarioImSS" CssClass="form-control" runat="server"></asp:TextBox>
|
||||||
<asp:Label runat="server" AssociatedControlID="TxtMImssSalarioDiarioImSS">Salario diario(IMSS):</asp:Label>
|
<asp:Label runat="server" AssociatedControlID="TxtMImssSalarioDiarioImSS">Salario diario(IMSS):</asp:Label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group form-md-line-input">
|
||||||
|
<asp:TextBox ID="TxtMImssSDI" CssClass="form-control" runat="server"></asp:TextBox>
|
||||||
|
<asp:Label runat="server" AssociatedControlID="TxtMImssSDI">Salario Diario Integrado(SDI):</asp:Label>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
|
|
||||||
<ContentTemplate>
|
|
||||||
<asp:LinkButton ID="LnkModificarSalarioIMSSGuardar" OnClick="LnkModificarSalarioIMSSGuardar_Click" ValidationGroup="GrpGuardarModSalarioIMSS" CssClass="btn btn-primary" runat="server">Guardar</asp:LinkButton>
|
<asp:LinkButton ID="LnkModificarSalarioIMSSGuardar" OnClick="LnkModificarSalarioIMSSGuardar_Click" ValidationGroup="GrpGuardarModSalarioIMSS" CssClass="btn btn-primary" runat="server">Guardar</asp:LinkButton>
|
||||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||||
</ContentTemplate>
|
|
||||||
</asp:UpdatePanel>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
|
|||||||
@@ -1142,11 +1142,11 @@ Partial Class RH_Personal
|
|||||||
tdCliente2.Visible = True
|
tdCliente2.Visible = True
|
||||||
GVAsistencia.Columns(1).Visible = True
|
GVAsistencia.Columns(1).Visible = True
|
||||||
End If
|
End If
|
||||||
|
'no sedeben habilitar ya que solo son informativos
|
||||||
If UsuarioActual.TienePermisoProceso(372) Then
|
'If UsuarioActual.TienePermisoProceso(372) Then
|
||||||
TxtSalarioDiarioImSS.Enabled = True
|
' TxtSalarioDiarioImSS.Enabled = True
|
||||||
TxtSalarioDiarioIntegrado.Enabled = True
|
' TxtSalarioDiarioIntegrado.Enabled = True
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub SetPermisos()
|
Private Sub SetPermisos()
|
||||||
@@ -6961,7 +6961,7 @@ Partial Class RH_Personal
|
|||||||
Dim DiasVacaciones As Decimal = TxtFIDiasVacaciones.Text.ToDecimal()
|
Dim DiasVacaciones As Decimal = TxtFIDiasVacaciones.Text.ToDecimal()
|
||||||
Dim diasaguinaldo As Decimal = TxtFIAguinaldo.Text.ToDecimal()
|
Dim diasaguinaldo As Decimal = TxtFIAguinaldo.Text.ToDecimal()
|
||||||
Dim FI As Decimal = (365D + diasaguinaldo + (DiasVacaciones * (primav / 100D))) / 365D
|
Dim FI As Decimal = (365D + diasaguinaldo + (DiasVacaciones * (primav / 100D))) / 365D
|
||||||
Dim SDI As Decimal = (SD * FI)
|
Dim SDI As Decimal = Math.Round((SD * FI), 2)
|
||||||
TxtFactordeIntegracion.Text = FI.ToString()
|
TxtFactordeIntegracion.Text = FI.ToString()
|
||||||
TxtFISalarioDiarioIntegrado.Text = String.Format("{0:###0.########}", SDI)
|
TxtFISalarioDiarioIntegrado.Text = String.Format("{0:###0.########}", SDI)
|
||||||
UpFactordeintegracion.Update()
|
UpFactordeintegracion.Update()
|
||||||
@@ -7044,15 +7044,18 @@ Partial Class RH_Personal
|
|||||||
|
|
||||||
Using ObjPersonal As ClsRH = New ClsRH()
|
Using ObjPersonal As ClsRH = New ClsRH()
|
||||||
ObjPersonal.IniciaTransacSQL()
|
ObjPersonal.IniciaTransacSQL()
|
||||||
If ObjPersonal.UpdateSalarios(CvePersonal, TxtFechamodIMSS.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
If ObjPersonal.UpdateSalarios(CvePersonal, TxtFechamodIMSSSalario.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||||
TxtSalarioDiario.Text.ToDecimal(), TxtSDI.Text.ToDecimal(), TxtMImssSalarioDiarioImSS.Text.ToDecimal(),
|
TxtSalarioDiario.Text.ToDecimal(), TxtMImssSDI.Text.ToDecimal(), TxtMImssSalarioDiarioImSS.Text.ToDecimal(), -1) Then
|
||||||
TxtSalarioDiario.Text.ToDecimal()) Then
|
|
||||||
|
|
||||||
|
|
||||||
ObjPersonal.Commit()
|
ObjPersonal.Commit()
|
||||||
|
|
||||||
|
RegistraScript("$('#DmodamodificarsalarioIMSS').modal('hide')")
|
||||||
TxtSalarioCotizado.Text = TxtMImssSalarioDiarioImSS.Text
|
TxtSalarioCotizado.Text = TxtMImssSalarioDiarioImSS.Text
|
||||||
|
TxtSDI.Text = TxtMImssSDI.Text
|
||||||
|
Dim sdi As Decimal = TxtSDI.Text.ToDecimal()
|
||||||
|
Dim sbc As Decimal = TxtMImssSalarioDiarioImSS.Text.ToDecimal()
|
||||||
|
salarioVariable = If(sbc > sdi, sbc - sdi, 0)
|
||||||
UpModSalario.Update()
|
UpModSalario.Update()
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
Alert("Se ha actualizado el salario", TipoMensaje.ToastInformacion)
|
Alert("Se ha actualizado el salario", TipoMensaje.ToastInformacion)
|
||||||
@@ -7063,8 +7066,9 @@ Partial Class RH_Personal
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub LnkModsalarioIMSS_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkModsalarioIMSS_Click(sender As Object, e As EventArgs)
|
||||||
|
TxtFechamodIMSSSalario.Text = NowADS().ToString("dd/MM/yyyy")
|
||||||
TxtMImssSalarioDiarioImSS.Text = TxtSalarioCotizado.Text
|
TxtMImssSalarioDiarioImSS.Text = TxtSalarioCotizado.Text
|
||||||
|
TxtMImssSDI.Text = TxtSDI.Text
|
||||||
RegistraScript("$('#DmodamodificarsalarioIMSS').modal()")
|
RegistraScript("$('#DmodamodificarsalarioIMSS').modal()")
|
||||||
UpModSalarioIMSS.Update()
|
UpModSalarioIMSS.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
1
Scripts/PrintJS/print.min.css
vendored
Normal file
1
Scripts/PrintJS/print.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.printModal{font-family:sans-serif;display:flex;text-align:center;font-weight:300;font-size:30px;left:0;top:0;position:absolute;color:#045fb4;width:100%;height:100%;background-color:hsla(0,0%,100%,.9)}.printClose{position:absolute;right:10px;top:10px}.printClose:before{content:"\00D7";font-family:Helvetica Neue,sans-serif;font-weight:100;line-height:1px;padding-top:.5em;display:block;font-size:2em;text-indent:1px;overflow:hidden;height:1.25em;width:1.25em;text-align:center;cursor:pointer}.printSpinner{margin-top:3px;margin-left:-40px;position:absolute;display:inline-block;width:25px;height:25px;border:2px solid #045fb4;border-radius:50%;animation:spin .75s linear infinite}.printSpinner:after,.printSpinner:before{left:-2px;top:-2px;display:none;position:absolute;content:"";width:inherit;height:inherit;border:inherit;border-radius:inherit}.printSpinner,.printSpinner:after,.printSpinner:before{display:inline-block;border-color:#045fb4 transparent transparent;animation-duration:1.2s}.printSpinner:before{transform:rotate(120deg)}.printSpinner:after{transform:rotate(240deg)}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}
|
||||||
1
Scripts/PrintJS/print.min.js
vendored
Normal file
1
Scripts/PrintJS/print.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -25,6 +25,7 @@
|
|||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css" />
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css" />
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700;800" rel="stylesheet"/>
|
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700;800" rel="stylesheet"/>
|
||||||
<link href="/Metronic/fontawesome6/css/all.min.css" rel="stylesheet" type="text/css" />
|
<link href="/Metronic/fontawesome6/css/all.min.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="/Scripts/PrintJS/print.min.css"/>
|
||||||
<%-- <link href="/Metronic/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
|
<%-- <link href="/Metronic/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
|
||||||
<link href="/Metronic/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
<link href="/Metronic/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
||||||
<link href="/Metronic/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />--%>
|
<link href="/Metronic/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />--%>
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:TextBox ID="TxtProcedimiento" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
<asp:TextBox ID="TxtProcedimiento" CssClass="form-control" runat="server" MaxLength="150"></asp:TextBox>
|
||||||
<asp:RequiredFieldValidator ID="RFVRol" runat="server" ControlToValidate="TxtProcedimiento" Display="None"
|
<asp:RequiredFieldValidator ID="RFVRol" runat="server" ControlToValidate="TxtProcedimiento" Display="None"
|
||||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>'Nombre del Procedimiento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>'Nombre del Procedimiento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
<label for="<%= TxtProcedimiento.ClientID.ToString()%>">Nombre Procedimiento:</label>
|
<label for="<%= TxtProcedimiento.ClientID.ToString()%>">Nombre Procedimiento:</label>
|
||||||
|
|||||||
@@ -2137,7 +2137,17 @@ Partial Class Clientes
|
|||||||
Protected Sub BtnSendMail_Click(sender As Object, e As System.EventArgs) Handles BtnSendMail.Click
|
Protected Sub BtnSendMail_Click(sender As Object, e As System.EventArgs) Handles BtnSendMail.Click
|
||||||
Try
|
Try
|
||||||
|
|
||||||
If HdnCveVenta.Value <> "-1" AndAlso HdnFolioVenta.Value <> "-1" Then
|
If HdnCveVenta.Value <> "-1" AndAlso HdnFolioVenta.Value <> "-1" Then
|
||||||
|
|
||||||
|
Dim ArchivoPDF As String = String.Format("{0}/PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta, HdnTipoDocto.Value, HdnFolioVenta.Value)
|
||||||
|
'REGENERAR EL PDF
|
||||||
|
If Not File.Exists(ArchivoPDF) Then
|
||||||
|
Try
|
||||||
|
GenerarPDFVenta(HdnCveVenta.Value.ToEntero(), AplicaPagare:="1", GuardarPDF:=True, RegenerarPDF:=True, DescargarArchivo:=False)
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al regenerar el PDF", ex)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
|
||||||
Dim ObjMail As New ClsSisMail()
|
Dim ObjMail As New ClsSisMail()
|
||||||
Dim Ruta As String = UsuarioActual.Empresa.Ruta
|
Dim Ruta As String = UsuarioActual.Empresa.Ruta
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
LnkAccionesModalSeleccionLayout.Visible = True
|
LnkAccionesModalSeleccionLayout.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa.Contiene(13, 1) Then
|
If UsuarioActual.CveEmpresa.Contiene(13, 1, 15) Then
|
||||||
DVImporteDeduccionesPago.Visible = True
|
DVImporteDeduccionesPago.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@@ -220,81 +220,21 @@
|
|||||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ninguna remisión pendiente por facturar" DataKeyNames="CveVenta"
|
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ninguna remisión pendiente por facturar" DataKeyNames="CveVenta"
|
||||||
ToolTip="Remisiones sin Facturar"
|
ToolTip="Remisiones sin Facturar"
|
||||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||||
data-sort="true" Style="text-align: center;" GridLines="None">
|
data-sort="true" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField>
|
<asp:HyperLinkField HeaderText="Folio" ItemStyle-Width="100px" DataTextField ="Folio" DataNavigateUrlFormatString="/Ventas/RepRemisionesDetalle.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" />
|
||||||
<HeaderTemplate>
|
<asp:HyperLinkField HeaderText="Fecha" ItemStyle-Width="100px" DataTextField ="Fecha" DataTextFormatString="{0:d}" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" />
|
||||||
<asp:Label Text="Folio" runat="server" CausesValidation="false"> </asp:Label>
|
<asp:BoundField HeaderText="Vencimiento" DataField="FechaVencimiento" DataFormatString="{0:d}" />
|
||||||
</HeaderTemplate>
|
<asp:BoundField HeaderText="Cliente" DataField="Cliente" />
|
||||||
<ItemTemplate>
|
<asp:BoundField HeaderText="Contrato" DataField="TieneContrato" Visible="false" />
|
||||||
<asp:Literal ID="LtlFolio" runat="server" Text='<%# Eval("Folio") %>'></asp:Literal>
|
<asp:BoundField HeaderText="Médico" DataField="Medico" Visible="false" />
|
||||||
</ItemTemplate>
|
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" Visible="false" />
|
||||||
</asp:TemplateField>
|
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" />
|
||||||
<asp:TemplateField>
|
<asp:BoundField DataField="PorcentajeAvance" HeaderText="Facturado" DataFormatString="{0:F}%" HtmlEncode="false" />
|
||||||
<HeaderTemplate>
|
<asp:BoundField DataField="SubTotal" HeaderText="SubTotal" DataFormatString="{0:N2}" Visible="false" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:Label Text="Fecha" runat="server" CausesValidation="false"> </asp:Label>
|
<asp:BoundField DataField="Descuento" HeaderText="Descuento" DataFormatString="{0:N2}" Visible="false" ItemStyle-HorizontalAlign="Right" />
|
||||||
</HeaderTemplate>
|
<asp:BoundField DataField="IVA" HeaderText="IVA" DataFormatString="{0:N2}" Visible="false" ItemStyle-HorizontalAlign="Right" />
|
||||||
<ItemTemplate>
|
|
||||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
<asp:TemplateField>
|
|
||||||
<HeaderTemplate>
|
|
||||||
<asp:Label Text="F. Vencimiento" runat="server" CausesValidation="false"> </asp:Label>
|
|
||||||
</HeaderTemplate>
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:Literal ID="LtlFechaVencimiento" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}") %>'></asp:Literal>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
|
||||||
<HeaderTemplate>
|
|
||||||
<asp:Label Text="Cliente" runat="server" CausesValidation="false"> </asp:Label>
|
|
||||||
</HeaderTemplate>
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:Literal ID="LtlCliente" runat="server" Text='<%# Eval("Cliente") %>'></asp:Literal>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
<asp:TemplateField>
|
|
||||||
<HeaderTemplate>
|
|
||||||
<asp:Label Text="Contrato" runat="server" CausesValidation="false"> </asp:Label>
|
|
||||||
</HeaderTemplate>
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:Literal ID="LtlContrato" runat="server" Text='<%# Eval("TieneContrato") %>'></asp:Literal>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
<asp:BoundField DataField="PorcentajeAvance" HeaderText="Facturado" DataFormatString="{0:F}" HtmlEncode="false" />
|
|
||||||
<%-- <asp:TemplateField>
|
|
||||||
<HeaderTemplate>
|
|
||||||
<asp:Label Text="Facturado" runat="server" CausesValidation="false"> </asp:Label>
|
|
||||||
</HeaderTemplate>
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:Literal ID="LtlAvance" runat="server" Text='<%# String.Concat(Eval("PorcentajeAvance"), "%") %>'></asp:Literal>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>--%>
|
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
|
||||||
<HeaderTemplate>
|
|
||||||
<asp:Label Text="SubTotal" runat="server" CausesValidation="false"> </asp:Label>
|
|
||||||
</HeaderTemplate>
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:Literal ID="LtlSubTotal" runat="server" Text='<%# Eval("SubTotal", "{0:N2}") %>'></asp:Literal>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" Visible="false">
|
|
||||||
<HeaderTemplate>
|
|
||||||
<asp:Label Text="Descuento" runat="server" CausesValidation="false"> </asp:Label>
|
|
||||||
</HeaderTemplate>
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:Literal ID="LtlDescuento" runat="server" Text='<%# Eval("Descuento", "{0:N2}") %>'></asp:Literal>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
|
||||||
<HeaderTemplate>
|
|
||||||
<asp:Label Text="IVA" runat="server" CausesValidation="false"> </asp:Label>
|
|
||||||
</HeaderTemplate>
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:Literal ID="LtlIVA" runat="server" Text='<%# Eval("IVA", "{0:N2}") %>'></asp:Literal>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="10%" >
|
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="10%" >
|
||||||
<HeaderTemplate>
|
<HeaderTemplate>
|
||||||
<asp:Label Text="Total" runat="server" CausesValidation="false"> </asp:Label>
|
<asp:Label Text="Total" runat="server" CausesValidation="false"> </asp:Label>
|
||||||
@@ -304,15 +244,8 @@
|
|||||||
<%--<asp:Literal ID="LtlMon" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>--%>
|
<%--<asp:Literal ID="LtlMon" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>--%>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
<asp:BoundField DataField="ImporteInventario" HeaderText="Inventario" DataFormatString="{0:N2} MXN" Visible="false" ItemStyle-HorizontalAlign="Right" />
|
||||||
<HeaderTemplate>
|
|
||||||
<asp:Label Text="Inventario" runat="server" CausesValidation="false"> </asp:Label>
|
|
||||||
</HeaderTemplate>
|
|
||||||
<ItemTemplate>
|
|
||||||
<asp:Literal ID="LtlTotalInventario" runat="server" Text='<%# Eval("ImporteInventario", "{0:N2}") & " MXN" %>'></asp:Literal>
|
|
||||||
<%--<asp:Literal ID="LtlMon" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>--%>
|
|
||||||
</ItemTemplate>
|
|
||||||
</asp:TemplateField>
|
|
||||||
</Columns>
|
</Columns>
|
||||||
<HeaderStyle CssClass="Titulos" />
|
<HeaderStyle CssClass="Titulos" />
|
||||||
<RowStyle CssClass="Texto" />
|
<RowStyle CssClass="Texto" />
|
||||||
|
|||||||
@@ -97,10 +97,10 @@ Partial Class RepRemisiones
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If DtVentas IsNot Nothing Then
|
If DtVentas IsNot Nothing Then
|
||||||
GvDatos.Columns(7).Visible = DtVentas.SUMD("Descuento") > 0
|
GvDatos.Columns(10).Visible = DtVentas.SUMD("Descuento") > 0
|
||||||
End If
|
End If
|
||||||
|
|
||||||
GvDatos.Columns(10).Visible = chkInv.Checked 'solo se visualiza si está selccionada
|
GvDatos.Columns(13).Visible = chkInv.Checked 'solo se visualiza si está selccionada
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
GvDatos.DataBind()
|
GvDatos.DataBind()
|
||||||
@@ -118,16 +118,12 @@ Partial Class RepRemisiones
|
|||||||
e.Row.CssClass = "SubTotales2"
|
e.Row.CssClass = "SubTotales2"
|
||||||
e.Row.Font.Bold = True
|
e.Row.Font.Bold = True
|
||||||
e.Row.Attributes.Add("style", "background:#CCCCCC !important")
|
e.Row.Attributes.Add("style", "background:#CCCCCC !important")
|
||||||
Else
|
Else
|
||||||
e.Row.FCLiteral("LtlFolio").Text = "<a class=""Texto"" target=""_blank"" href=""/Ventas/RepRemisionesDetalle.aspx?CveVenta=" & e.Row.DBCampo("CveVenta") & """>" & e.Row.FCLiteral("LtlFolio").Text & "</a>"
|
|
||||||
e.Row.FCLiteral("LtlFecha").Text = "<a class=""Texto"" target=""_blank"" href=""/Ventas/Ventas.aspx?CveVenta=" & e.Row.DBCampo("CveVenta") & """>" & e.Row.FCLiteral("LtlFecha").Text & "</a>"
|
|
||||||
|
|
||||||
If e.Row.DBCampo("FechaVencimiento").ToDate < NowADS() Then
|
If e.Row.DBCampo("FechaVencimiento").ToDate < NowADS() Then
|
||||||
' e.Row.Cells(2).CssClass = "danger"
|
' e.Row.Cells(2).CssClass = "danger"
|
||||||
e.Row.Cells(2).ForeColor = Drawing.Color.Red
|
e.Row.Cells(2).ForeColor = Drawing.Color.Red
|
||||||
End If
|
End If
|
||||||
|
|
||||||
e.Row.Cells(5).Text = e.Row.Cells(5).Text + "%"
|
|
||||||
End If
|
End If
|
||||||
e.Row.FCLiteral("LtlTotal").Text = "<a class=""Texto"" target=""_blank"" href=""/Ventas/RepRemisionesDetalle.aspx?CveVenta=" & e.Row.DBCampo("CveVenta") & "&FechaI=" & FechaI & "&FechaF=" & FechaF & "&FechaV=" & FechaV & "&CveCliente=" & If(e.Row.DBCampo("CveCliente").ToString().ToEntero() > 0, e.Row.DBCampo("CveCliente").ToString(), DdlClientes.SelectedValue) & "&CveContrato=" & CveContrato & "&CveSubProyecto=" & Sucursales & "&CveMoneda=" & e.Row.DBCampo("CveMoneda") & """>" & e.Row.FCLiteral("LtlTotal").Text & "</a>"
|
e.Row.FCLiteral("LtlTotal").Text = "<a class=""Texto"" target=""_blank"" href=""/Ventas/RepRemisionesDetalle.aspx?CveVenta=" & e.Row.DBCampo("CveVenta") & "&FechaI=" & FechaI & "&FechaF=" & FechaF & "&FechaV=" & FechaV & "&CveCliente=" & If(e.Row.DBCampo("CveCliente").ToString().ToEntero() > 0, e.Row.DBCampo("CveCliente").ToString(), DdlClientes.SelectedValue) & "&CveContrato=" & CveContrato & "&CveSubProyecto=" & Sucursales & "&CveMoneda=" & e.Row.DBCampo("CveMoneda") & """>" & e.Row.FCLiteral("LtlTotal").Text & "</a>"
|
||||||
|
|
||||||
@@ -137,28 +133,28 @@ Partial Class RepRemisiones
|
|||||||
|
|
||||||
#Region "CARGA COMBOS FILTRO"
|
#Region "CARGA COMBOS FILTRO"
|
||||||
Private Sub CargaCliente()
|
Private Sub CargaCliente()
|
||||||
'CargaClientes
|
|
||||||
'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
|
||||||
'If EsWS Then
|
|
||||||
DdlClientes.setEsWebService(True)
|
DdlClientes.setEsWebService(True)
|
||||||
' Else
|
|
||||||
'DdlClientes.setEsWebService(False)
|
|
||||||
'DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
|
||||||
'DdlClientes.DataBind()
|
|
||||||
'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
||||||
'End If
|
|
||||||
|
|
||||||
If UsuarioActual.TienePermisoProceso(201) Then
|
If UsuarioActual.TienePermisoProceso(201) Then
|
||||||
divVerInv.Visible = True
|
divVerInv.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then ' es empresa hospitalaria
|
||||||
|
GvDatos.Columns(3).HeaderText = "Hospital"
|
||||||
|
GvDatos.Columns(5).Visible = True
|
||||||
|
GvDatos.Columns(6).Visible = True
|
||||||
|
'columna de fecha
|
||||||
|
GvDatos.Columns(1).HeaderText = "Fecha Cirugía"
|
||||||
|
CType(GvDatos.Columns(1), HyperLinkField).DataTextFormatString = "{0:dd/MM/yyyy HH:mm}"
|
||||||
|
CType(GvDatos.Columns(1), HyperLinkField).ItemStyle.Width = Unit.Pixel(120)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaSucursales()
|
Private Sub CargaSucursales()
|
||||||
|
|
||||||
DdlSubProyectos.DataSource() = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
|
DdlSubProyectos.DataSource() = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
|
||||||
DdlSubProyectos.DataBind()
|
DdlSubProyectos.DataBind()
|
||||||
'DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaContrato()
|
Private Sub CargaContrato()
|
||||||
|
|||||||
@@ -200,6 +200,9 @@
|
|||||||
<li>
|
<li>
|
||||||
<asp:HyperLink ID="HplDownPDF" Target="_blank" runat="server" Visible="false"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Imprimir PDF</asp:HyperLink>
|
<asp:HyperLink ID="HplDownPDF" Target="_blank" runat="server" Visible="false"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Imprimir PDF</asp:HyperLink>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkDescargaDirecta" runat="server" Visible="false" OnClick="LnkDescargaDirecta_Click"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Impresión directa</asp:LinkButton>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<asp:HyperLink ID="HplRenerarPDF" Target="_blank" runat="server" Visible="false"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Regenerar PDF</asp:HyperLink>
|
<asp:HyperLink ID="HplRenerarPDF" Target="_blank" runat="server" Visible="false"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Regenerar PDF</asp:HyperLink>
|
||||||
</li>
|
</li>
|
||||||
@@ -449,7 +452,7 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<asp:DropDownList ID="DdlSucursalCliente" runat="server" Width="100%" AutoPostBack="true" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalCliente" DataValueField="CveClienteSucursal">
|
<asp:DropDownList ID="DdlSucursalCliente" runat="server" Width="100%" AutoPostBack="true" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalCliente" DataValueField="CveClienteSucursal">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td align="left">
|
<td align="left">
|
||||||
@@ -586,13 +589,13 @@
|
|||||||
<b>Requiere Técnico:</b>
|
<b>Requiere Técnico:</b>
|
||||||
</td>
|
</td>
|
||||||
<td runat="server" id="TdRequiereTecnico2" visible="true">
|
<td runat="server" id="TdRequiereTecnico2" visible="true">
|
||||||
<asp:CheckBox ID="ChkRequiereTecnico" runat="server" CssClass="chksino" OnCheckedChanged="ChkRequiereTecnico_CheckedChanged" AutoPostBack="true" Text="Requiere Técnico:" />
|
<asp:CheckBox ID="ChkRequiereTecnico" runat="server" CssClass="chksino" OnCheckedChanged="ChkRequiereTecnico_CheckedChanged" AutoPostBack="true" Text="Requiere Técnico:" Checked="false" />
|
||||||
</td>
|
</td>
|
||||||
<td runat="server" id="TdFechaOS1" visible="true">
|
<td runat="server" id="TdFechaOS1" visible="true">
|
||||||
<b>Fecha de Cirugia:</b>
|
<b>Fecha de Cirugia:</b>
|
||||||
</td>
|
</td>
|
||||||
<td runat="server" id="TdFechaOS2" visible="true">
|
<td runat="server" id="TdFechaOS2" visible="true">
|
||||||
<asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CssClass="make-switchsd" CausesValidation="true" Style="width: 130px" ></asp:TextBox>
|
<asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CssClass="make-switchsd" CausesValidation="true" Style="width: 130px"></asp:TextBox>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -1979,10 +1982,10 @@
|
|||||||
<asp:CompareValidator ID="CVFechaEje" runat="server" ControlToValidate="TxtFechaEjecucion" Display="None" ErrorMessage="El campo <b>''Fecha Ejecución''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
|
<asp:CompareValidator ID="CVFechaEje" runat="server" ControlToValidate="TxtFechaEjecucion" Display="None" ErrorMessage="El campo <b>''Fecha Ejecución''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VcoRFVFechaEje" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaEje" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VcoRFVFechaEje" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaEje" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ajax:CalendarExtender runat="server" ID="CEFechaEje" TargetControlID="TxtFechaEjecucion" PopupButtonID="ImgCalendarFechaEje" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
<ajax:CalendarExtender runat="server" ID="CEFechaEje" TargetControlID="TxtFechaEjecucion" PopupButtonID="ImgCalendarFechaEje" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
<asp:RequiredFieldValidator ID="RFVFechaEje" runat="server" ControlToValidate="TxtFechaEjecucion" Display="None" ErrorMessage="El campo <b>''Fecha de Ejecución''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVFechaEje" runat="server" ControlToValidate="TxtFechaEjecucion" Display="None" ErrorMessage="El campo <b>''Fecha de Ejecución''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator>
|
||||||
|
|
||||||
<ajax:ValidatorCalloutExtender ID="VcoCVFechaEje" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaEje" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VcoCVFechaEje" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaEje" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
@@ -4116,8 +4119,6 @@
|
|||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</td>
|
</td>
|
||||||
</tr>--%>
|
</tr>--%>
|
||||||
|
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
@@ -4204,7 +4205,8 @@
|
|||||||
<asp:Button ID="BtnEditar" runat="server" Text="Editar" CssClass="btn myventasbutton btn-primary" Visible="false" />
|
<asp:Button ID="BtnEditar" runat="server" Text="Editar" CssClass="btn myventasbutton btn-primary" Visible="false" />
|
||||||
|
|
||||||
<asp:LinkButton ID="BtnAdjuntar" runat="server" Visible="false" Text="<i class='fa-upload fa' style=' color: white;'></i> Adjuntar" data-toggle="modal" data-target="#ModalAdjuntar" CssClass="btn myventasbutton btn-primary" />
|
<asp:LinkButton ID="BtnAdjuntar" runat="server" Visible="false" Text="<i class='fa-upload fa' style=' color: white;'></i> Adjuntar" data-toggle="modal" data-target="#ModalAdjuntar" CssClass="btn myventasbutton btn-primary" />
|
||||||
<br /><asp:LinkButton ID="BtnArchivoAdjunto" runat="server" Visible="false" Text="" Font-Size="14px" />
|
<br />
|
||||||
|
<asp:LinkButton ID="BtnArchivoAdjunto" runat="server" Visible="false" Text="" Font-Size="14px" />
|
||||||
<asp:LinkButton ID="BtnEliminarAdjunto" runat="server" Visible="false" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
|
<asp:LinkButton ID="BtnEliminarAdjunto" runat="server" Visible="false" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
@@ -8420,21 +8422,21 @@
|
|||||||
<%--Cliente Sucursales --%>
|
<%--Cliente Sucursales --%>
|
||||||
<div runat="server" visible="False" id="DvModalTipoVentaPasoCliente">
|
<div runat="server" visible="False" id="DvModalTipoVentaPasoCliente">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="form-group col-md-12 form-md-line-input input-iconright ">
|
<div class="form-group col-md-12 form-md-line-input input-iconright ">
|
||||||
<asp:DropDownList ID="DdlClienteSucursal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="Clave" CausesValidation="true"
|
<asp:DropDownList ID="DdlClienteSucursal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="Clave" CausesValidation="true"
|
||||||
AutoPostBack="true" OnSelectedIndexChanged="DdlClienteSucursal_SelectedIndexChanged">
|
AutoPostBack="true" OnSelectedIndexChanged="DdlClienteSucursal_SelectedIndexChanged">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<asp:RequiredFieldValidator ID="RfvDdlClienteSucursal" runat="server" CssClass="" Display="None" InitialValue="-1"
|
<asp:RequiredFieldValidator ID="RfvDdlClienteSucursal" runat="server" CssClass="" Display="None" InitialValue="-1"
|
||||||
ControlToValidate="DdlClienteSucursal" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Hospital''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalVentaMedica"></asp:RequiredFieldValidator>
|
ControlToValidate="DdlClienteSucursal" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Hospital''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalVentaMedica"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VceRfvDdlClienteSucursal" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlClienteSucursal" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VceRfvDdlClienteSucursal" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlClienteSucursal" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClienteSucursal">Hospital:</asp:Label>
|
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClienteSucursal">Hospital:</asp:Label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<%--Cliente--%>
|
<%--Cliente--%>
|
||||||
<%-- <div runat="server" visible="False" id="DvModalTipoVentaPasoClienteEliminar">
|
<%-- <div runat="server" visible="False" id="DvModalTipoVentaPasoClienteEliminar">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="form-group col-md-12 form-md-line-input input-iconright ">
|
<div class="form-group col-md-12 form-md-line-input input-iconright ">
|
||||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClientesWS">Hospital:</asp:Label>
|
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClientesWS">Hospital:</asp:Label>
|
||||||
@@ -8456,7 +8458,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>--%>
|
</div>--%>
|
||||||
|
|
||||||
|
|
||||||
<%--Medico Procedimiento--%>
|
<%--Medico Procedimiento--%>
|
||||||
<div runat="server" visible="False" id="DvModalTipoVentaPasoMedicoProcedimiento">
|
<div runat="server" visible="False" id="DvModalTipoVentaPasoMedicoProcedimiento">
|
||||||
@@ -8495,7 +8497,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6 form-md-line-input input-iconright " runat="server" id="DvModalRequiereOSFecha" visible="false">
|
<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 Cirugia:</asp:Label>
|
||||||
<asp:TextBox ID="TxtFechaModal" type="datetime-local" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 100%" ></asp:TextBox>
|
<asp:TextBox ID="TxtFechaModal" type="datetime-local" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 100%"></asp:TextBox>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -8539,45 +8541,20 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||||
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
|
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
|
||||||
|
<script src="/Scripts/PrintJS/print.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function impresionDirecta(url){
|
function impresionDirecta(urlPDF) {
|
||||||
var frame = document.createElement('iframe');
|
printJS({printable:urlPDF, type:'pdf', showModal:true});
|
||||||
frame.setAttribute('src', url);
|
}
|
||||||
//must be in the DOM to work in Firefox/IE
|
|
||||||
document.body.appendChild(frame);
|
function abrirDdlPS(){
|
||||||
//since it's in the DOM we need to hide it (lest we ruin our page layout)
|
$(document).ready(function() {
|
||||||
//can't use 'display:none' or 'visibility:hidden' because you can't get focus (needed for IE)
|
$('#C_Tab_TabGenerales_DdlPS > select').select2('open').next().find(':input.select2-search__field').focus();
|
||||||
//'z-index:-1' & 'opacity:0' wont help if there is no background in the elements above it and someone clicks through to it
|
});
|
||||||
frame.style.position = 'absolute';
|
|
||||||
frame.style.left = '-9999px';
|
|
||||||
//when it is loaded, print it
|
|
||||||
function printFrame() {
|
|
||||||
//have to get focus in IE
|
|
||||||
frame.contentWindow.focus();
|
|
||||||
//print!
|
|
||||||
frame.contentWindow.print();
|
|
||||||
/* cant remove the element because print() is non-blocking in FF
|
|
||||||
* (I.e. it would remove the frame before it was printed!)
|
|
||||||
//cleanup
|
|
||||||
//document.body.removeChild(frame);*/
|
|
||||||
};
|
|
||||||
//if it was cached, it may already be done (onload wont fire, IE8)
|
|
||||||
if (frame.contentWindow && frame.contentDocument.readyState == 'complete')
|
|
||||||
printFrame();
|
|
||||||
else {
|
|
||||||
if (frame.addEventListener)
|
|
||||||
//W3C
|
|
||||||
frame.addEventListener('load', printFrame, false);
|
|
||||||
else
|
|
||||||
//IE<9
|
|
||||||
frame.attachEvent('onload', printFrame);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function pageLoad()
|
function pageLoad()
|
||||||
|
|||||||
@@ -3467,14 +3467,15 @@ Partial Class Ventas
|
|||||||
GvPS.Columns(ColumnaSubProyecto).Visible = False
|
GvPS.Columns(ColumnaSubProyecto).Visible = False
|
||||||
ThProyecto.Visible = False
|
ThProyecto.Visible = False
|
||||||
ThProyecto2.Visible = False
|
ThProyecto2.Visible = False
|
||||||
|
|
||||||
TxtCantidad.Text = "1"
|
|
||||||
TxtCantidad.Focus()
|
|
||||||
TrDescripcionVenta.Visible = False
|
TrDescripcionVenta.Visible = False
|
||||||
|
|
||||||
|
If CveVenta <= 0 Then
|
||||||
|
TxtCantidad.Text = "1"
|
||||||
|
TxtCantidad.Focus()
|
||||||
|
RegistraScript("abrirDdlPS();", "A1")
|
||||||
|
End If
|
||||||
UpPS.Update()
|
UpPS.Update()
|
||||||
|
|
||||||
RegistraScript("$('#TxtCantidad').focus();", "A1")
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -9538,9 +9539,12 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.CveRol = 1 Then
|
If UsuarioActual.CveRol = 1 Then
|
||||||
|
LnkDescargaDirecta.Visible = True
|
||||||
|
|
||||||
HplImprimirPDFStimulsoft.Visible = True
|
HplImprimirPDFStimulsoft.Visible = True
|
||||||
HplImprimirPDFStimulsoft.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=0&STIMULSOFT=1", CveVenta)))
|
HplImprimirPDFStimulsoft.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=0&STIMULSOFT=1", CveVenta)))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'NO DEBE IMPRIMIR PDF DE COTIZACION
|
'NO DEBE IMPRIMIR PDF DE COTIZACION
|
||||||
@@ -10366,18 +10370,33 @@ Partial Class Ventas
|
|||||||
If File.Exists(ArchivoXML) Then
|
If File.Exists(ArchivoXML) Then
|
||||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
|
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
|
||||||
End If
|
End If
|
||||||
|
'MANDA CORREO
|
||||||
Try
|
Try
|
||||||
'MANDA CORREO
|
|
||||||
Dim strURLHOST As String = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
|
||||||
Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False)
|
Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False)
|
||||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST))
|
'SE SE VA UTILIZAR LA DESCARGA AUTOMATICA, NO GENERAR PDF A TRAVEZ DE UN THREAD
|
||||||
Hilo.Start()
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||||
|
GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, "", UsarDescargaDesdePopUpVerFactura:=False)
|
||||||
|
Else
|
||||||
|
Dim strURLHOST As String = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||||
|
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST))
|
||||||
|
Hilo.Start()
|
||||||
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al enviar el PDF", ex)
|
OnError("Ocurrió un error al enviar el PDF", ex)
|
||||||
End Try
|
End Try
|
||||||
|
Else
|
||||||
|
'PARA PRUEBAS, GENERAR PDF AUNQUE NO ESTE TIMBRADA
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||||
|
Try
|
||||||
|
Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False)
|
||||||
|
GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, "", UsarDescargaDesdePopUpVerFactura:=False)
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al enviar el PDF", ex)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
'DESCARGA PDF
|
'DESCARGA PDF
|
||||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant", "Egs", "Dev", "Ped") Then
|
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant", "Egs", "Dev", "Ped") Then
|
||||||
'If Not ImprimeAlert Then
|
'If Not ImprimeAlert Then
|
||||||
@@ -10578,7 +10597,7 @@ Partial Class Ventas
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||||
RegistraScript($"impresionDirecta('/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))}');", "Imprimir")
|
ImpresionDirectaPDF()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@@ -15532,14 +15551,28 @@ Partial Class Ventas
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "¡ P D F R E P O R T V I E W E R !"
|
#Region "¡ P D F R E P O R T V I E W E R !"
|
||||||
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, Factura As Modelos.Factura, UsuarioActual As Usuario, strURLHOST As String, Optional CorreoCRM As String = "")
|
''' <summary>
|
||||||
|
''' Generación y envío de correo de factura, UsarDescargaDesdePopUpVerFactura si se va realizar a travez de un thread
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="EnviaCorreo"></param>
|
||||||
|
''' <param name="Factura"></param>
|
||||||
|
''' <param name="UsuarioActual"></param>
|
||||||
|
''' <param name="strURLHOST"></param>
|
||||||
|
''' <param name="CorreoCRM"></param>
|
||||||
|
''' <param name="UsarDescargaDesdePopUpVerFactura"></param>
|
||||||
|
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, Factura As Modelos.Factura, UsuarioActual As Usuario, strURLHOST As String, Optional CorreoCRM As String = "", Optional UsarDescargaDesdePopUpVerFactura As Boolean = True)
|
||||||
'GUARDA PDF
|
'GUARDA PDF
|
||||||
Dim LocalSerieFolio As String = String.Empty
|
Dim LocalSerieFolio As String = String.Empty
|
||||||
Dim LocalTipoDocto As String = String.Empty
|
Dim LocalTipoDocto As String = String.Empty
|
||||||
|
|
||||||
'TIMBRADO NUEVO
|
'TIMBRADO NUEVO
|
||||||
Try
|
Try
|
||||||
DescargarFactura(Factura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True, strURLHOST:=strURLHOST)
|
If UsarDescargaDesdePopUpVerFactura Then
|
||||||
|
DescargarFactura(Factura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True, strURLHOST:=strURLHOST)
|
||||||
|
Else
|
||||||
|
GenerarPDFVenta(Factura.CveVenta, AplicaPagare:="1", GuardarPDF:=True, RegenerarPDF:=True, DescargarArchivo:=False)
|
||||||
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al generar el PDF", ex)
|
OnError("Ocurrió un error al generar el PDF", ex)
|
||||||
End Try
|
End Try
|
||||||
@@ -16766,19 +16799,18 @@ Partial Class Ventas
|
|||||||
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), Ddl)
|
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), Ddl)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa.Contiene(186, 189) Then
|
If UsuarioActual.CveEmpresa.Contiene(186, 189) Then
|
||||||
TxtPrecio.Focus()
|
TxtPrecio.Focus()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
UPPPS.Update()
|
UPPPS.Update()
|
||||||
UpPS.Update()
|
UpPS.Update()
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa = 189 Then
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||||
AgregarPS()
|
AgregarPS()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function CalculaPrecioSugerido(CvePSParametro As Integer, CveClasificacion As Integer, Optional CvePrecioListaSugerido As Integer = -1) As Modelos.MPrecioSugerido
|
Private Function CalculaPrecioSugerido(CvePSParametro As Integer, CveClasificacion As Integer, Optional CvePrecioListaSugerido As Integer = -1) As Modelos.MPrecioSugerido
|
||||||
@@ -21662,7 +21694,7 @@ Partial Class Ventas
|
|||||||
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero()
|
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero()
|
||||||
Dim TipoCambio As Decimal = TxtTipoCambio.Text.ToDecimal
|
Dim TipoCambio As Decimal = TxtTipoCambio.Text.ToDecimal
|
||||||
EditoRemision = True
|
EditoRemision = True
|
||||||
CveClienteSucursal = DdlClienteSucursal.SelectedValue.ToEntero
|
CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero
|
||||||
Try
|
Try
|
||||||
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
|
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
|
||||||
If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then
|
If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then
|
||||||
@@ -21849,11 +21881,12 @@ Partial Class Ventas
|
|||||||
'REGENERAR EL PDF
|
'REGENERAR EL PDF
|
||||||
If Not OcurrioError Then
|
If Not OcurrioError Then
|
||||||
Try
|
Try
|
||||||
Dim CveEmpresaPDF As Integer = UsuarioActual.CveEmpresa
|
GenerarPDFVenta(CveVenta, AplicaPagare:="1", GuardarPDF:=True, RegenerarPDF:=True, DescargarArchivo:=False)
|
||||||
Dim CveUsuarioPDF As Integer = UsuarioActual.CveUsuario
|
'Dim CveEmpresaPDF As Integer = UsuarioActual.CveEmpresa
|
||||||
|
'Dim CveUsuarioPDF As Integer = UsuarioActual.CveUsuario
|
||||||
|
|
||||||
Dim strURLHOST As String = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
'Dim strURLHOST As String = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||||
RegenerarPDF(CveVenta, CveEmpresaPDF, CveUsuarioPDF, strURLHOST)
|
'RegenerarPDF(CveVenta, CveEmpresaPDF, CveUsuarioPDF, strURLHOST)
|
||||||
'
|
'
|
||||||
'Dim Hilo As New System.Threading.Thread(Sub() )
|
'Dim Hilo As New System.Threading.Thread(Sub() )
|
||||||
'Hilo.Start()
|
'Hilo.Start()
|
||||||
@@ -21862,14 +21895,6 @@ Partial Class Ventas
|
|||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub RegenerarPDF(CveVenta As Integer, CveEmpresa As Integer, CveUsuario As Integer, strURLHOST As String)
|
|
||||||
Try
|
|
||||||
DescargarFactura(CveVenta, CveEmpresa, CveUsuario, Regenerar:=True, strURLHOST:=strURLHOST)
|
|
||||||
Catch ex As Exception
|
|
||||||
OnError("Ocurrió error al regenerar el PDF", ex)
|
|
||||||
End Try
|
|
||||||
End Sub
|
|
||||||
Private Sub BtnActualizarCuentaTerminal_Click(sender As Object, e As EventArgs) Handles BtnActualizarCuentaTerminal.Click
|
Private Sub BtnActualizarCuentaTerminal_Click(sender As Object, e As EventArgs) Handles BtnActualizarCuentaTerminal.Click
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
ObjVentas.IniciaTransacSQL()
|
ObjVentas.IniciaTransacSQL()
|
||||||
@@ -23804,7 +23829,7 @@ Partial Class Ventas
|
|||||||
Dim File As Byte() = Nothing
|
Dim File As Byte() = Nothing
|
||||||
Try
|
Try
|
||||||
Using httpClient = New HttpClient()
|
Using httpClient = New HttpClient()
|
||||||
httpClient.Timeout = New TimeSpan(0, 15, 0)
|
httpClient.Timeout = New TimeSpan(0, 1, 0)
|
||||||
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
|
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
|
||||||
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO={2}", UsuarioActual.CveEmpresa, DateTime.UtcNow.Ticks, UsuarioActual.CveUsuario)))
|
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO={2}", UsuarioActual.CveEmpresa, DateTime.UtcNow.Ticks, UsuarioActual.CveUsuario)))
|
||||||
Dim response = httpClient.SendAsync(request).Result
|
Dim response = httpClient.SendAsync(request).Result
|
||||||
@@ -30975,6 +31000,10 @@ Partial Class Ventas
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
||||||
|
AsignaMedicoProcedimientoFacturaRemisionesModal()
|
||||||
|
End If
|
||||||
|
|
||||||
DdlMoneda.SelectedValue = GlobalDTMonedas.FiltroPrimeroValor("CveMoneda", $"Abreviatura = '{dtSeleccionadas.FiltroPrimeroValor("Abreviatura")}'")
|
DdlMoneda.SelectedValue = GlobalDTMonedas.FiltroPrimeroValor("CveMoneda", $"Abreviatura = '{dtSeleccionadas.FiltroPrimeroValor("Abreviatura")}'")
|
||||||
DdlMoneda.Enabled = False
|
DdlMoneda.Enabled = False
|
||||||
CambiaMoneda()
|
CambiaMoneda()
|
||||||
@@ -31245,6 +31274,9 @@ Partial Class Ventas
|
|||||||
|
|
||||||
RegistraScript("$('#DivRemisiones').modal('hide');", "DivRemisionesHide")
|
RegistraScript("$('#DivRemisiones').modal('hide');", "DivRemisionesHide")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Function VerificaRemisiones(ByRef dt As DataTable) As Boolean
|
Private Function VerificaRemisiones(ByRef dt As DataTable) As Boolean
|
||||||
Dim Valido As Boolean = True
|
Dim Valido As Boolean = True
|
||||||
If ChkRemProductos.Checked Then
|
If ChkRemProductos.Checked Then
|
||||||
@@ -33426,7 +33458,6 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Protected Sub TxtFecha_TextChanged(sender As Object, e As EventArgs)
|
Protected Sub TxtFecha_TextChanged(sender As Object, e As EventArgs)
|
||||||
'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante
|
'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante
|
||||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.CveEmpresa = 48 AndAlso UsuarioActual.Empresa.UsaAC Then
|
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.CveEmpresa = 48 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||||
@@ -33534,7 +33565,7 @@ Partial Class Ventas
|
|||||||
TxtPedidoContrato.Enabled = True
|
TxtPedidoContrato.Enabled = True
|
||||||
TxtObsAlmacen.Enabled = True
|
TxtObsAlmacen.Enabled = True
|
||||||
RblPaqueteria.Enabled = True
|
RblPaqueteria.Enabled = True
|
||||||
|
DdlSucursalCliente.Enabled = True
|
||||||
LnkUpdateLineaAdicional.Visible = True
|
LnkUpdateLineaAdicional.Visible = True
|
||||||
'Acciones
|
'Acciones
|
||||||
BtnEditar.Text = "Guardar"
|
BtnEditar.Text = "Guardar"
|
||||||
@@ -33622,11 +33653,12 @@ Partial Class Ventas
|
|||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
'REGENERAR EL PDF
|
'REGENERAR EL PDF
|
||||||
Try
|
Try
|
||||||
Dim CveEmpresaPDF As Integer = UsuarioActual.CveEmpresa
|
GenerarPDFVenta(CveVenta, AplicaPagare:="1", GuardarPDF:=True, RegenerarPDF:=True, DescargarArchivo:=False)
|
||||||
Dim CveUsuarioPDF As Integer = UsuarioActual.CveUsuario
|
'Dim CveEmpresaPDF As Integer = UsuarioActual.CveEmpresa
|
||||||
|
'Dim CveUsuarioPDF As Integer = UsuarioActual.CveUsuario
|
||||||
|
|
||||||
Dim strURLHOST As String = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
'Dim strURLHOST As String = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||||
RegenerarPDF(CveVenta, CveEmpresaPDF, CveUsuarioPDF, strURLHOST)
|
'RegenerarPDF(CveVenta, CveEmpresaPDF, CveUsuarioPDF, strURLHOST)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al regenerar el PDF", ex)
|
OnError("Ocurrió un error al regenerar el PDF", ex)
|
||||||
End Try
|
End Try
|
||||||
@@ -35893,6 +35925,44 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub AsignaMedicoProcedimientoFacturaRemisionesModal()
|
||||||
|
|
||||||
|
Dim CveVentaConsultar As Integer = -1
|
||||||
|
If ChkRemProductos.Checked Then
|
||||||
|
|
||||||
|
For Each gvRow As GridViewRow In GvRemPS.Rows
|
||||||
|
If gvRow.FCCheckBox("Chk").Checked Then
|
||||||
|
CveVentaConsultar = gvRow.DataKey("CveVenta").ToEntero
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
Else
|
||||||
|
For Each gvRow As GridViewRow In GvRem.Rows
|
||||||
|
If gvRow.FCCheckBox("Chk").Checked Then
|
||||||
|
CveVentaConsultar = gvRow.DataKey("CveVenta").ToEntero
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CveVentaConsultar > 0 Then
|
||||||
|
Dim objVenta As New ClsVentas
|
||||||
|
If objVenta.GetVenta(CveVentaConsultar, UsuarioActual.CveEmpresa) Then
|
||||||
|
Dim dRow As DataRow = objVenta.DtResultados.Rows(0)
|
||||||
|
DdlMedico.SelectedValueExist(dRow("CveMedico").ToString.ToEntero)
|
||||||
|
DdlProcedimiento.SelectedValueExist(dRow("CveProcedimiento").ToString.ToEntero)
|
||||||
|
SeEstaFActurandoVentaMedica = True
|
||||||
|
CveTipoVenta = dRow("CveTipoVenta").ToString.ToEntero
|
||||||
|
ChkRequiereTecnico_CheckedChanged(Nothing, Nothing)
|
||||||
|
End If
|
||||||
|
objVenta.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
|
UpCliente.Update()
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
#Region "VENTAS MEDICAS"
|
#Region "VENTAS MEDICAS"
|
||||||
|
|
||||||
@@ -36389,7 +36459,37 @@ Partial Class Ventas
|
|||||||
CargarSaldoAuxiliar(CveCliente)
|
CargarSaldoAuxiliar(CveCliente)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub LnkDescargaDirecta_Click(sender As Object, e As EventArgs)
|
||||||
|
ImpresionDirectaPDF()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ImpresionDirectaPDF()
|
||||||
|
Dim ObjFactura As New Modelos.Factura(UsuarioActual, Me.CveVenta, UsuarioActual.CveEmpresa, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False)
|
||||||
|
|
||||||
|
Dim ExistePDF As Boolean = False
|
||||||
|
Dim ArchivoPDF As String = String.Format("{0}/PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
|
||||||
|
|
||||||
|
If File.Exists(ArchivoPDF) Then
|
||||||
|
ExistePDF = True
|
||||||
|
Else
|
||||||
|
'REGENERAR EL PDF
|
||||||
|
Try
|
||||||
|
GenerarPDFVenta(CveVenta, AplicaPagare:="1", GuardarPDF:=True, RegenerarPDF:=True, DescargarArchivo:=False)
|
||||||
|
If File.Exists(ArchivoPDF) Then
|
||||||
|
ExistePDF = True
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al regenerar el PDF", ex)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ExistePDF Then
|
||||||
|
Dim urlPDF As String = $"/Ashx/SIGDesc.ashx?metodo=descargarPDFVenta&CveVenta={CveVenta}"
|
||||||
|
RegistraScript($"impresionDirecta('{urlPDF}');", "Imprimir")
|
||||||
|
Else
|
||||||
|
Alert("No se pudo imprimir el pdf directamente. favor de descargar manualmente el pdf.", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
Reference in New Issue
Block a user