This commit is contained in:
2024-02-12 05:46:08 -07:00
12 changed files with 629 additions and 227 deletions

View File

@@ -497,7 +497,7 @@ Public Class ClsOS
Public Function GetRepOrdenesServicioMedicasRep(FechaI As Date, FechaF As Date, CveCliente As Integer, CveVendedor As Integer, CveEstatusOrdenServicio As Integer, CveUsuarioAtendio As Integer, CveSubProyecto As Integer, CveEmpresa As Integer,
Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1) As Boolean
Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveEspecialidad As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OS_OrdenesServiciosMedicasRepGet")
@@ -514,6 +514,8 @@ Public Class ClsOS
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
.Add("@CveEspecialidad", SqlDbType.Int).Value = CveEspecialidad
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
End With

View File

@@ -6987,7 +6987,7 @@ Public Class ClsPaginas
NombreArchivoDescarga = "FacturaUSA"
End If
If UsuarioActual.Empresa.Funcionalidad(718) = "1" Then
If UsuarioActual.CveEmpresa.Contiene(190, 192) Then
If EsTicket Then
NombreArchivo = "FacturaTicket"
NombreArchivoDescarga = "FacturaTicket"

View File

@@ -875,6 +875,33 @@ Public Class ClsProductosServicios
Return Retorno
End Function
Public Function GetUltimoPrecioCompra(CveEmpresa As Integer, CvePS As Integer) As Double
Dim Retorno As Double = -1
DataAdapter("PA_Inv_UltimoPrecioCompraGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@PU", SqlDbType.Money).Direction = ParameterDirection.Output
End With
Try
SqlAdapter.Fill(Data)
Retorno = CDbl(SqlAdapter.SelectCommand.Parameters("@PU").Value)
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al obtener el precio unitario.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al obtener el precio unitario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#Region "P R O D U C T O S - E Q U I V A L E N C I A S "
Public Function GetPSEquivalencias(CvePS As Integer, CveEmpresa As Integer) As Boolean

View File

@@ -1348,8 +1348,9 @@ Partial Class PopUpVerFactura
Dim Guardar As Boolean = UrlParametros("GUARDAR") IsNot Nothing AndAlso UrlParametros("GUARDAR").ToString() = "1"
Dim RegenerarPDF As Boolean = UrlParametros("REGENERAR") IsNot Nothing AndAlso UrlParametros("REGENERAR").ToString() = "1"
Dim STIMUL As Boolean = UrlParametros("STIMULSOFT") IsNot Nothing AndAlso UrlParametros("STIMULSOFT").ToString() = "1"
Dim EsTicket As Boolean = UrlParametros("TICKET") IsNot Nothing AndAlso UrlParametros("TICKET").ToString() = "1"
GenerarPDFVenta(UrlParametros("CVEVENTA").ToString.ToEntero, AplicaPagare, GuardarPDF:=Guardar, RegenerarPDF:=RegenerarPDF, UsarStimul:=STIMUL)
GenerarPDFVenta(UrlParametros("CVEVENTA").ToString.ToEntero, AplicaPagare, GuardarPDF:=Guardar, RegenerarPDF:=RegenerarPDF, UsarStimul:=STIMUL, EsTicket:=EsTicket)
End If
End If

View File

