-merge
This commit is contained in:
@@ -585,6 +585,14 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpTurno" runat="server" UpdateMode="Conditional" class=" xspadding .nolineheight bordered whitoutcol" style="color: white;">
|
||||
<ContentTemplate>
|
||||
<div id="DivBloqueo" runat="server" style="width: 100%; text-align: center;" visible="false">
|
||||
<asp:Button ID="BtnBloquearAcceso" CssClass="btn red-haze btn-outline btn-circle btn-sm" runat="server" Text="Bloquear Turno" OnClick="BtnBloquearAcceso_Click" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -833,7 +841,7 @@
|
||||
<td>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:TextBox ID="TxtTotal" runat="server" ClientIDMode="Static" BorderStyle="None" Style="text-align: right; font-weight:bold" Text="0.00" Width="78px" ReadOnly="true"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtTotal" runat="server" ClientIDMode="Static" BorderStyle="None" Style="text-align: right; font-weight: bold" Text="0.00" Width="78px" ReadOnly="true"></asp:TextBox>
|
||||
<asp:HiddenField ID="HdnVentaSaldo" runat="server" ClientIDMode="Static" Value="0" />
|
||||
<asp:HiddenField ID="HdnTotalVenta" runat="server" ClientIDMode="Static" Value="0" />
|
||||
</ContentTemplate>
|
||||
@@ -1917,6 +1925,45 @@
|
||||
</asp:Panel>
|
||||
<!-- ModalPopupExtender -->
|
||||
|
||||
|
||||
<%-- ******************************************** Bloqueo de Caja *************************************************************************************************************************************** --%>
|
||||
|
||||
<asp:Button ID="BtnShowBloqueo" runat="server" Text="Show Modal Popup" Style="visibility: hidden; display: none;" />
|
||||
<asp:Button ID="BtnCloseBloqueo" runat="server" CssClass="btn btn-danger" Style="visibility: hidden; display: none;" Text="Cancelar" />
|
||||
|
||||
<!-- ModalPopupExtender -->
|
||||
<cc1:ModalPopupExtender ID="mpeBloque" runat="server" PopupControlID="PanelBloqueo" TargetControlID="BtnShowBloqueo"
|
||||
BackgroundCssClass="modalBackground">
|
||||
</cc1:ModalPopupExtender>
|
||||
|
||||
<asp:Panel ID="PanelBloqueo" runat="server" CssClass="modalPopup" align="center" Style="display: none">
|
||||
<table border="0" width="250px" cellspacing="1" style="background-color: White; padding-left: 10px;">
|
||||
<tr style="background-color: #3598dc; color: #FFFFFF; font-size: 14px; text-align:center">
|
||||
<td colspan="2"><asp:Label runat="server" Text="<i class='fa fa-lock fa-2 icontxt'></i> Acceso Restringido"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1"> </td>
|
||||
<td colspan="1"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1">
|
||||
<asp:Label runat="server" Text="Código de Acceso:" Font-Bold="true" Width="120px" />
|
||||
</td>
|
||||
<td colspan="1">
|
||||
<asp:TextBox ID="TxtCodigoAcceso" runat="server" type="password" ></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCodigoAcceso" runat="server" ControlToValidate="TxtCodigoAcceso" Display="None" ErrorMessage="<span class='has-error'><span id='username-error' class='help-block'>El campo <b>''Código de Acceso''</b> es necesario.</span></span>" ValidationGroup="GrpValidarCodigo"></asp:RequiredFieldValidator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1"> </td>
|
||||
<td colspan="1"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:Button ID="BtnCambiar" runat="server" CssClass="btn btn-success btn-sm" Text="Desbloquear" ValidationGroup="GrpValidarCodigo" OnClick="BtnCambiar_Click" />
|
||||
|
||||
</asp:Panel>
|
||||
<!-- ModalPopupExtender -->
|
||||
|
||||
<div id="DivEstadoCaja" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 470px; min-width: 470px;">
|
||||
<div class="modal-content">
|
||||
@@ -2656,6 +2703,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlMarcaPS" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%" OnSelectedIndexChanged="DdlMarcaPS_SelectedIndexChanged" AutoPostBack="true">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Marca (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlMarcaPS.ClientID.ToString()%>">Marca:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
@@ -2840,6 +2897,16 @@
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlMarcaPSAjuste" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%" OnSelectedIndexChanged="DdlMarcaPS_SelectedIndexChanged" AutoPostBack="true">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Marca (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlMarcaPSAjuste.ClientID.ToString()%>">Marca:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<ADS:Dropdownlost ID="DdlPSAjuste" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" runat="server" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange"></ADS:Dropdownlost>
|
||||
<asp:HiddenField ID="HdnPSAjusteMarca" ClientIDMode="Static" runat="server" Value="-1" />
|
||||
@@ -2868,7 +2935,7 @@
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEtiqueta" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
||||
<label for="<%= TxtEtiqueta.ClientID.ToString()%>">Etiqueta:</label>
|
||||
<label for="<%= TxtEtiqueta.ClientID.ToString()%>">Etiqueta:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2945,11 +3012,11 @@
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMesesUso" CssClass="form-control" runat="server" MaxLength="50" Enabled="false" style="font-weight:bold; font-size:20pt;"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtMesesUso" CssClass="form-control" runat="server" MaxLength="50" Enabled="false" Style="font-weight: bold; font-size: 20pt;"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMesesUso" runat="server" ControlToValidate="TxtMesesUso" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Meses de Uso''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEMesesUso" runat="server" HighlightCssClass="vco" TargetControlID="RFVMesesUso"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBEMesesUso" runat="server" TargetControlID="TxtMesesUso" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<label for="<%= TxtMesesUso.ClientID.ToString()%>" style="font-weight:bold">Meses de Uso:</label>
|
||||
<label for="<%= TxtMesesUso.ClientID.ToString()%>" style="font-weight: bold">Meses de Uso:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2974,11 +3041,11 @@
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPorcentajeAjuste" CssClass="form-control" Enabled="false" runat="server" MaxLength="50" style="font-weight:bold; font-size:20pt;"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtPorcentajeAjuste" CssClass="form-control" Enabled="false" runat="server" MaxLength="50" Style="font-weight: bold; font-size: 20pt;"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVPorcentajeAjuste" runat="server" ControlToValidate="TxtPorcentajeAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''% Ajuste''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEPorcentajeAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentajeAjuste"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBEPorcentajeAjuste" runat="server" TargetControlID="TxtPorcentajeAjuste" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<label for="<%= TxtPorcentajeAjuste.ClientID.ToString()%>" style="font-weight:bold">% Ajuste:</label>
|
||||
<label for="<%= TxtPorcentajeAjuste.ClientID.ToString()%>" style="font-weight: bold">% Ajuste:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3008,11 +3075,11 @@
|
||||
<div class="row" style="margin-top: 17px;">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtImporteAjuste" CssClass="form-control" runat="server" Enabled="false" MaxLength="50" ></asp:TextBox>
|
||||
<asp:TextBox ID="TxtImporteAjuste" CssClass="form-control" runat="server" Enabled="false" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVImporteAjuste" runat="server" ControlToValidate="TxtImporteAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEImporteAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporteAjuste"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBEImporteAjuste" runat="server" TargetControlID="TxtImporteAjuste" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>" style="font-weight:bold">Importe:</label>
|
||||
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>" style="font-weight: bold">Importe:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@@ -3046,6 +3113,20 @@
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
|
||||
// Get the input field
|
||||
var txtCodigoAcceso = document.getElementById("C_TxtCodigoAcceso");
|
||||
|
||||
// Execute a function when the user releases a key on the keyboard
|
||||
txtCodigoAcceso.addEventListener("keyup", function (event) {
|
||||
// Number 13 is the "Enter" key on the keyboard
|
||||
if (event.keyCode === 13) {
|
||||
// Cancel the default action, if needed
|
||||
event.preventDefault();
|
||||
// Trigger the button element with a click
|
||||
document.getElementById("C_BtnCambiar").click();
|
||||
}
|
||||
});
|
||||
|
||||
function ValidarCodigoEnsamble(source, arguments) {
|
||||
let CveMarca = HdnPSAjusteMarca.value;
|
||||
let CveClasificacion = HdnPSAjusteClasificacion.value;
|
||||
|
||||
@@ -9,6 +9,7 @@ Imports System.Security.Cryptography.X509Certificates
|
||||
Imports System.Globalization
|
||||
Imports System.Net.Http
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports ADSSession
|
||||
|
||||
Partial Class PV
|
||||
Inherits ClsPaginas
|
||||
@@ -1007,6 +1008,25 @@ Partial Class PV
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
|
||||
Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
|
||||
|
||||
If DrUsuario("CodigoAcceso").ToString() <> "" Then
|
||||
If UsuarioActual.SesionBloqueada Then
|
||||
DivBloqueo.Visible = False
|
||||
TxtCodigoAcceso.Focus()
|
||||
RegistraScript("window.onload = function MuestraBloqueo() { document.getElementById(""C_BtnShowBloqueo"").click(); setTimeout(function(){ $('#C_TxtCodigoAcceso').focus(); }, 1000); }")
|
||||
Else
|
||||
DivBloqueo.Visible = True
|
||||
End If
|
||||
Else
|
||||
DivBloqueo.Visible = False
|
||||
End If
|
||||
|
||||
Else
|
||||
DivBloqueo.Visible = False
|
||||
End If
|
||||
|
||||
DdlBPPS.setEsWebService(True)
|
||||
DdlBPPS.ddlWS.Attributes.Add("data-clear", "1")
|
||||
ViewState("ProcesoCorrecto") = True
|
||||
@@ -1116,6 +1136,8 @@ Partial Class PV
|
||||
CargarAlmacenes()
|
||||
CargaFormaEntrega()
|
||||
CargaCuentasTerminal()
|
||||
CargaMarcasFiltro()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
||||
CargaAjuste()
|
||||
RVPorDesc.MaximumValue = UsuarioActual.DescuentoAutorizado.ToString
|
||||
@@ -1231,6 +1253,21 @@ Partial Class PV
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaMarcasFiltro()
|
||||
|
||||
Using ObjMarcas As New ClsProductosServicios
|
||||
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||
DdlMarcaPS.DataSource = ObjMarcas.DtResultados
|
||||
DdlMarcaPSAjuste.DataSource = ObjMarcas.DtResultados
|
||||
End If
|
||||
End Using
|
||||
DdlMarcaPS.DataBind()
|
||||
DdlMarcaPSAjuste.DataBind()
|
||||
|
||||
UpModalVenta.Update()
|
||||
UpAjuste.Update()
|
||||
End Sub
|
||||
|
||||
Private Function CargaVenta() As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
'CARGA PARA FACTURACION
|
||||
@@ -2722,7 +2759,7 @@ Partial Class PV
|
||||
End If
|
||||
DdlClasificacion.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaAlmacen As Boolean = True)
|
||||
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaAlmacen As Boolean = True, Optional CveMarca As Integer = -1)
|
||||
Objeto.setEsWebService(UsuarioActual.Empresa.Funcionalidad(141).ToString = "1")
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
|
||||
Objeto.ddl.Items.Clear()
|
||||
@@ -2742,6 +2779,7 @@ Partial Class PV
|
||||
Objeto.ddlWS.Attributes.Add("data-pagina", "-1")
|
||||
End If
|
||||
Objeto.ddlWS.Attributes.Add("data-aplicaparaventa", "1")
|
||||
Objeto.ddlWS.Attributes.Add("data-cvemarca", CveMarca.ToString)
|
||||
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
|
||||
End If
|
||||
End Sub
|
||||
@@ -3038,6 +3076,18 @@ Partial Class PV
|
||||
|
||||
Protected Sub BtnEmitirImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitirImprimir.Click
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
|
||||
Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
|
||||
|
||||
If DrUsuario("CodigoAcceso").ToString() <> "" Then
|
||||
If UsuarioActual.SesionBloqueada Then
|
||||
Alert("Acceso denegado. La sesión se encuentra bloqueada", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If Not CveCliente > 0 Then
|
||||
Alert("Es necesario seleccionar el cliente al cual se le va a facturar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
@@ -7350,4 +7400,93 @@ Partial Class PV
|
||||
|
||||
Public Property Valido As Boolean
|
||||
End Class
|
||||
Protected Sub DdlMarcaPS_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), DdlPS, CveMarca:=DdlMarcaPS.SelectedValue.ToEntero())
|
||||
UpModalVenta.Update()
|
||||
End Sub
|
||||
Protected Sub DdlMarcaPSAjuste_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), DdlPSAjuste, CveMarca:=DdlMarcaPSAjuste.SelectedValue.ToEntero())
|
||||
UpAjuste.Update()
|
||||
End Sub
|
||||
Protected Sub BtnCambiar_Click(sender As Object, e As EventArgs)
|
||||
If String.IsNullOrEmpty(TxtCodigoAcceso.Text.Trim) Then
|
||||
Alert("Es necesario un código de acceso", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim CveUsuarioNuevo As Integer = -1
|
||||
|
||||
Using ObjUsuarios As New ClsSisUsuarios
|
||||
CveUsuarioNuevo = ObjUsuarios.ValidaUsuarioCodigoAcceso(TxtCodigoAcceso.Text.Trim, UsuarioActual.CveEmpresa)
|
||||
End Using
|
||||
|
||||
Dim DrUsuario As DataRow = Nothing
|
||||
|
||||
If CveUsuarioNuevo > 0 Then
|
||||
DrUsuario = GlobalDTUsuarios(CveUsuarioNuevo, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 1", "", {"CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol"}).Rows(0)
|
||||
End If
|
||||
|
||||
If DrUsuario IsNot Nothing Then
|
||||
|
||||
Dim tUsuario, tContraseña As String
|
||||
Dim tCveEmpresa As Integer
|
||||
tUsuario = DrUsuario("Usuario").ToString
|
||||
tContraseña = DrUsuario("Contraseña").ToString
|
||||
tCveEmpresa = DrUsuario("CveEmpresa").ToString.ToEntero
|
||||
|
||||
Dim ObjUsuario As New ClsSisUsuarios
|
||||
Dim Usuario As Usuario
|
||||
|
||||
Usuario = ObjUsuario.ValidaUsuario(tUsuario, tContraseña, IMEI, tCveEmpresa)
|
||||
|
||||
ObjUsuario.Dispose()
|
||||
|
||||
If Usuario IsNot Nothing Then
|
||||
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||
ADSSessionConfig.sessionUser = Usuario
|
||||
ADSSessionConfig.sessionUser.CvePlataforma = 1
|
||||
ADSSessionConfig.sessionDpage = False
|
||||
ADSSessionConfig.sessionUser.ModoSimulacion = False
|
||||
|
||||
If dt IsNot Nothing Then
|
||||
If dt.Rows.Count >= 1 Then
|
||||
If dt.Rows.Count > 1 Then ADSSessionConfig.sessionUser.MultipleEmpresa = True
|
||||
End If
|
||||
End If
|
||||
dt.Dispose()
|
||||
|
||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||
If ObjEmpresa.GetEmpresas(tCveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
If ObjEmpresa.GetEmpresasFuncionalidades(tCveEmpresa) Then
|
||||
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
|
||||
|
||||
Dim EmpresasFuncionalidades As New HybridDictionary
|
||||
For Each Row As Data.DataRow In dttmp.Rows
|
||||
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||
Next
|
||||
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||
|
||||
End If
|
||||
|
||||
UsuarioActual.Empresa = ObjEmpresa.Empresa
|
||||
ADSSessionConfig.sessionUser.CveEmpresa = ObjEmpresa.Empresa.CveEmpresa
|
||||
|
||||
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, ObjEmpresa.Empresa.CveEmpresa)
|
||||
End If
|
||||
ObjEmpresa.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
Response.Redirect($"~/Ventas/PV.aspx")
|
||||
Else
|
||||
Alert("No existe el código de acceso", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
Protected Sub BtnBloquearAcceso_Click(sender As Object, e As EventArgs)
|
||||
UsuarioActual.SesionBloqueada = True
|
||||
|
||||
Response.Redirect($"~/Ventas/PV.aspx")
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -15,7 +15,14 @@ Partial Class ProductosyServicios
|
||||
Return ViewState("CvePS").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property PSAdicionalAnterior As String
|
||||
Get
|
||||
Return ViewState("PSAdicionalAnterior").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("PSAdicionalAnterior") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveSATPS As Integer
|
||||
Get
|
||||
Return ViewState("CveSATPS").ToString.ToEntero
|
||||
@@ -1654,13 +1661,14 @@ Partial Class ProductosyServicios
|
||||
Private Sub GvPSAdicionales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPSAdicionales.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
e.Row.FCDropDownList("DdlPSAdicional").DataSource = GlobalDTPS(UsuarioActual.CveEmpresa) '.FiltraParametros("CvePS = " + CvePS.ToString)
|
||||
e.Row.FCDropDownList("DdlPSAdicional").DataBind()
|
||||
e.Row.FCDropDownList("DdlPSAdicional").SelectedValue = e.Row.DBCampo("CvePSAdicional")
|
||||
End If
|
||||
|
||||
End If
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
e.Row.FCDropDownList("DdlPSAdicional").DataSource = GlobalDTPS(UsuarioActual.CveEmpresa) '.FiltraParametros("CvePS = " + CvePS.ToString)
|
||||
e.Row.FCDropDownList("DdlPSAdicional").DataBind()
|
||||
e.Row.FCDropDownList("DdlPSAdicional").SelectedValue = e.Row.DBCampo("CvePSAdicional")
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvPSAdicionales_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvPSAdicionales.RowCancelingEdit
|
||||
GvPSAdicionales.EditIndex = -1
|
||||
@@ -1670,10 +1678,13 @@ Partial Class ProductosyServicios
|
||||
Dim TieneError = False
|
||||
|
||||
Dim CvePSAdicional = GvPSAdicionales.Rows(e.RowIndex).DataKey("CvePSAdicional").ToEntero
|
||||
Dim PSAdicional = GvPSAdicionales.Rows(e.RowIndex).DataKey("PS").ToString
|
||||
|
||||
Dim ObjProductosServicios As New ClsProductosServicios()
|
||||
If Not ObjProductosServicios.RemovePSAdicionales(CvePS, CvePSAdicional) Then
|
||||
TieneError = True
|
||||
Else
|
||||
TieneError = EliminarProductosEquivalenteEnFranquicia(ObjProductosServicios, PSAdicional)
|
||||
End If
|
||||
ObjProductosServicios.Dispose()
|
||||
|
||||
@@ -1720,7 +1731,7 @@ Partial Class ProductosyServicios
|
||||
If Not ObjProductosServicios.UpdatePSAdicionales(CvePS, DdlPSAdicional.SelectedValue.ToEntero, CvePSAdicional, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||
TieneError = True
|
||||
Else
|
||||
TieneError = GuardarProductosEquivalenteEnFranquicia(ObjProductosServicios, False)
|
||||
TieneError = GuardarProductosEquivalenteEnFranquicia(ObjProductosServicios, False, PSAdicionalAnterior)
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -1743,6 +1754,7 @@ Partial Class ProductosyServicios
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
BtnAgregarPSAdicional.Text = "Guardar"
|
||||
TxtCantidadPSAdicional.Text = GvRow.DataKey("Cantidad")
|
||||
PSAdicionalAnterior = GvRow.DataKey("PS").ToString
|
||||
|
||||
If TxtCantidadPSAdicional.Text.ToEntero = 0 Then
|
||||
UpCantidad.Visible = False
|
||||
@@ -2936,7 +2948,7 @@ Partial Class ProductosyServicios
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Function GuardarProductosEquivalenteEnFranquicia(ObjPS As ClsProductosServicios, Agregar As Boolean) As Boolean
|
||||
Private Function GuardarProductosEquivalenteEnFranquicia(ObjPS As ClsProductosServicios, Agregar As Boolean, Optional PSAdicionalAnterior As String = "") As Boolean
|
||||
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
|
||||
|
||||
Dim StrEmpresas As String = UsuarioActual.Empresa.Funcionalidad(563)
|
||||
@@ -2949,7 +2961,7 @@ Partial Class ProductosyServicios
|
||||
Alert(String.Format("El producto de la página no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
If CvePSPagina <= 0 Then
|
||||
If CvePSAdicional <= 0 Then
|
||||
Alert(String.Format("El producto adicional no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
@@ -2958,16 +2970,36 @@ Partial Class ProductosyServicios
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
Dim PSAnterior As String = GlobalDTPS(Franquicia).FiltroPrimeroValor("PS", String.Format("CvePS = '{0}'", CvePSAdicional))
|
||||
Dim CvePSAnterio As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("PS = '{0}'", PSAnterior)).ToEntero
|
||||
Dim CvepsAdicionalAnt As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("PS = '{0}'", PSAdicionalAnterior)).ToEntero
|
||||
|
||||
If Not ObjPS.UpdatePSAdicionales(CvePSPagina, CvePSAdicional, CvePSAnterio, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||
Return True
|
||||
If CvepsAdicionalAnt <= 0 Then
|
||||
Alert(String.Format("El producto adicional no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
If Not ObjPS.UpdatePSAdicionales(CvePSPagina, CvePSAdicional, CvepsAdicionalAnt, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
|
||||
Private Function EliminarProductosEquivalenteEnFranquicia(ObjPS As ClsProductosServicios, PSAdicional As String) As Boolean
|
||||
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
|
||||
Dim StrEmpresas As String = UsuarioActual.Empresa.Funcionalidad(563)
|
||||
Dim EmpresasFranquicia As List(Of Integer) = StrEmpresas.Split(","c).ToList().ConvertAll(Function(x) Convert.ToInt32(x))
|
||||
For Each Franquicia As Integer In EmpresasFranquicia
|
||||
Dim CvepsAdicional As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("PS = '{0}'", PSAdicional)).ToEntero
|
||||
Dim CvePSPagina As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", TxtCodigo.Text.Trim)).ToEntero
|
||||
If Not ObjPS.RemovePSAdicionales(CvePSPagina, CvepsAdicional) Then
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
End Class
|
||||
|
||||
@@ -341,11 +341,39 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
If AnioMes.Trim.Length = 7 Then
|
||||
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
|
||||
FechaFtemporal = $"01/{AnioMes.Substring(5, 2).PadLeft(2, "0"c)}/{AnioMes.Substring(0, 4)}"
|
||||
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
|
||||
|
||||
If FechaF = "-1" Then
|
||||
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
|
||||
Else
|
||||
Dim FechaFRef As DateTime = FechaF.ToDateTime
|
||||
Dim FechaFMonth As DateTime = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day).ToDate()
|
||||
|
||||
If FechaFRef > FechaFMonth Then
|
||||
txtFechaF.Text = FechaFMonth.ToString("dd/MM/yyyy")
|
||||
Else
|
||||
txtFechaF.Text = FechaFRef.ToString("dd/MM/yyyy")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
|
||||
FechaFtemporal = $"01/{AnioMes.Substring(5, 1).PadLeft(2, "0"c)}/{AnioMes.Substring(0, 4)}"
|
||||
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
|
||||
|
||||
If FechaF = "-1" Then
|
||||
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
|
||||
Else
|
||||
Dim FechaFRef As DateTime = FechaF.ToDateTime
|
||||
Dim FechaFMonth As DateTime = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day).ToDate
|
||||
|
||||
If FechaFRef > FechaFMonth Then
|
||||
txtFechaF.Text = FechaFMonth.ToString("dd/MM/yyyy")
|
||||
Else
|
||||
txtFechaF.Text = FechaFRef.ToString("dd/MM/yyyy")
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user