Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -343,7 +343,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
TieneError = ActualizarPreciosFranquicia(ObjPS, row.DataKey("Codigo"), row.DataKey("PS"), row.FCTextBox("TxtPrecio").Text.ToDecimal, row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal, DdlPrecioLista.SelectedItem.Text)
|
||||
TieneError = ActualizarPreciosFranquicia(ObjPS, row.DataKey("Codigo"), row.FCTextBox("TxtPrecio").Text.ToDecimal, row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal, DdlPrecioLista.SelectedItem.Text)
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
@@ -603,7 +603,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
Correcto = ObjPS.UpdatePSPreciosLista(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
|
||||
If Correcto Then
|
||||
RowsCargados += 1
|
||||
TieneError = ActualizarPreciosFranquicia(ObjPS, row(0).ToString(), row(1).ToString(), PrecioNuevo, 0, DdlPrecioListaCarga.SelectedItem.Text)
|
||||
TieneError = ActualizarPreciosFranquicia(ObjPS, row(0).ToString(), PrecioNuevo, 0, DdlPrecioListaCarga.SelectedItem.Text)
|
||||
End If
|
||||
Else
|
||||
If CvePS > 0 AndAlso CvePrecioLista = -2 Then
|
||||
@@ -652,7 +652,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ActualizarPreciosFranquicia(ObjPS As ClsProductosServicios, Codigo As String, PS As String, Precio As Decimal, PrecioMinimo As Decimal, PrecioLista As String) As Boolean
|
||||
Private Function ActualizarPreciosFranquicia(ObjPS As ClsProductosServicios, Codigo As String, Precio As Decimal, PrecioMinimo As Decimal, PrecioLista As String, Optional UpdatePrecioMinimo As Boolean = True) As Boolean
|
||||
Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(563)
|
||||
Dim StrMsg As New StringBuilder
|
||||
Dim StrMsgError As New StringBuilder
|
||||
@@ -674,7 +674,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
' Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
|
||||
' StrMsg.AppendFormat("El precio lista '{0}' no existe en la Franquicia '{1}'<br/>", DdlPrecioLista.SelectedItem.Text, EmpresaFranquicia)
|
||||
'End If
|
||||
If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, NowADS(), If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=PrecioMinimo) Then
|
||||
If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, NowADS(), If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=If(UpdatePrecioMinimo, PrecioMinimo, 0)) Then
|
||||
StrMsgError.AppendFormat("No se pudo actualizar el producto")
|
||||
End If
|
||||
Next
|
||||
@@ -960,7 +960,9 @@ Partial Class Ventas_ActualizarPrecios
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub LnkGuardarMultiple_Click(sender As Object, e As EventArgs)
|
||||
Dim TieneError As Boolean = False
|
||||
Dim TieneError As Boolean = False
|
||||
|
||||
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
ObjPS.IniciaTransacSQL()
|
||||
@@ -984,6 +986,28 @@ Partial Class Ventas_ActualizarPrecios
|
||||
|
||||
TieneError = Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLista, 0, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
|
||||
|
||||
If Not TieneError Then
|
||||
|
||||
Dim text As String = DtPreciosMultiple.Columns(indiceColumna).ColumnName
|
||||
Dim splitValues As String() = text.Split("|"c)
|
||||
|
||||
If splitValues.Length > 1 Then
|
||||
|
||||
Dim PrecioLista As String = splitValues(1)
|
||||
|
||||
Dim DrPS = DtPS.FiltroPrimero($"CvePS = {CvePS}")
|
||||
If DrPS IsNot Nothing Then
|
||||
TieneError = ActualizarPreciosFranquicia(ObjPS, DrPS("Codigo").ToString(), Precio, 0, PrecioLista, UpdatePrecioMinimo:=False)
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If TieneError Then
|
||||
Exit For
|
||||
End If
|
||||
|
||||
@@ -346,7 +346,7 @@
|
||||
<table>
|
||||
<td style="white-space: nowrap;">Fecha Emisión:</td>
|
||||
<td>
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaEmision" runat="server" CssClass="form-control"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="LnkImgTxtFechaEmision" class="btn default"><i class="fa fa-calendar"></i></asp:LinkButton>
|
||||
|
||||
@@ -618,7 +618,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
Dim FechaEmision As Date = MinFecha
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
If ChkComplementoPago.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
FechaEmision = TxtFechaEmision.Text.ToDate
|
||||
|
||||
If FechaEmision <= MinFecha Then
|
||||
|
||||
@@ -24,6 +24,16 @@
|
||||
<li>
|
||||
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
|
||||
</li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpAccionezPersonalizar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPErsonalizar" OnClick="LnkPErsonalizar_Click" runat="server"><i class="fa fa-pencil"></i>Personalizar Columnas</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
@@ -210,7 +220,7 @@
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFAplicadoF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaAplicadoF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<label id="lblEsDistribuidor" runat="server" visible="false" class="col-md-1 truncate">Es Distribuidor:</label>
|
||||
<div class="col-md-2" id="divEsDistribuidor" runat="server" visible="false">
|
||||
<asp:DropDownList ID="DdlDistribuidor" runat="server" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
@@ -269,10 +279,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="99%" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas" CssClass="ScrollAD table table-striped table-hover Widthall" data-heighterror="320" data-freezecols="0" data-freezerows="0" GridLines="None"
|
||||
DataKeyNames="CveVenta">
|
||||
<Columns>
|
||||
@@ -291,10 +304,27 @@
|
||||
<asp:BoundField HeaderText="Dias Pago" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.##}" DataField="DiasPagados" />
|
||||
<asp:BoundField HeaderText="Forma Pago" DataField="TipoTransaccion" />
|
||||
<asp:BoundField HeaderText="MSI" DataField="MesesSinIntereses" />
|
||||
|
||||
|
||||
<asp:BoundField HeaderText="Sucursal Cliente" DataField="SucursalCliente" />
|
||||
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" />
|
||||
<asp:BoundField HeaderText="Descuento" DataField="Descuento" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" />
|
||||
<asp:BoundField HeaderText="Codigo" DataField="Codigo" />
|
||||
|
||||
<asp:BoundField HeaderText="Limite Credito" DataField="LimiteCredito" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField HeaderText="Ret IVA" DataField="RetIVA" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField HeaderText="Ret ISR" DataField="RetISR" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField HeaderText="Sub Total" DataField="SubTotal" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField HeaderText="T.C." DataField="TipoCambio" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField HeaderText="DescripcionVenta" DataField="DescripcionVenta" />
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpTipoCambio" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="DivTipoCambio" class="modal fade" role="dialog">
|
||||
@@ -329,6 +359,108 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div id="DivPersonalizar" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID="Label3" runat="server" ClientIDMode="Static" Text="Personalizar Columnas"></asp:Label></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<table class="table table-striped nobordertop table-advance table-hover">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkFolio" runat="server" Text=" Folio" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkFecha" runat="server" Text=" Fecha" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkSubTotal" runat="server" Text=" SubTotal" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkObservaciones" runat="server" Text=" Observaciones" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkDescuento" runat="server" Text=" Descuento" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkVendedor" runat="server" Text=" Vendedor" Checked="false" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkSucursal" runat="server" Text=" Sucursal" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkCodigo" runat="server" Text=" Código Cliente"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkLimiteCredito" runat="server" Text=" Limite Credito" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkRetIVA" runat="server" Text=" Ret. IVA" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkCliente" runat="server" Text=" Cliente" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkRetISR" runat="server" Text=" Ret. ISR" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkSucursalCliente" runat="server" Text=" Sucursal Cliente" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkTotal" runat="server" Text=" Total" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkDiasTranscurridos" runat="server" Text=" Días Transcurridos" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkDiasPago" runat="server" Text=" Dias Pago" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkTC" runat="server" Text=" Tipo Cambio" /></td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkMostrarDescripcionVenta" runat="server" Text=" Descripción Venta" Checked="false" /></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6" style="text-align: left">
|
||||
<asp:CheckBox ID="ChkGuardarPersonalizacion" runat="server" Text=" Guarda Personalización" TextAlign="Right" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<button type="button" class="btn btn-success" data-dismiss="modal" onclick="$('#BtnPersonalizar').click();">Personalizar</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpBtnPersonalizar" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnPersonalizar" Style="display: none" ClientIDMode="Static" runat="server" Text="Personalizar" class="btn btn-success" OnClick="BtnPersonalizar_Click" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -71,11 +71,22 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property Personalizo As Integer
|
||||
Get
|
||||
Return ViewState("Personalizo").ToString.ToEntero
|
||||
End Get
|
||||
|
||||
Set(value As Integer)
|
||||
ViewState("Personalizo") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaCombos()
|
||||
CargaPersonalizacion()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
@@ -373,5 +384,345 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
Else
|
||||
LiEspecifico.Visible = False
|
||||
End If
|
||||
End Sub
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "PERSONALIZAR"
|
||||
|
||||
Protected Sub LnkPErsonalizar_Click(sender As Object, e As EventArgs)
|
||||
ChkGuardarPersonalizacion.Checked = False
|
||||
RegistraScript("$('#DivPersonalizar').modal('show')")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs)
|
||||
|
||||
If ChkGuardarPersonalizacion.Checked Then
|
||||
GuardaPersonalizacion()
|
||||
End If
|
||||
|
||||
Personaliza()
|
||||
CargaDatos()
|
||||
'GvDatosDataBind()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub Personaliza()
|
||||
|
||||
GvDatos.Columns(0).Visible = True
|
||||
GvDatos.Columns(1).Visible = ChkFecha.Checked
|
||||
GvDatos.Columns(2).Visible = ChkFolio.Checked
|
||||
GvDatos.Columns(3).Visible = True
|
||||
GvDatos.Columns(4).Visible = ChkTotal.Checked
|
||||
GvDatos.Columns(5).Visible = True
|
||||
GvDatos.Columns(6).Visible = ChkSucursal.Checked
|
||||
GvDatos.Columns(7).Visible = True
|
||||
GvDatos.Columns(8).Visible = ChkCliente.Checked
|
||||
GvDatos.Columns(9).Visible = True
|
||||
GvDatos.Columns(10).Visible = True
|
||||
GvDatos.Columns(11).Visible = ChkDiasTranscurridos.Checked
|
||||
GvDatos.Columns(12).Visible = ChkDiasPago.Checked
|
||||
GvDatos.Columns(13).Visible = True
|
||||
GvDatos.Columns(14).Visible = True
|
||||
|
||||
GvDatos.Columns(15).Visible = ChkSucursalCliente.Checked
|
||||
GvDatos.Columns(16).Visible = ChkObservaciones.Checked
|
||||
GvDatos.Columns(17).Visible = ChkDescuento.Checked
|
||||
GvDatos.Columns(18).Visible = ChkVendedor.Checked
|
||||
GvDatos.Columns(19).Visible = ChkCodigo.Checked
|
||||
|
||||
GvDatos.Columns(20).Visible = ChkLimiteCredito.Checked
|
||||
GvDatos.Columns(21).Visible = ChkRetIVA.Checked
|
||||
GvDatos.Columns(22).Visible = ChkRetISR.Checked
|
||||
GvDatos.Columns(23).Visible = ChkSubTotal.Checked
|
||||
GvDatos.Columns(24).Visible = ChkTC.Checked
|
||||
GvDatos.Columns(25).Visible = ChkMostrarDescripcionVenta.Checked
|
||||
|
||||
|
||||
Personalizo = 1
|
||||
If Personalizo = 1 Then
|
||||
'ImgExcelPersonalizado.Visible = True
|
||||
Else
|
||||
'ImgExcelPersonalizado.Visible = False
|
||||
End If
|
||||
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub GuardaPersonalizacion()
|
||||
Dim objUsuario As New ClsSisUsuarios
|
||||
Dim ListPersonalizada As New List(Of String)
|
||||
|
||||
If ChkFolio.Checked Then
|
||||
ListPersonalizada.Add("Folio")
|
||||
End If
|
||||
|
||||
If ChkFecha.Checked Then
|
||||
ListPersonalizada.Add("Fecha")
|
||||
End If
|
||||
|
||||
If ChkSubTotal.Checked Then
|
||||
ListPersonalizada.Add("SubTotal")
|
||||
End If
|
||||
|
||||
If ChkObservaciones.Checked Then
|
||||
ListPersonalizada.Add("Observaciones")
|
||||
End If
|
||||
|
||||
If ChkDescuento.Checked Then
|
||||
ListPersonalizada.Add("Descuento")
|
||||
End If
|
||||
|
||||
If ChkVendedor.Checked Then
|
||||
ListPersonalizada.Add("Vendedor")
|
||||
End If
|
||||
|
||||
If ChkSucursal.Checked Then
|
||||
ListPersonalizada.Add("Sucursal")
|
||||
End If
|
||||
|
||||
If ChkCodigo.Checked Then
|
||||
ListPersonalizada.Add("Codigo")
|
||||
End If
|
||||
|
||||
If ChkLimiteCredito.Checked Then
|
||||
ListPersonalizada.Add("LimiteCredito")
|
||||
End If
|
||||
|
||||
If ChkRetIVA.Checked Then
|
||||
ListPersonalizada.Add("RetIVA")
|
||||
End If
|
||||
|
||||
If ChkCliente.Checked Then
|
||||
ListPersonalizada.Add("Cliente")
|
||||
End If
|
||||
|
||||
If ChkRetISR.Checked Then
|
||||
ListPersonalizada.Add("RetISR")
|
||||
End If
|
||||
|
||||
If ChkSucursalCliente.Checked Then
|
||||
ListPersonalizada.Add("SucursalCliente")
|
||||
End If
|
||||
|
||||
If ChkTotal.Checked Then
|
||||
ListPersonalizada.Add("Total")
|
||||
End If
|
||||
|
||||
If ChkDiasTranscurridos.Checked Then
|
||||
ListPersonalizada.Add("DiasTranscurridos")
|
||||
End If
|
||||
|
||||
If ChkDiasPago.Checked Then
|
||||
ListPersonalizada.Add("DiasPago")
|
||||
End If
|
||||
|
||||
If ChkTC.Checked Then
|
||||
ListPersonalizada.Add("TC")
|
||||
End If
|
||||
|
||||
If ChkMostrarDescripcionVenta.Checked Then
|
||||
ListPersonalizada.Add("MostrarDescripcionVenta")
|
||||
End If
|
||||
|
||||
If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "RepRecuperacionDetalle.aspx", String.Join("|", ListPersonalizada)) Then
|
||||
'Alert("Personalizacion guardada")
|
||||
End If
|
||||
|
||||
objUsuario.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPersonalizacion()
|
||||
Dim strBasePersonalizacion As String = UsuarioActual.Personalizaciones("RepRecuperacionDetalle.aspx")
|
||||
|
||||
If strBasePersonalizacion.Trim.Length > 0 Then
|
||||
|
||||
|
||||
Dim Personalizaciones As String() = strBasePersonalizacion.Split("|"c)
|
||||
|
||||
For Each personalizacion As String In Personalizaciones
|
||||
Select Case personalizacion
|
||||
Case "Folio"
|
||||
ChkFolio.Checked = True
|
||||
Case "Fecha"
|
||||
ChkFecha.Checked = True
|
||||
Case "SubTotal"
|
||||
ChkSubTotal.Checked = True
|
||||
Case "Observaciones"
|
||||
ChkObservaciones.Checked = True
|
||||
Case "Descuento"
|
||||
ChkDescuento.Checked = True
|
||||
Case "Vendedor"
|
||||
ChkVendedor.Checked = True
|
||||
Case "Sucursal"
|
||||
ChkSucursal.Checked = True
|
||||
Case "Codigo"
|
||||
ChkCodigo.Checked = True
|
||||
Case "LimiteCredito"
|
||||
ChkLimiteCredito.Checked = True
|
||||
Case "RetIVA"
|
||||
ChkRetIVA.Checked = True
|
||||
Case "Cliente"
|
||||
ChkCliente.Checked = True
|
||||
Case "RetISR"
|
||||
ChkRetISR.Checked = True
|
||||
Case "SucursalCliente"
|
||||
ChkSucursalCliente.Checked = True
|
||||
Case "Total"
|
||||
ChkTotal.Checked = True
|
||||
Case "DiasTranscurridos"
|
||||
ChkDiasTranscurridos.Checked = True
|
||||
Case "DiasPago"
|
||||
ChkDiasPago.Checked = True
|
||||
Case "TC"
|
||||
ChkTC.Checked = True
|
||||
Case "MostrarDescripcionVenta"
|
||||
ChkMostrarDescripcionVenta.Checked = True
|
||||
Case Else
|
||||
' Do nothing
|
||||
End Select
|
||||
Next
|
||||
|
||||
Personaliza()
|
||||
Else
|
||||
PersonalizaDefault()
|
||||
End If
|
||||
UPPersonalizar.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub PersonalizaDefault()
|
||||
ChkFolio.Checked = True
|
||||
ChkFecha.Checked = True
|
||||
ChkTotal.Checked = True
|
||||
ChkSucursal.Checked = True
|
||||
ChkCliente.Checked = True
|
||||
ChkDiasTranscurridos.Checked = True
|
||||
ChkDiasPago.Checked = True
|
||||
|
||||
|
||||
ChkSucursalCliente.Checked = False
|
||||
ChkSubTotal.Checked = False
|
||||
ChkObservaciones.Checked = False
|
||||
ChkDescuento.Checked = False
|
||||
ChkVendedor.Checked = False
|
||||
ChkCodigo.Checked = False
|
||||
ChkLimiteCredito.Checked = False
|
||||
ChkRetIVA.Checked = False
|
||||
ChkRetISR.Checked = False
|
||||
ChkTC.Checked = False
|
||||
ChkMostrarDescripcionVenta.Checked = False
|
||||
|
||||
GvDatos.Columns(0).Visible = True
|
||||
GvDatos.Columns(1).Visible = True
|
||||
GvDatos.Columns(2).Visible = True
|
||||
GvDatos.Columns(3).Visible = True
|
||||
GvDatos.Columns(4).Visible = True
|
||||
GvDatos.Columns(5).Visible = True
|
||||
GvDatos.Columns(6).Visible = True
|
||||
GvDatos.Columns(7).Visible = True
|
||||
GvDatos.Columns(8).Visible = True
|
||||
GvDatos.Columns(9).Visible = True
|
||||
GvDatos.Columns(10).Visible = True
|
||||
GvDatos.Columns(11).Visible = True
|
||||
GvDatos.Columns(12).Visible = True
|
||||
GvDatos.Columns(13).Visible = True
|
||||
GvDatos.Columns(14).Visible = True
|
||||
GvDatos.Columns(15).Visible = False
|
||||
GvDatos.Columns(16).Visible = False
|
||||
GvDatos.Columns(17).Visible = False
|
||||
GvDatos.Columns(18).Visible = False
|
||||
GvDatos.Columns(19).Visible = False
|
||||
GvDatos.Columns(20).Visible = False
|
||||
GvDatos.Columns(21).Visible = False
|
||||
GvDatos.Columns(22).Visible = False
|
||||
GvDatos.Columns(23).Visible = False
|
||||
GvDatos.Columns(24).Visible = False
|
||||
GvDatos.Columns(25).Visible = False
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
'Private Sub GuardaPersonalizacion()
|
||||
|
||||
' Dim objUsuario As New ClsSisUsuarios
|
||||
' Dim ListPersonalizada As New List(Of String)
|
||||
|
||||
' If ChkCantidad.Checked Then
|
||||
' ListPersonalizada.Add("Cantidad")
|
||||
' End If
|
||||
|
||||
' If ChkSubTotal.Checked Then
|
||||
' ListPersonalizada.Add("Subtotal")
|
||||
' End If
|
||||
|
||||
' If ChkDescuentos.Checked Then
|
||||
' ListPersonalizada.Add("Descuentos")
|
||||
' End If
|
||||
|
||||
' If ChkIVA.Checked Then
|
||||
' ListPersonalizada.Add("IVA")
|
||||
' End If
|
||||
|
||||
' If ChkTotal.Checked Then
|
||||
' ListPersonalizada.Add("Total")
|
||||
' End If
|
||||
|
||||
' If ChkSubTotal2.Checked Then
|
||||
' ListPersonalizada.Add("SubTotal2")
|
||||
' End If
|
||||
' If ChkIEPS.Checked Then
|
||||
' ListPersonalizada.Add("IEPS")
|
||||
' End If
|
||||
' If ChkRetIVA.Checked Then
|
||||
' ListPersonalizada.Add("RetIVA")
|
||||
' End If
|
||||
' If ChkRetISR.Checked Then
|
||||
' ListPersonalizada.Add("RetISR")
|
||||
' End If
|
||||
' If ChkImpLoc.Checked Then
|
||||
' ListPersonalizada.Add("ImpLoc")
|
||||
' End If
|
||||
' If ChkMinSub.Checked Then
|
||||
' ListPersonalizada.Add("MinSub")
|
||||
' End If
|
||||
' If ChkAVGSub.Checked Then
|
||||
' ListPersonalizada.Add("AVGSub")
|
||||
' End If
|
||||
' If ChkMaxSub.Checked Then
|
||||
' ListPersonalizada.Add("MaxSub")
|
||||
' End If
|
||||
' If ChkMaxTot.Checked Then
|
||||
' ListPersonalizada.Add("MaxTot")
|
||||
' End If
|
||||
' If ChkAvgTot.Checked Then
|
||||
' ListPersonalizada.Add("AvgTot")
|
||||
' End If
|
||||
' If ChkMinTot.Checked Then
|
||||
' ListPersonalizada.Add("MinTot")
|
||||
' End If
|
||||
' If CheckRefacturado.Checked Then
|
||||
' ListPersonalizada.Add("CheckRefacturado")
|
||||
' End If
|
||||
|
||||
' If ChkCantidad.Checked Then
|
||||
' ListPersonalizada.Add("Cantidad")
|
||||
' End If
|
||||
|
||||
|
||||
' If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "RepVentas.aspx", String.Join("|", ListPersonalizada)) Then
|
||||
' 'Alert("Personalizacion guardada")
|
||||
' End If
|
||||
|
||||
' objUsuario.Dispose()
|
||||
|
||||
'End Sub
|
||||
|
||||
Private Sub GvDatosDataBind()
|
||||
|
||||
GvDatos.DataSource = DtDatos
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
@@ -4409,6 +4409,7 @@
|
||||
<asp:HiddenField ID="HdnIVADescPS" 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" />
|
||||
<asp:HiddenField ID="HdnPorcentajeMaxDescPS" runat="server" ClientIDMode="Static" Value="100" />
|
||||
<table style="width: 90%">
|
||||
<tr>
|
||||
<td>SubTotal</td>
|
||||
@@ -10083,16 +10084,21 @@
|
||||
|
||||
function CalculaDescPS() {
|
||||
console.log("evento descuento");
|
||||
let ivaPor = parseFloat($get("HdnIVADescPS").value) ;
|
||||
|
||||
if ($get("TxtPorPS").value != "") {
|
||||
let PorcentajeDescuento = parseFloat($get("TxtPorPS").value);
|
||||
if (PorcentajeDescuento < 0 || PorcentajeDescuento > 100) {
|
||||
alert("No se puede aplicar ese porcentaje de descuento");
|
||||
let PorcentajeMaximoDescuento = parseFloat($get("HdnPorcentajeMaxDescPS").value);
|
||||
|
||||
if (PorcentajeDescuento < 0 || PorcentajeDescuento > PorcentajeMaximoDescuento) {
|
||||
alert("No se puede aplicar ese porcentaje de descuento. El porcentaje máximo permitido es del " + PorcentajeMaximoDescuento.toFixed(2) + "%.");
|
||||
$get("TxtPorPS").value = "0";
|
||||
$get("HdnDescPS").value = "0";
|
||||
LimpiarTotalDescPS(ivaPor);
|
||||
recalcularUtilidad(0);
|
||||
return;
|
||||
}
|
||||
let ivaPor = parseFloat($get("HdnIVADescPS").value) ;
|
||||
|
||||
|
||||
let subTotal = parseFloat($get("LblSubtotalDescPS").innerText.replace(",", "").replace(",", ""));
|
||||
|
||||
$get("LblDescPS").innerText = formato_numero(((subTotal * PorcentajeDescuento) / 100), 2, '.', ',');
|
||||
@@ -10111,20 +10117,24 @@
|
||||
|
||||
recalcularUtilidad(descuento)
|
||||
} else {
|
||||
let subTotal = parseFloat($get("LblSubtotalDescPS").innerText.replace(",", "").replace(",", ""));
|
||||
$get("LblIVADescPS").innerText = formato_numero((subTotal * ivaPor), 2, '.', ',');
|
||||
let importeIVA =parseFloat($get("LblIVADescPS").innerText.replace(",", "").replace(",", ""));
|
||||
let Total = (subTotal) + importeIVA;
|
||||
|
||||
$get("LblTotalFinalDescPS").innerText = formato_numero(Total, 2, '.', ',');
|
||||
$get("LblDescPS").innerText = "0.00";
|
||||
$get("LblUtilidadPorcentaje").innerText = "0.00";
|
||||
$get("HdnDescPS").innerText = "0.00";
|
||||
LimpiarTotalDescPS(ivaPor);
|
||||
|
||||
recalcularUtilidad(0);
|
||||
}
|
||||
}
|
||||
|
||||
function LimpiarTotalDescPS(ivaPor){
|
||||
let subTotal = parseFloat($get("LblSubtotalDescPS").innerText.replace(",", "").replace(",", ""));
|
||||
$get("LblIVADescPS").innerText = formato_numero((subTotal * ivaPor), 2, '.', ',');
|
||||
let importeIVA =parseFloat($get("LblIVADescPS").innerText.replace(",", "").replace(",", ""));
|
||||
let Total = (subTotal) + importeIVA;
|
||||
|
||||
$get("LblTotalFinalDescPS").innerText = formato_numero(Total, 2, '.', ',');
|
||||
$get("LblDescPS").innerText = "0.00";
|
||||
$get("LblUtilidadPorcentaje").innerText = "0.00";
|
||||
$get("HdnDescPS").innerText = "0.00";
|
||||
}
|
||||
|
||||
function recalcularUtilidad(descuento){
|
||||
let totalCompra = parseFloat($get("HdnTotalCompra").value);
|
||||
if (totalCompra > 0) {
|
||||
@@ -10667,8 +10677,8 @@
|
||||
var td;
|
||||
let idxHeader = 0;
|
||||
for (var key in item) {
|
||||
if (idxHeader == 0 && '<%= UsuarioActual.Empresa.Funcionalidad(382) %>' == '1') {
|
||||
tr.append('<td style="font-weight:bold;"> </td>');
|
||||
if (idxHeader == 0 && '<%= If(UsuarioActual.CveEmpresa = 189, "1", "") %>' == '1') {
|
||||
tr.append('<td style="font-weight:bold;"></td>');
|
||||
tr.append('<td style="font-weight:bold;"></td>');
|
||||
tr.append('<td style="font-weight:bold;"></td>');
|
||||
}
|
||||
@@ -10685,7 +10695,7 @@
|
||||
let idxColumn = 0;
|
||||
for (var key in item) {
|
||||
|
||||
if (idxColumn == 0 && '<%= UsuarioActual.Empresa.Funcionalidad(382) %>' == '1') {
|
||||
if (idxColumn == 0 && '<%= If(UsuarioActual.CveEmpresa = 189, "1", "") %>' == '1') {
|
||||
let tdExistencia = '<a href="javascript:void(0);" title="Ver existencias" onclick="javascript:AbrirVentana(' + "'/Inventarios/PopUpExistenciasAlmacen.aspx?CvePS=" + item.id + "'" + ", 800, 547," + "'N'" + ",'PopUpBuscar');$('#C_Tab_TabGenerales_DdlPS > select').select2('close');" + '"> <img style="width:15px; height: 13px;" src="../Content/CustomIcons/existencia_verde.svg"></img > </a>';
|
||||
tr.append('<td>' + tdExistencia + '</td>');
|
||||
|
||||
|
||||
@@ -3228,9 +3228,13 @@ Partial Class Ventas
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(301) <> "" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(301) = "1" Then
|
||||
TxtFecha.Enabled = True
|
||||
ImgFecha.Visible = True
|
||||
Else
|
||||
TxtFecha.Enabled = False
|
||||
ImgFecha.Visible = False
|
||||
CEFecha.Enabled = False
|
||||
End If
|
||||
|
||||
CargarCodigo()
|
||||
@@ -5037,7 +5041,10 @@ Partial Class Ventas
|
||||
If (Not CveEstatus.Contiene(4, 5, 12, 13, 20, 23) OrElse (CveEstatus = 5 AndAlso DbRowVenta("CveEstatusRefacturacion").ToString().ToEntero() = 4)) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Ant") AndAlso UsuarioActual.TienePermisoProceso(159) Then
|
||||
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
|
||||
If TienePermiso <> "" Then
|
||||
LkRefacturacion.Visible = True
|
||||
If Not (UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1") Then
|
||||
LkRefacturacion.Visible = True
|
||||
End If
|
||||
|
||||
If (CveEstatus = 5 AndAlso DbRowVenta("CveEstatusRefacturacion").ToString().ToEntero() = 4) Then
|
||||
RefacturarCancelada = True
|
||||
End If
|
||||
@@ -5065,9 +5072,18 @@ Partial Class Ventas
|
||||
' End If
|
||||
'End If
|
||||
'si utiliza cortes, y cajas, no permitir cancelar de días anteriores
|
||||
If UsuarioActual.CveRol <> 1 AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso DbRowVenta("Fecha").ToString.ToDate.ToShortDateString.ToDate < Now.ToShortDateString.ToDate Then
|
||||
LbCancelarDocumento.Visible = UsuarioActual.TienePermisoProceso(378)
|
||||
If (UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1") Then
|
||||
LkRefacturacion.Visible = False
|
||||
If DbRowVenta("Fecha").ToString.ToDate.ToShortDateString.ToDate < Now.ToShortDateString.ToDate Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Ant") AndAlso UsuarioActual.TienePermisoProceso(159) Then
|
||||
LkRefacturacion.Visible = True
|
||||
LbCancelarDocumento.Visible = False
|
||||
Else
|
||||
LbCancelarDocumento.Visible = UsuarioActual.TienePermisoProceso(378)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -7272,7 +7288,11 @@ Partial Class Ventas
|
||||
TxtCantidad.Focus()
|
||||
End If
|
||||
|
||||
|
||||
'SI ES REFACTURACION HABILITAR LOS CAMPOS
|
||||
If NuevaFactura = 1 Then
|
||||
DdlMetodoPago33.Enabled = True
|
||||
DdlFormaPago33.Enabled = True
|
||||
End If
|
||||
'If UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
|
||||
' Using ObjVentas As New ClsVentas
|
||||
' If ObjVentas.GetLineasAdicionales(-1, CveCliente, -1, -1, DdlMoneda.SelectedValue.ToEntero(), MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa) Then
|
||||
@@ -25004,6 +25024,15 @@ Partial Class Ventas
|
||||
LblIVADescPS.Text = GvRow.DataKey("ImporteIVA").FormatoNumero()
|
||||
HdnIVADescPS.Value = GvRow.DataKey("IVA").FormatoNumero()
|
||||
|
||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=GvRow.DataKey("CvePS").ToEntero()).FiltroPrimero("")
|
||||
If DrPS IsNot Nothing Then
|
||||
If DrPS("PorMaximoDescuento").ToString().ToDecimal() > 0 Then
|
||||
HdnPorcentajeMaxDescPS.Value = DrPS("PorMaximoDescuento").ToString()
|
||||
Else
|
||||
HdnPorcentajeMaxDescPS.Value = UsuarioActual.DescuentoAutorizado.ToString()
|
||||
End If
|
||||
End If
|
||||
|
||||
Using ObjPS As New ClsProductosServicios
|
||||
Dim PrecioCompra = ObjPS.GetUltimoPrecioCompra(UsuarioActual.CveEmpresa, GvRow.DataKey("CvePS").ToEntero())
|
||||
If PrecioCompra > 0 Then
|
||||
@@ -25650,7 +25679,7 @@ Partial Class Ventas
|
||||
|
||||
Dim AplicaCancelacionConPagos As Boolean = False
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("Ing", "Rem") AndAlso Not EsRefacturacion AndAlso ObjFacturaCancelacion.Pagado > 0 Then
|
||||
If (UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1") AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("Ing", "Rem") AndAlso Not EsRefacturacion AndAlso ObjFacturaCancelacion.Pagado > 0 Then
|
||||
AplicaCancelacionConPagos = True
|
||||
End If
|
||||
|
||||
@@ -38276,7 +38305,21 @@ Partial Class Ventas
|
||||
If UsuarioAutorizar.TienePermisoProceso(374) Then
|
||||
txtUserDesc.Text = ""
|
||||
txtPassDesc.Text = ""
|
||||
'UpAutorizarDesc.Update()
|
||||
|
||||
'ASIGNA EL PORCENTAJE A APLICAR DEL USUARIO QUE AUTORIZA
|
||||
Dim RowUpdate As DataRow = TmpDT.Select($"Consec = {HdnConsecPS.Value}").FirstOrDefault()
|
||||
If RowUpdate IsNot Nothing Then
|
||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=RowUpdate("CvePS").ToString().ToEntero()).FiltroPrimero("")
|
||||
If DrPS IsNot Nothing Then
|
||||
If DrPS("PorMaximoDescuento").ToString().ToDecimal() > 0 Then
|
||||
HdnPorcentajeMaxDescPS.Value = DrPS("PorMaximoDescuento").ToString()
|
||||
Else
|
||||
HdnPorcentajeMaxDescPS.Value = UsuarioAutorizar.DescuentoAutorizado.ToString()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
UpDescPS.Update()
|
||||
|
||||
RegistraScript("$('#ModalPermisoDesc').modal('hide');$('#ModalDescPS').modal({backdrop: 'static', keyboard: false});", "AUT")
|
||||
Else
|
||||
|
||||
Reference in New Issue
Block a user