@@ -3,7 +3,7 @@
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style type="text/css">
<%-- <style type="text/css">
.gvInventario tr td:nth-child(4) {
width: 6% !important;
}
@@ -42,7 +42,16 @@
.btn.default:hover {
background-color: lightgray;
}
</style>--%>
<style type="text/css">
.customCalendarStyle
{
position: relative; /* Asegura que z-index funcione */
z-index: 9999;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Entrega Almacén (Surtir Mercancia)
@@ -472,145 +481,174 @@
</div>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light xspadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Salida de Inventario</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
<div class="row">
<div class="col-md-12">
<%--AGREGAR POR CODIGO DE BARRAS--%>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row" runat="server" id="DivCodigoSeriePS" visible="false">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="col-md-2 pull-right">
<div class="btn-group" style="float: right;">
<asp:Button ID="BtnVerSugerencias" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnVerSugerencias_Click" runat="server" Text="Ver Sugerencias" />
</div>
</div>
<div class="col-md-4 pull-right">
<table style="float: right;">
<tr>
<td><i class="fa fa-barcode" style="font-size: 1.8em; margin-top: 8px;" aria-hidden="true" data-toggle="tooltip" title="Código Barras"></i></td>
<td>
<asp:Panel ID="PanelCodigo" runat="server" DefaultButton="BtnCodigoPS">
<asp:TextBox ID="TxtCodigoPS" ClientIDMode="Static" Text="" runat="server" />
<asp:Button Text="" ID="BtnCodigoPS" OnClick="BtnCodigoPS_Click" Style="display: none" runat="server" />
</asp:Panel>
</td>
<td runat="server" visible="false" id="TdSeriePS">
<asp:Panel ID="PanelSerie" runat="server" DefaultButton="BtnSeriePS">
<asp:TextBox ID="TxtSeriePS" Text="" runat="server" />
<asp:Button Text="" ID="BtnSeriePS" OnClick="BtnSeriePS_Click" Style="display: none" runat="server" />
</asp:Panel>
</td>
</tr>
</table>
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Salida de Inventario</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body" >
<%--AGREGAR POR CODIGO DE BARRAS--%>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row" runat="server" id="DivCodigoSeriePS" visible="false">
<%--GV DATOS--%>
<asp:GridView ID="GvDatos" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowFooter="True" ShowHeader="true" ShowHeaderWhenEmpty="True"
DataKeyNames="Consec,CvePS,Codigo,CodigoBarras,CveUM,CantidadC,CantidadF,UM,PS,CveClasificacion,CveCategoria,CveVentaDetalle,CveTamaño,AplicaSeccion, AplicaSerie,AplicaLote,AplicaCaducidad" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover Widthall ScrollAD gvInventario mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
<HeaderStyle Height="30px" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="cbInv" runat="server" Checked="true" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="2.5%" />
</asp:TemplateField>
<asp:BoundField HeaderText="Cant. Venta" DataField="CantidadC" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Cant. Surtida" DataField="CantidadS" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField HeaderText="Cant. a Surtir">
<ItemTemplate>
<asp:TextBox ID="TbCantidadF" runat="server" Width="50px" Mask="9,999.99" DataFormatString="{0:#,##0.######}" Style="text-align: right" Text='<%# Eval("CantidadF", "{0:#,##0.######}") %>'></asp:TextBox>
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-primary btn-xs" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Unidad" DataField="UM" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
<%-- <asp:HyperLinkField HeaderText="Producto o Servicio" Target="_blank" DataTextField="CodigoPS" DataNavigateUrlFields="CvePS" DataNavigateUrlFormatString="/Ventas/ProductosServicios.aspx?CvePS={0}" ItemStyle-HorizontalAlign="Left" />--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>
<asp:Literal ID="LtlHeaderPS" Text="Producto o Servicio" runat="server"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplPS" runat="server" Target="_blank" Text='<%# Eval("CodigoPS", "{0}") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Observación" DataField="ObservacionesDetalle" ItemStyle-Width="7.5%" />
<asp:TemplateField HeaderText="Sección" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
<ItemTemplate>
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
<ItemTemplate>
<asp:TextBox ID="TxtLote" CssClass="form-control input-sm" runat="server" Visible="false" Text='<%# Eval("Lote") %>' Width="100px" Enabled="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
<ItemTemplate>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtCaducidad" Text='<%# Eval("FechaCaducidad") %>' CssClass="form-control input-sm ADSMaskDate" Style="width: 78px" runat="server" Visible="false" Enabled="false"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" Visible="false" Enabled="false"> <i class="fa fa-calendar"></i> </asp:LinkButton>
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" Enabled="false" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="BottomLeft" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
</span>
<div class="col-md-2 pull-right">
<div class="btn-group" style="float: right;">
<asp:Button ID="BtnVerSugerencias" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnVerSugerencias_Click" runat="server" Text="Ver Sugerencias" />
</div>
</div>
<div class="col-md-4 pull-right">
<table style="float: right;">
<tr>
<td><i class="fa fa-barcode" style="font-size: 1.8em; margin-top: 8px;" aria-hidden="true" data-toggle="tooltip" title="Código Barras"></i></td>
<td>
<asp:Panel ID="PanelCodigo" runat="server" DefaultButton="BtnCodigoPS">
<asp:TextBox ID="TxtCodigoPS" ClientIDMode="Static" Text="" runat="server" />
<asp:Button Text="" ID="BtnCodigoPS" OnClick="BtnCodigoPS_Click" Style="display: none" runat="server" />
</asp:Panel>
</td>
<td runat="server" visible="false" id="TdSeriePS">
<asp:Panel ID="PanelSerie" runat="server" DefaultButton="BtnSeriePS">
<asp:TextBox ID="TxtSeriePS" Text="" runat="server" />
<asp:Button Text="" ID="BtnSeriePS" OnClick="BtnSeriePS_Click" Style="display: none" runat="server" />
</asp:Panel>
</td>
</tr>
</table>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Dividir" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" Visible="True">
<ItemTemplate>
<asp:TextBox runat="server" ID="TxtDividir" Width="30px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
<asp:Button runat="server" ID="BtnDividir" Text="Dividir" OnClick="Dividir" Style="display: none;" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<asp:HiddenField runat="server" ClientIDMode="Static" ID="HdnCantidadMovimiento" />
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
<%--BOTON GUARDAR--%>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div align="center">
<asp:Label Text="Venta totalmente Surtida" ID="LbSurtida" Font-Size="Small" Visible="false" CssClass="label label-sm label-success" runat="server" />
<br />
<br />
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" CssClass="btn btn-primary" Text="Guardar" Width="150px" ValidationGroup="GrpGuardar" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%--GV DATOS--%>
<asp:GridView ID="GvDatos" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False"
DataKeyNames="Consec,CvePS,Codigo,CodigoBarras,CveUM,CantidadC,CantidadF,UM,PS,CveClasificacion,CveCategoria,CveVentaDetalle,CveTamaño,AplicaSeccion, AplicaSerie,AplicaLote,AplicaCaducidad"
CssClass="" GridLines="None" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="cbInv" runat="server" Checked="true" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="2.5%" />
</asp:TemplateField>
<asp:BoundField HeaderText="Cant. Venta" DataField="CantidadC" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Cant. Surtida" DataField="CantidadS" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField HeaderText="Cant. a Surtir">
<ItemTemplate>
<asp:TextBox ID="TbCantidadF" runat="server" Width="50px" Mask="9,999.99" DataFormatString="{0:#,##0.######}" Style="text-align: right" Text='<%# Eval("CantidadF", "{0:#,##0.######}") %>'></asp:TextBox>
<asp:Button Text="Serie" ID="BtnSerie" OnClick="BtnSerie_Click" CssClass="btn btn-primary btn-xs" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Unidad" DataField="UM" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>
<asp:Literal ID="LtlHeaderPS" Text="Producto o Servicio" runat="server"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplPS" runat="server" Target="_blank" Text='<%# Eval("CodigoPS", "{0}") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Observación" DataField="ObservacionesDetalle" ItemStyle-Width="7.5%" />
<asp:TemplateField HeaderText="Sección" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
<ItemTemplate>
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<%--8--%>
<asp:TemplateField HeaderText="Lote/caducidades" ItemStyle-HorizontalAlign="Left" Visible="false" ItemStyle-Width="150px">
<ItemTemplate>
<asp:DropDownList ID="DdlCaducidadProducto" CssClass="select2me" Width="150px" runat="server" CausesValidation="true" AutoPostBack="true" OnSelectedIndexChanged="DdlCaducidadProducto_SelectedIndexChanged">
<asp:ListItem Selected="True" Text="-" Value="|"></asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<%--9--%>
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
<ItemTemplate>
<asp:TextBox ID="TxtLote" CssClass="form-control input-sm" runat="server" Visible="false" Text='<%# Eval("Lote") %>' Width="100px" Enabled="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
<ItemTemplate>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;" runat="server" visible="false" id="DvFechaCaducidad" >
<asp:TextBox ID="TxtCaducidad" Text="" CssClass="form-control input-sm ADSMaskDate" Style="width: 87px" runat="server" ></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" > <i class="fa fa-calendar"></i> </asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="TopLeft" Format="dd/MM/yyyy"
> </ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Dividir" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" Visible="True">
<ItemTemplate>
<asp:TextBox runat="server" ID="TxtDividir" Width="30px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
<asp:Button runat="server" ID="BtnDividir" Text="Dividir" OnClick="Dividir" Style="display: none;" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<asp:HiddenField runat="server" ClientIDMode="Static" ID="HdnCantidadMovimiento" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-12">
<%--BOTON GUARDAR--%>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div align="center">
<asp:Label Text="Venta totalmente Surtida" ID="LbSurtida" Font-Size="Small" Visible="false" CssClass="label label-sm label-success" runat="server" />
<br />
<br />
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" CssClass="btn btn-primary" Text="Guardar" Width="150px" ValidationGroup="GrpGuardar" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<%--AGREGA POR SERIE--%>
@@ -702,8 +740,6 @@
</div>
</div>
<div id="DivLote" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpLoteBatch" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">

View File

@@ -7,6 +7,8 @@ Imports System.IO
Imports System.Web.Management
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports MoreLinq
Imports Telerik.Web.UI
Partial Class Inventarios_EntregaAlmacen
Inherits ClsPaginas
@@ -715,9 +717,9 @@ Partial Class Inventarios_EntregaAlmacen
End If
If DtDatos.SUM("CantidadS") <= 0 Then
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario gvEscondeColumna"
GvDatos.CssClass = "table table-striped table-hover Widthall gvInventario gvEscondeColumna"
Else
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario"
GvDatos.CssClass = "table table-striped table-hover Widthall gvInventario"
End If
If CveAlmacenTraspasoDestino > 0 And Not (TipoMovimiento = 2 And TipoDocto.Contiene("Rem", "Ped")) Then
@@ -920,9 +922,9 @@ Partial Class Inventarios_EntregaAlmacen
CveVentaSurtir = -1
CveOSSurtir = -1
If DtDatos.SUM("CantidadS") <= 0 Then
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario gvEscondeColumna"
GvDatos.CssClass = "table table-striped table-hover Widthall gvInventario gvEscondeColumna"
Else
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario"
GvDatos.CssClass = "table table-striped table-hover Widthall gvInventario"
End If
If CveAlmacenTraspasoDestino > 0 Then
@@ -1000,9 +1002,16 @@ Partial Class Inventarios_EntregaAlmacen
End If
If AplicaSeccion Then GvDatos.Columns(7).Visible = True
If AplicaLote Then GvDatos.Columns(8).Visible = True
If AplicaCaducidad Then GvDatos.Columns(9).Visible = True
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvDatos.Columns(9).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
If AplicaLote Then GvDatos.Columns(9).Visible = True
If AplicaCaducidad Then GvDatos.Columns(10).Visible = True
If AplicaLote Or AplicaCaducidad Then
GvDatos.Columns(8).Visible = True
End If
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then
GvDatos.Columns(10).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
End If
'GvDatos.Columns(9).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) <> "", UsuarioActual.Empresa.Funcionalidad(147), "")
'SugerirFecha()
@@ -1117,24 +1126,29 @@ Partial Class Inventarios_EntregaAlmacen
End If
Else
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False
End If
End If
Dim DvFechaCaducidad As HtmlGenericControl = TryCast(e.Row.FindControl("DvFechaCaducidad"), HtmlGenericControl)
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
DvFechaCaducidad.Visible = True
' e.Row.FCTextBox("TxtCaducidad").Visible = True
'e.Row.FCLinkButton("LnkCaducidad").Visible = True
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
'CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
If (e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha) OrElse UsuarioActual.TienePermisoProceso(364) OrElse UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
e.Row.FCTextBox("TxtCaducidad").Enabled = True
'CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
'e.Row.FCTextBox("TxtCaducidad").Enabled = True
End If
Else
e.Row.FCTextBox("TxtCaducidad").Visible = False
e.Row.FCLinkButton("LnkCaducidad").Visible = False
e.Row.FCTextBox("TxtCaducidad").Enabled = True
'e.Row.FCTextBox("TxtCaducidad").Visible = False
'e.Row.FCLinkButton("LnkCaducidad").Visible = False
'e.Row.FCTextBox("TxtCaducidad").Enabled = True
DvFechaCaducidad.Visible = False
End If
If CBool(e.Row.DBCampo("AplicaLote")) Then
@@ -1190,8 +1204,60 @@ Partial Class Inventarios_EntregaAlmacen
End If
If Boolean.Parse(e.Row.DataKey("AplicaLote")) Or Boolean.Parse(e.Row.DataKey("AplicaCaducidad")) Then
CargarCaducidadProducto(e.Row.DataKey("CvePS").ToEntero, e.Row.FCDropDownList("DdlCaducidadProducto"))
End If
End If
End Sub
Protected Sub DdlCaducidadProducto_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, DropDownList)).NamingContainer, GridViewRow)
Dim AplicaLote As Boolean = Boolean.Parse(GvRow.DataKey("AplicaLote"))
Dim AplicaCaducidad As Boolean = Boolean.Parse(GvRow.DataKey("AplicaCaducidad"))
Dim DdlCaducidadProducto As DropDownList = GvRow.FCDropDownList("DdlCaducidadProducto")
Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c)
Dim Lote As String = ArrayCaducidad(0)
Dim FechaCaducidad As String = ArrayCaducidad(1)
If AplicaLote Then
GvRow.FCTextBox("TxtLote").Text = Lote
End If
If AplicaCaducidad Then
GvRow.FCTextBox("TxtCaducidad").Text = FechaCaducidad
End If
UpDatos.Update()
End Sub
Private Sub CargarCaducidadProducto(CvePS As Integer, ByRef DdlLoteFechaCaducidad As DropDownList)
Dim almacenes As String = DdlAlmacen.SelectedValue
If almacenes = "" Then
almacenes = "-1"
End If
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
For Each dr As DataRow In ObjInventarios.DtResultados.Rows
DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} - Caducidad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"))
Next
End If
ObjInventarios.Dispose()
End Sub
Private Sub CargaDocumentos(tCveVenta As Integer)
@@ -4458,6 +4524,8 @@ Partial Class Inventarios_EntregaAlmacen
Return Respuesta
End Function
End Function
End Class

View File

@@ -499,7 +499,7 @@
</div>--%>
GvDatosDesarmado
</div>

View File

@@ -98,7 +98,7 @@
<label class="col-md-1 ">Estatus:</label>
<div class="col-md-1" >
<asp:DropDownList ID="DdlEstatusOS" runat="server" AppendDataBoundItems="true" Width="110px"
<asp:DropDownList ID="DdlEstatusOS" runat="server" AppendDataBoundItems="true" Width="100%"
DataTextField="EstatusOrdenServicio" DataValueField="CveEstatusOrdenServicio" Class="input-sm select2me">
</asp:DropDownList>
</div>
@@ -109,11 +109,11 @@
</div>
</div>
<div class="portlet-body" style="display: none">
<div class="row">
<label class="col-md-1 ">Técnico:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlTecnico" ClientIDMode="Static" CssClass="form-control input-sm select2me" runat="server" DataTextField="Nombre" DataValueField="CveUsuario" Width="110px" ></asp:DropDownList>
</div>
<div class="row">
<label class="col-md-1 ">Técnico:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlTecnico" ClientIDMode="Static" CssClass="form-control input-sm select2me" runat="server" DataTextField="Nombre" DataValueField="CveUsuario" Width="110px"></asp:DropDownList>
</div>
<asp:Label ID="LblProyecto" runat="server" class="col-md-1 truncate">Proyecto:</asp:Label>
<div runat="server" id="DivProyecto" class="col-md-1">
@@ -121,38 +121,44 @@
</div>
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
<div runat="server" id="DivSubProyecto" class="col-md-1">
<asp:DropDownList ID="DdlSubProyecto" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass=" input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
<asp:DropDownList ID="DdlSubProyecto" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass=" input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
</div>
<label class="col-md-1 ">Médico:</label>
<label class="col-md-1 ">Médico:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlMedico" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Medico" DataValueField="CveMedico" Width="100%">
<asp:ListItem Value="-1">Todos</asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 ">Especialidad:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlEspecialidad" CssClass="form-control input-sm select2me" runat="server" DataTextField="Especialidad" Width="100%" DataValueField="CveMedicoEspecialidad"></asp:DropDownList>
</div>
<label class="col-md-1 ">Procedimiento:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlProcedimiento" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento" Width="100%">
<asp:ListItem Value="-1">Todos</asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="row">
<label class="col-md-1 ">Hospital:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlMedico" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Medico" DataValueField="CveMedico" Width="100%" >
<asp:ListItem Value="-1">Todos</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DdlClienteSucursal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveClienteSucursal" CausesValidation="true" Width="100%" >
</asp:DropDownList>
</div>
<label class="col-md-1 ">Procedimiento:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlProcedimiento" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento" Width="100%" >
<asp:ListItem Value="-1">Todos</asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="row">
</div>
<div class="row">
</div>
<div class="row">
</div>
</div>
</div>

View File

@@ -80,6 +80,48 @@ Partial Class OS_RepOSMedicas
DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlProcedimiento.DataBind()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetMedicosEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then
DdlEspecialidad.DataSource = ObjVentas.DtResultados
Else
DdlEspecialidad.DataSource = Nothing
End If
ObjVentas.Dispose()
DdlEspecialidad.DataBind()
DdlEspecialidad.Items.Insert(0, New ListItem("Todas", "-1"))
Dim objcliente As New ClsClientes
If objcliente.GetClienteSucursales(-1, UsuarioActual.CveEmpresa) Then
DdlClienteSucursal.DataSource = objcliente.DtResultados
Else
DdlClienteSucursal.DataSource = Nothing
End If
objcliente.Dispose()
DdlClienteSucursal.DataBind()
DdlClienteSucursal.Items.Insert(0, New ListItem("Todos", "-1"))
'Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
'If EsWS Then
' DdlCliente.setEsWebService(True)
'Else
' DdlCliente.setEsWebService(False)
' DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
' DdlCliente.DataBind()
' DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
'End If
End Sub
@@ -101,7 +143,8 @@ Partial Class OS_RepOSMedicas
LnkPersonalizar.Visible = False
If ObjOS.GetRepOrdenesServicioMedicasRep(FechaI, FechaF, Cvecliente, DdlVendedor.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa,
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero) Then
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveEspecialidad:=DdlEspecialidad.SelectedValue.ToEntero,
CveClienteSucursal:=DdlClienteSucursal.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjOS.DtResultados
If ObjOS.DtResultados IsNot Nothing AndAlso ObjOS.DtResultados.Rows.Count > 0 Then
LnkPersonalizar.Visible = True

View File

@@ -337,7 +337,7 @@ Partial Class Ventas_PVCobranza
PnlContado.Visible = False
ObjConta.Commit()
CargaDatos()
Alert("Pago Registrado correctamente.<br/><br/> <a href='#' class='Texto'>Imprimir ticket</a>", TipoMensaje.MsgInformacion)
Alert($"Pago Registrado correctamente.<br/><br/> <a href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta))}"" class='Texto'>Imprimir ticket</a>", TipoMensaje.MsgInformacion)
Else
ObjConta.RollBack()
End If

View File

@@ -612,13 +612,13 @@
<b>Paciente:</b>
</td>
<td runat="server">
<asp:TextBox ID="TxtPaciente" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="50"></asp:TextBox>
<asp:TextBox ID="TxtPaciente" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="50"></asp:TextBox>
</td>
<td runat="server" id="Td9" visible="true">
<b>Episodio:</b>
</td>
<td runat="server">
<asp:TextBox ID="TxtEpisodio" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="20"></asp:TextBox>
<asp:TextBox ID="TxtEpisodio" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="20"></asp:TextBox>
</td>
</tr>
</table>
@@ -1183,7 +1183,7 @@
<%--</asp:Panel>--%>
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False"
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,Clasificacion,CveUM,UM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle,CvePromocionDetalle"
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,Clasificacion,CveUM,UM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,ImporteIVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle,CvePromocionDetalle"
CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
<Columns>
<%--0--%>
@@ -1404,6 +1404,8 @@
<%--19--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkDescuentos" runat="server" Visible="false" AlternateText="Clonar" CausesValidation="False" CommandName="Descuento" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-comment-o'></i>" />
<asp:LinkButton ID="imgClone" runat="server" AlternateText="Clonar" CausesValidation="False" CommandName="Clonar" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-clone'></i>" />
</ItemTemplate>
@@ -4319,6 +4321,83 @@
</div>
</div>
</div>
<div id="ModalDescPS" class="modal ADS fade" role="dialog">
<asp:UpdatePanel runat="server" ID="UpDescPS" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="LblTituloDesc" runat="server" ClientIDMode="Static" Text="Descuento:"></asp:Label>
</h4>
</div>
<div class="modal-body">
<asp:HiddenField ID="HdnDescPS" runat="server" ClientIDMode="Static" Value="0" />
<asp:HiddenField ID="HdnConsecPS" runat="server" ClientIDMode="Static" Value="-1" />
<asp:HiddenField ID="HdnTotalCompra" runat="server" ClientIDMode="Static" Value="0" />
<table style="width: 90%">
<tr>
<td>SubTotal</td>
<td>
<asp:Label ID="LblSubtotalDescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
</td>
<td>Total</td>
<td>
<asp:Label ID="LblTotalDescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
</td>
</tr>
<tr>
<td>% Descuento</td>
<td>
<asp:TextBox ID="TxtPorPS" runat="server" CausesValidation="true" ClientIDMode="Static" MaxLength="12" Text="0" ValidationGroup="GrpDescuentoP" Width="72px"></asp:TextBox>
<asp:CompareValidator ID="CVPorPS" runat="server" ControlToValidate="TxtPorPS" Display="None" ErrorMessage="El campo <b>''Descuento por Porcentaje''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="GrpPorPS"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCEPorPS" runat="server" HighlightCssClass="vco" TargetControlID="CVPorPS" Width="300px"></ajax:ValidatorCalloutExtender>
&nbsp;(%)
</td>
<td>IVA</td>
<td>
<asp:Label ID="LblIVADescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
</td>
</tr>
<tr>
<td>
<b>
<asp:Label runat="server" ClientIDMode="Static" Text="Descuento"></asp:Label>
</b>
</td>
<td><b>
<asp:Label ID="LblDescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label></b></td>
<td>
<b>
<asp:Label runat="server" ClientIDMode="Static" Text="% Utilidad"></asp:Label>
</b>
</td>
<td><b>
<asp:Label ID="LblUtilidadPorcentaje" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label></b></td>
</tr>
<tr>
<td></td>
<td></td>
<td><b>Total Final</b></td>
<td>
<b>
<asp:Label ID="LblTotalFinalDescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label></b>
</td>
</tr>
</table>
</div>
<div class="modal-footer">
<asp:Button ID="BtnPorPS" runat="server" Text="Aplicar" ValidationGroup="GrpPorPS" CssClass="btn btn-primary" OnClick="BtnPorPS_Click" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="DivAnticipos" class="modal ADS fade" role="dialog">
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" class="modal-dialog">
<ContentTemplate>
@@ -8430,7 +8509,7 @@
<%--Cliente Sucursales --%>
<div runat="server" visible="False" id="DvModalTipoVentaPasoCliente">
<div runat="server" visible="False" id="DvModalTipoVentaClientesucursal">
<div class="row">
<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"
@@ -8444,8 +8523,17 @@
</div>
</div>
<%--Cliente Solo se usa para en PAgo Directo --%>
<div runat="server" visible="False" id="DvModalTipoVentaCliente">
<div class="row">
<div class="form-group col-md-12 form-md-line-input input-iconright" style="margin-top: -7px!important">
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClienteSucursal">Cliente:</asp:Label>
<ADS:Dropdownlost CssClassDdl="form-control select2me" ID="DdlClientesModal" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"
Style="margin-top: -5px!important" IncluyeTodos="false"></ADS:Dropdownlost>
</div>
</div>
</div>
<%--Medico Procedimiento--%>
@@ -8462,7 +8550,7 @@
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlMedicoModal">Médico:</asp:Label>
</div>
<div class="form-group col-md-1 form-md-line-input input-iconright ">
<asp:LinkButton runat="server" ID="LnkAddMedicoModal" OnClick="LnkAddMedicoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" style="margin-top:8px!important" ></asp:LinkButton>
<asp:LinkButton runat="server" ID="LnkAddMedicoModal" OnClick="LnkAddMedicoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" Style="margin-top: 8px!important"></asp:LinkButton>
</div>
<div class="form-group col-md-5 form-md-line-input input-iconright ">
<asp:DropDownList ID="DdlProcedimientoModal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento"
@@ -8476,7 +8564,7 @@
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlProcedimientoModal">Procedimiento:</asp:Label>
</div>
<div class="form-group col-md-1 form-md-line-input input-iconright ">
<asp:LinkButton runat="server" ID="LnkAddProcedimientoModal" OnClick="LnkAddProcedimientoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" style="margin-top:8px!important"></asp:LinkButton>
<asp:LinkButton runat="server" ID="LnkAddProcedimientoModal" OnClick="LnkAddProcedimientoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" Style="margin-top: 8px!important"></asp:LinkButton>
</div>
</div>
@@ -8517,9 +8605,9 @@
<asp:BoundField DataField="Abreviatura" HeaderText="UM">
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Precio" ItemStyle-Width="30px">
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Precio" ItemStyle-Width="30px">
<ItemTemplate>
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("Precio", "{0:N4}") %>' Style="text-align: right!important" Width="80px" Enabled="false"></asp:TextBox>
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("Precio", "{0:N4}") %>' Style="text-align: right!important" Width="80px" Enabled="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
@@ -8544,14 +8632,14 @@
<div id="DvModalAddMedico" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddMedico" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content" style="max-width:600px!important;max-height:505px!important">
<UserControl:AddMedico runat="server" ID="AddMedicoControl" />
<div class="modal-content" style="max-width: 600px!important; max-height: 505px!important">
<UserControl:AddMedico runat="server" ID="AddMedicoControl" />
</div>
<asp:Button ID="BtnRecargaMedicos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaMedicos_Click" />
<asp:HiddenField ID="HdnCveMedicoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
@@ -8560,22 +8648,22 @@
</asp:UpdatePanel>
</div>
<div id="DvModalAddProcedimiento" class="modal ADS fade" role="dialog">
<div id="DvModalAddProcedimiento" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddProcedimiento" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content" style="max-width:600px!important;max-height:505px!important">
<UserControl:AddProcedimiento runat="server" ID="AddProcedimientoControl" />
</div>
<asp:Button ID="BtnRecargaProcedimientos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaProcedimientos_Click" />
<asp:HiddenField ID="HdnCveProcedimientoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddProcedimiento" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content" style="max-width: 600px!important; max-height: 505px!important">
<UserControl:AddProcedimiento runat="server" ID="AddProcedimientoControl" />
</div>
<asp:Button ID="BtnRecargaProcedimientos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaProcedimientos_Click" />
<asp:HiddenField ID="HdnCveProcedimientoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
@@ -9657,6 +9745,46 @@
$("#LblSubTotal1").text($("#TxtSubTotal").val());
}
function CalculaDescPS() {
if ($get("TxtPorPS").value != "") {
var PorcentajeDescuento = parseFloat($get("TxtPorPS").value);
if (PorcentajeDescuento < 0 || PorcentajeDescuento > 99) {
alert("No se puede aplicar ese porcentaje de descuento");
return;
}
var subTotal = parseFloat($get("LblSubtotalDescPS").innerText.replace(",", "").replace(",", ""));
var Monto = parseFloat($get("LblTotalDescPS").innerText.replace(",", "").replace(",", ""));
var Total = Monto - ((Monto * PorcentajeDescuento) / 100);
$get("LblTotalFinalDescPS").innerText = formato_numero(Total, 2, '.', ',');
var TotalRedondeado = parseFloat($get("LblTotalFinalDescPS").innerText.replace(",", "").replace(",", ""));
var descuento = - ((TotalRedondeado - (subTotal * 1.16)) / 1.16);
$get("LblIVADescPS").innerText = formato_numero(((subTotal - descuento) * 0.16), 2, '.', ',');
$get("LblDescPS").innerText = formato_numero(descuento, 2, '.', ',');
$get("HdnDescPS").value = descuento;
var totalCompra = parseFloat($get("HdnTotalCompra").value);
if (totalCompra > 0) {
var utilidad = ((TotalRedondeado - totalCompra) / TotalRedondeado) * 100;
$get("LblUtilidadPorcentaje").innerText = formato_numero(utilidad, 2, '.', ',');
}
}
else {
$get("LblTotalFinalDescPS").innerText = "0.00";
$get("LblDescPS").innerText = "0.00";
$get("LblIVADescPS").innerText = "0.00";
$get("LblUtilidadPorcentaje").innerText = "0.00";
$get("HdnDescPS").innerText = "0.00";
}
}
function formato_numero(numero, decimales, separador_decimal, separador_miles) { // v2007-08-06
numero = parseFloat(numero);
if (isNaN(numero)) {
@@ -10501,17 +10629,17 @@
}
function fncRegargaMedicos(CveNuevoMedico) {
function fncRegargaMedicos(CveNuevoMedico) {
$("#HdnCveMedicoNuevo").val(CveNuevoMedico)
$('#BtnRecargaMedicos').click();
}
$("#HdnCveMedicoNuevo").val(CveNuevoMedico)
$('#BtnRecargaMedicos').click();
}
function fncRegargaProcedimientos(CveProcedimientoNuevo) {
function fncRegargaProcedimientos(CveProcedimientoNuevo) {
$("#HdnCveProcedimientoNuevo").val(CveProcedimientoNuevo)
$('#BtnRecargaProcedimientos').click();
}
$("#HdnCveProcedimientoNuevo").val(CveProcedimientoNuevo)
$('#BtnRecargaProcedimientos').click();
}
</script>

View File

@@ -539,6 +539,20 @@ Partial Class Ventas
End Get
End Property
Private Property CveClienteOS As Integer
Get
If ViewState("CveClienteOS") Is Nothing Then
ViewState("CveClienteOS") = -1
End If
Return ViewState("CveClienteOS").ToString().ToEntero()
End Get
Set(value As Integer)
ViewState("CveClienteOS") = value
End Set
End Property
Private Property CveClienteSucursal As Integer
Get
If ViewState("CveClienteSucursal") Is Nothing Then
@@ -2567,6 +2581,7 @@ Partial Class Ventas
TabAlmacen.Enabled = UsuarioActual.Empresa.UsaInventarios
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
TxtPorPS.Attributes.Add("onKeyUp", "CalculaDescPS();")
CreaDTmpC()
CreaDTmpF()
@@ -8245,6 +8260,10 @@ Partial Class Ventas
e.Row.FCLinkButton("imgE").Visible = True
End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso UsuarioActual.TienePermisoProceso(374) Then
e.Row.FCLinkButton("LnkDescuentos").Visible = True
End If
'If GvInv.Rows.Count > 0 AndAlso ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso e.Row.DataKey("CveVentaDetalle").ToString().ToEntero() > 0 Then
' e.Row.FCLinkButton("imgE").Enabled = False
' e.Row.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen."
@@ -23888,7 +23907,6 @@ Partial Class Ventas
Dim RowNum As Integer = Convert.ToInt32(e.CommandArgument)
Dim GvRow As GridViewRow = GvPS.Rows(RowNum)
If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then
TxtCantidad.Text = GvRow.FCTextBox("TxtCantidad").Text
DdlClasificacion.SelectedValue = GvRow.FCDropDownList("DdlClasificacion").SelectedValue
@@ -23914,6 +23932,32 @@ Partial Class Ventas
RegistraScript("Recalcula();")
LbAgregar_Click(Nothing, Nothing)
ElseIf e.CommandName = "Descuento" Then
LblSubtotalDescPS.Text = ""
LblTotalDescPS.Text = ""
LblTituloDesc.Text = "Descuento"
HdnConsecPS.Value = "-1"
HdnTotalCompra.Value = ""
TxtPorPS.Text = ""
LblIVADescPS.Text = ""
Dim GvRow As GridViewRow = GvPS.Rows(e.CommandArgument.ToString().ToEntero())
LblTituloDesc.Text = $"Descuento: {GvRow.DataKey("PS")}"
HdnConsecPS.Value = GvRow.DataKey("Consec")
LblSubtotalDescPS.Text = (GvRow.DataKey("Total").ToDecimal()).FormatoNumero()
LblTotalDescPS.Text = (GvRow.DataKey("Total").ToDecimal() + GvRow.DataKey("ImporteIVA").ToDecimal()).FormatoNumero()
LblIVADescPS.Text = GvRow.DataKey("ImporteIVA").FormatoNumero()
Using ObjPS As New ClsProductosServicios
Dim PrecioCompra = ObjPS.GetUltimoPrecioCompra(UsuarioActual.CveEmpresa, GvRow.DataKey("CvePS").ToEntero())
If PrecioCompra > 0 Then
HdnTotalCompra.Value = (PrecioCompra * GvRow.DataKey("Cantidad").ToDouble() * 1.16).ToString()
End If
End Using
UpDescPS.Update()
RegistraScript("$('#ModalDescPS').modal({backdrop: 'static', keyboard: false});")
Else
DdlPS_SelectedIndexChanged(Nothing, Nothing)
End If
@@ -36273,6 +36317,17 @@ Partial Class Ventas
DdlClienteSucursal.DataBind()
DdlClienteSucursal.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
If EsWS Then
DdlClientesModal.setEsWebService(True)
Else
DdlClientesModal.setEsWebService(False)
DdlClientesModal.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlClientesModal.DataBind()
DdlClientesModal.ddl.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
End If
End Sub
Protected Sub ChkRequiereTecnico_CheckedChanged(sender As Object, e As EventArgs)
@@ -36289,7 +36344,7 @@ Partial Class Ventas
If RBLTipoVenta.SelectedValue.ToEntero > 0 Then
DvModalTipoVentaPasoTipo.Visible = False
DvModalTipoVentaPasoCliente.Visible = True
DvModalTipoVentaClientesucursal.Visible = True
DvModalTipoVentaPasoRequiereOS.Visible = True
DvModalTipoVentaPasoMedicoProcedimiento.Visible = True
@@ -36315,6 +36370,7 @@ Partial Class Ventas
ChkRequiereTecnicoModal.Checked = True
ChkRequiereTecnicoModal.Enabled = False
DvModalRequiereOSFecha.Visible = True
DvModalTipoVentaCliente.Visible = True
Case "3" 'A-Vista
ChkRequiereTecnicoModal.Checked = False
DvModalTipoVentaPasoRequiereOS.Visible = False
@@ -36404,7 +36460,8 @@ Partial Class Ventas
LnkDvModalTipoVentaAceptar.Visible = False
DvModalTipoVentaPasoTipo.Visible = True
DvModalTipoVentaPasoCliente.Visible = False
DvModalTipoVentaClientesucursal.Visible = False
DvModalTipoVentaCliente.Visible = False
DvModalTipoVentaPasoRequiereOS.Visible = False
DvModalTipoVentaPasoMedicoProcedimiento.Visible = False
@@ -36437,15 +36494,35 @@ Partial Class Ventas
Protected Sub LnkDvModalTipoVentaAceptar_Click(sender As Object, e As EventArgs)
If RBLTipoVenta.SelectedValue.ToEntero = 2 Then
If DdlClientesModal.SelectedValue.ToEntero > 0 Then
ViewState("CveCliente") = DdlClientesModal.SelectedValue.ToEntero
Else
Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If DdlClienteSucursalCliente() > 0 Then
ViewState("CveCliente") = DdlClienteSucursalCliente()
If DdlClienteSucursalCliente() > 0 Then
CveClienteOS = DdlClienteSucursalCliente()
Else
Alert("Debe de seleccionar un hospital.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Else
Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
Exit Sub
If DdlClienteSucursalCliente() > 0 Then
ViewState("CveCliente") = DdlClienteSucursalCliente()
CveClienteOS = CveCliente
Else
Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
If ChkRequiereTecnicoModal.Checked Then
If Not IsDate(TxtFechaModal.Text.Replace(",", "")) Then
Alert("El campo fecha no es valido.", TipoMensaje.MsgAdvertencia)
@@ -36657,7 +36734,7 @@ Partial Class Ventas
Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero
If ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
If ObjOrdenServicio.AddOrdenesServicios(CveClienteOS, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVentaOS, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero,
Direccion:="", Telefono:="", CveModeloAuto:=-1, Año:="", CveMedico:=DdlMedico.SelectedValue.ToEntero,
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFechaOS.Text.Replace(",", "").ToDateTime,
@@ -36811,6 +36888,20 @@ Partial Class Ventas
Protected Sub TxtFechaAnticipoCliente_TextChanged(sender As Object, e As EventArgs)
CargaAnticipos(CveCliente)
End Sub
Protected Sub BtnPorPS_Click(sender As Object, e As EventArgs)
If HdnDescPS.Value.ToEntero() > 0 Then
Dim RowUpdate As DataRow = TmpDT.Select($"Consec = {HdnConsecPS.Value}").FirstOrDefault()
If RowUpdate IsNot Nothing Then
RowUpdate("Descuento") = HdnDescPS.Value.ToDecimal()
RowUpdate("ImporteIVA") = LblIVADescPS.Text.ToDecimal()
CalculaTotalesVenta()
RegistraScript("$('#ModalDescPS').modal('hide');")
End If
Else
Alert("No se pudo aplicar el descuento", TipoMensaje.MsgAdvertencia)
End If
End Sub
End Class