Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -6091,6 +6091,22 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetAutorizacion(CveAutorizacion As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error la autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, TipoDocumento As String, Optional CveEstatus As Integer = -1, Optional FechaI As DateTime = MinFecha, Optional FechaF As DateTime = MaxFecha, Optional CveUsuarioConsulta As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesGet")
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
|
||||
<asp:UpdatePanel ID="UPPMov" runat="server" RenderMode="Inline" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvM" Width="100%" runat="server" data-sort="false" GridLines="None" CssClass="table table-smallpadding table-striped table-hover Widthall ScrollAD"
|
||||
<asp:GridView ID="GvM" Width="100%" runat="server" data-sort="false" GridLines="None" CssClass="table table-smallpadding table-striped table-hover Widthall adssigrid-scroll adssigrid-order" data-cols="1" data-rows="2"
|
||||
DataKeyNames="CvePS,CveMoneda,CveProveedor,CveConcepto,FechaI,FechaF,CveAlmacen,CvePersonal,Codigo,NumeroParte,PS"
|
||||
ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
|
||||
@@ -120,7 +120,6 @@ Partial Class Inventarios_ReporteEntradasSalidas
|
||||
GvM.Columns(7).HeaderStyle.Width = 133
|
||||
GvM.Columns(8).HeaderStyle.Width = 133
|
||||
GvM.Columns(10).HeaderStyle.Width = 134
|
||||
GvM.CssClass = "table table-smallpadding table-striped table-hover ScrollAD"
|
||||
GvM.Width = 1074
|
||||
dvArt.Attributes.Add("style", "text-align:center!important; font-size:14px;width:537px;")
|
||||
dvCan.Attributes.Add("style", "text-align:center!important; font-size:14px; border-right-color: white!important;border-left-color: white!important;width:537px;border-style: solid;")
|
||||
|
||||
@@ -10,9 +10,11 @@
|
||||
|
||||
.GVCalculosSBC tr th:nth-child(n+13):not(:nth-child(n+16)) {
|
||||
background-color: #88d6cd !important;
|
||||
}.GVDetalleParteVariable tr > td:nth-child(n+2) {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.GVDetalleParteVariable tr > td:nth-child(n+2) {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
@@ -248,7 +250,7 @@
|
||||
Modificación
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblsalarioDiarioSSf" runat="server" > </asp:Label>
|
||||
<asp:Label ID="lblsalarioDiarioSSf" runat="server"> </asp:Label>
|
||||
<%--<asp:Label ID="lblsalarioDiarioSSf" runat="server" Text='<%# (Eval("SalarioDiarioSSNuevo", "{0:N2}") == Eval("SalarioDiarioSS", "{0:N2}") ? "NO" : "SI") %>'> </asp:Label>--%>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -474,7 +476,8 @@
|
||||
<ajax:TabPanel ID="TabDetalleParteVariable" runat="server" HeaderText="Detalle parte variable">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GVDetalleParteVariable" HeaderStyle-CssClass="ADtr" runat="server" GridLines="None" OnRowDataBound="GVDetalleParteVariable_RowDataBound"
|
||||
CssClass="table table-hover table-striped ScrollAD Widthall GVBuscaddor GVDetalleParteVariable"></asp:GridView>
|
||||
CssClass="table table-hover table-striped ScrollAD Widthall GVBuscaddor GVDetalleParteVariable">
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
</ajax:TabContainer>
|
||||
@@ -619,10 +622,20 @@
|
||||
<asp:Label runat="server" Text='<%# Eval("fecha","{0:dd/MM/yyyy HH}:{0:mm}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Descargar" ItemStyle-Width="80">
|
||||
<ItemTemplate>
|
||||
<asp:Button runat="server" Text="" CssClass="fa fa-download btn btn-primary"
|
||||
CommandArgument='<%# Eval("ruta") %>' OnClick="DescargarArchivobitacora" ToolTip="Descargar" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="GVDoctos" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -883,7 +896,7 @@
|
||||
</div>
|
||||
|
||||
<div class="btn-group ">
|
||||
<a class="btn yellow-gold btn-sm" href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" aria-expanded="true"><i class="fa fa-ad-excel"></i> Formatos
|
||||
<a class="btn yellow-gold btn-sm" href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" aria-expanded="true"><i class="fa fa-ad-excel"></i>Formatos
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
@@ -951,7 +964,7 @@
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="DmodalSalariomenoralminimo" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel ID="UpdatePanel1" class="modal-dialog" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
@@ -977,20 +990,19 @@
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding ">
|
||||
|
||||
<div class="portlet-body rowpadding ">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal-footer">
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -420,7 +420,7 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
column++;
|
||||
libro.Cell(1, column).Value = "Empleado";
|
||||
column++;
|
||||
libro.Cell(1, column).Value = "TipodeSalario";
|
||||
libro.Cell(1, column).Value = "TipodeSalario";
|
||||
libro.Row(1).CellsUsed().Style.Font.FontColor = ClosedXML.Excel.XLColor.White;
|
||||
libro.Row(1).CellsUsed().Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189));
|
||||
|
||||
@@ -434,7 +434,7 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
libro.Cell(Fila, column).Value = erow["Nombre"];
|
||||
|
||||
column++;
|
||||
libro.Cell(Fila, column).Value = erow["TipodeSalario"];
|
||||
libro.Cell(Fila, column).Value = erow["TipodeSalario"];
|
||||
}
|
||||
|
||||
libro.Columns().AdjustToContents();
|
||||
@@ -521,7 +521,7 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
SalarioCotizacion = Salariovariable + SDI;
|
||||
if (objpersonal.UpdateSalarios(CvePersonal, txtfechacargamasiva.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
Salariodiario.ToString().ToDouble(), SDI.ToString().ToDouble(), SalarioCotizacion.ToString().ToDouble(), Salariodiario.ToString().ToDouble(),
|
||||
false,true,"True"))
|
||||
false, true, "True"))
|
||||
{
|
||||
|
||||
{
|
||||
@@ -574,7 +574,7 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
}
|
||||
if (CvePersonal > 0)
|
||||
{
|
||||
objpersonal.PersonalRPUpdate( CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa , RegistroPatronal);
|
||||
objpersonal.PersonalRPUpdate(CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RegistroPatronal);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -613,7 +613,7 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
}
|
||||
if (CvePersonal > 0)
|
||||
{
|
||||
objpersonal.PersonalTSUpdate(CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TipodeSalario);
|
||||
objpersonal.PersonalTSUpdate(CvePersonal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TipodeSalario);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -732,6 +732,7 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
try { archivoW = new System.IO.StreamWriter(string.Format("{0}{1}.txt", rutarchivos, namearchivo), true, System.Text.Encoding.UTF8); } catch (Exception) { }
|
||||
if (archivoW != null)
|
||||
{
|
||||
Alert(MovtosmodSalario);
|
||||
try { archivoW.WriteLine(MovtosmodSalario); } catch (Exception) { }
|
||||
try
|
||||
{
|
||||
@@ -758,7 +759,7 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(), 2);
|
||||
if (continuar && (item.FCCheckBox("chkUpdate").Checked) &&//SalarioDiarioSSNuevo != SalarioDiarioSS &&
|
||||
(continuar = objrh.UpdateSalarios(CvePersonal, fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, SalarioDiario, SDINuevo, SalarioDiarioSSNuevo, SalarioDiario,
|
||||
false,true,"True"
|
||||
false, true, "True"
|
||||
)))
|
||||
{
|
||||
|
||||
@@ -915,16 +916,19 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
|
||||
string rutarchivos = string.Format("{0}\\modificacionsalarios\\", UsuarioActual.Empresa.Ruta);
|
||||
List<archivosD> lisaarchivos = new List<archivosD>();
|
||||
foreach (var urfile in System.IO.Directory.GetFiles(rutarchivos, "*"))
|
||||
if (System.IO.Directory.Exists(rutarchivos))
|
||||
{
|
||||
if (urfile.Replace(rutarchivos, "").Length > 9)
|
||||
foreach (var urfile in System.IO.Directory.GetFiles(rutarchivos, "*"))
|
||||
{
|
||||
string cfecha = urfile.Replace(rutarchivos, "").Substring(0, 10).ToDateTime().ToString("dd/MM/yyyy");
|
||||
if (urfile.Replace(rutarchivos, "").Length > 9)
|
||||
{
|
||||
string cfecha = urfile.Replace(rutarchivos, "").Substring(0, 10).ToDateTime().ToString("dd/MM/yyyy");
|
||||
|
||||
|
||||
archivosD arch = new archivosD() { nombrearchivo = cfecha, ruta = urfile, fecha = System.IO.File.GetCreationTime(urfile) };
|
||||
lisaarchivos.Add(arch);
|
||||
archivosD arch = new archivosD() { nombrearchivo = cfecha, ruta = urfile, fecha = System.IO.File.GetCreationTime(urfile) };
|
||||
lisaarchivos.Add(arch);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
GVDoctos.DataSource = lisaarchivos;
|
||||
@@ -936,7 +940,7 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
|
||||
protected void GVDetalleParteVariable_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if(e.Row.RowType == DataControlRowType.DataRow)
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
for (int i = 0; i < e.Row.Cells.Count; i++)
|
||||
{
|
||||
@@ -966,6 +970,28 @@ public partial class RH_CalculoSBC : ClsPaginas
|
||||
{
|
||||
|
||||
}
|
||||
protected void DescargarArchivobitacora(object sender, EventArgs e)
|
||||
{
|
||||
Button btn = (Button)sender;
|
||||
GridViewRow row = (GridViewRow)btn.NamingContainer;
|
||||
|
||||
// Obtener la ruta del archivo desde el DataKeyNames
|
||||
string rutaArchivo = GVDoctos.DataKeys[row.RowIndex]["ruta"].ToString();
|
||||
string nombreArchivo = string.Format("{0}.txt",GVDoctos.DataKeys[row.RowIndex]["nombrearchivo"]);
|
||||
|
||||
if (System.IO.File.Exists(rutaArchivo))
|
||||
{
|
||||
Response.Clear();
|
||||
Response.ContentType = "application/octet-stream";
|
||||
Response.AddHeader("Content-Disposition", "attachment; filename=" + nombreArchivo);
|
||||
Response.WriteFile(rutaArchivo);
|
||||
Response.End();
|
||||
}
|
||||
else
|
||||
{
|
||||
ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('El archivo no existe en el servidor');", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
public class archivosD
|
||||
{
|
||||
|
||||
@@ -202,8 +202,11 @@ Partial Class Ventas_RepVentas
|
||||
DdlGrupo.Items.Insert(13, New ListItem("Fecha Ejec.", "14"))
|
||||
DdlGrupo.Items.Insert(13, New ListItem("Tipo Cliente", "20"))
|
||||
DdlGrupo.Items.Insert(13, New ListItem("Vendedor/Cliente", "21"))
|
||||
DdlGrupo.Items.Insert(13, New ListItem("Giro", "22"))
|
||||
DdlGrupo.Items.Insert(13, New ListItem("Giro", "22"))
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(307) <> "" Then DdlGrupo.Items.Insert(10, New ListItem(UsuarioActual.Empresa.Funcionalidad(307), "23"))
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then DdlGrupo.Items.Insert(13, New ListItem("Tipo Venta", "24"))
|
||||
|
||||
DdlGrupo.DataBind()
|
||||
DdlGrupo.SelectedValueExist("3")
|
||||
@@ -222,6 +225,7 @@ Partial Class Ventas_RepVentas
|
||||
|
||||
DdlTipoVenta.DataSource = GlobalDTTipoVenta(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' AND TipoDocto = 'Egs' ")
|
||||
DdlTipoVenta.DataBind()
|
||||
DdlTipoVenta.Items.Insert(0, New ListItem("Sin Asignar", "-2"))
|
||||
DdlTipoVenta.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
@@ -314,11 +318,15 @@ Partial Class Ventas_RepVentas
|
||||
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim.ToDate, MaxFecha)
|
||||
|
||||
Dim ModalidadContable As Boolean = Not ChkLecturaAdmin.Checked
|
||||
Dim CveTipoVenta As Integer = -1
|
||||
If DivTipoVenta.Visible Then
|
||||
CveTipoVenta = DdlTipoVenta.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
If ObjVentas.GetRepVentas(FechaI, FechaF, FechaIEjec, FechaFEjec, CveCliente, DdlSubProyectoEjecucion.SelectedValue.ToEntero, Vendedores,
|
||||
DdlUsuario.SelectedValue.ToEntero, Estatus, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, TipoComprobante, DdlProyecto.SelectedValue.ToEntero, Sucursales, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, CveUsuarioConsulta:=UsuarioActual.CveUsuario,
|
||||
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=ModalidadContable,
|
||||
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero(), ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero()) Then
|
||||
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero(), ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=CveTipoVenta) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
DtVentas = ObjVentas.DtResultados
|
||||
Else
|
||||
|
||||
@@ -5,6 +5,7 @@ Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Net.Http
|
||||
Imports DocumentFormat.OpenXml.Office2010.PowerPoint
|
||||
|
||||
Partial Class RepVentasDetalle
|
||||
Inherits ClsPaginas
|
||||
@@ -326,6 +327,7 @@ Partial Class RepVentasDetalle
|
||||
|
||||
DdlTipoVenta.DataSource = GlobalDTTipoVenta(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' AND TipoDocto = 'Egs'")
|
||||
DdlTipoVenta.DataBind()
|
||||
DdlTipoVenta.Items.Insert(0, New ListItem("Sin Asignar", "-2"))
|
||||
DdlTipoVenta.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
@@ -461,6 +463,11 @@ Partial Class RepVentasDetalle
|
||||
ChkLecturaAdmin.Checked = Not ModalidadContable
|
||||
CveProyecto = DdlProyecto.SelectedValue.ToEntero
|
||||
|
||||
Dim CveTipoVenta As Integer = -1
|
||||
If DivTipoVenta.Visible Then
|
||||
CveTipoVenta = DdlTipoVenta.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero
|
||||
If ObjVentas.GetRepVentasDetalle(DdlGrupo.SelectedValue.ToEntero, Anio.ToEntero, Mes.ToEntero, AnioMes, Fecha, CveCliente,
|
||||
@@ -468,7 +475,7 @@ Partial Class RepVentasDetalle
|
||||
CveCorte.ToEntero, TipoComprobante, DdlSubProyectoEjecucion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaIEjec, FechaFEjec,
|
||||
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
|
||||
CveCondicionesPago:=CveCondicionesPago, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=Not ChkLecturaAdmin.Checked, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero(),
|
||||
ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero()) Then
|
||||
ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero, EsFacturaGlobal:=DdlFacturaGlobal.SelectedValue.ToEntero, EsFilial:=DdlFilial.SelectedValue.ToEntero, CveTipoVenta:=CveTipoVenta) Then
|
||||
DtVentas = AddRows(ObjVentas.DtResultados)
|
||||
ImgImprimir.Enabled = True
|
||||
GvDatos.DataSource = AddRows(ObjVentas.DtResultados)
|
||||
@@ -536,6 +543,7 @@ Partial Class RepVentasDetalle
|
||||
ChkIEPS.Checked = UsuarioActual.Empresa.Funcionalidad(713) = "1" 'empresa deduce IEPS
|
||||
GvDatos.Columns(9).Visible = ChkIEPS.Checked
|
||||
ChkKilometraje.Visible = UsuarioActual.Empresa.Funcionalidad(558) = "1" 'empresa llantera
|
||||
ChkTipoVenta.Visible = UsuarioActual.Empresa.Funcionalidad(531) = "1" 'empresa acumuladores
|
||||
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
@@ -668,6 +676,11 @@ Partial Class RepVentasDetalle
|
||||
ChkEstatusFactura.Checked = True
|
||||
ChkCliente.Checked = True
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
ChkSucursal.Checked = False
|
||||
ChkTipoVenta.Checked = True
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkPersonalizar_Click(sender As Object, e As EventArgs)
|
||||
@@ -781,6 +794,8 @@ Partial Class RepVentasDetalle
|
||||
|
||||
If ChkDescargarXML.Checked Then ListPersonalizada.Add("XML")
|
||||
|
||||
If ChkTipoVenta.Checked Then ListPersonalizada.Add("TipoVenta")
|
||||
|
||||
If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "RepVentaDetalles.aspx", String.Join("|", ListPersonalizada)) Then
|
||||
'Alert("Personalizacion guardada")
|
||||
End If
|
||||
@@ -841,6 +856,7 @@ Partial Class RepVentasDetalle
|
||||
ChkDescargarPDF.Checked = False
|
||||
ChkDescargarXML.Checked = False
|
||||
|
||||
ChkTipoVenta.Checked = False
|
||||
Dim Personalizaciones As String() = strBasePersonalizacion.Split("|"c)
|
||||
|
||||
For Each personalizacion As String In Personalizaciones
|
||||
@@ -980,6 +996,9 @@ Partial Class RepVentasDetalle
|
||||
Case "PDF"
|
||||
ChkDescargarPDF.Checked = True
|
||||
Exit Select
|
||||
Case "TipoVenta"
|
||||
ChkTipoVenta.Checked = True
|
||||
Exit Select
|
||||
Case Else
|
||||
Exit Select
|
||||
End Select
|
||||
@@ -988,6 +1007,7 @@ Partial Class RepVentasDetalle
|
||||
Personaliza()
|
||||
Else
|
||||
PersonalizaDefault()
|
||||
Personaliza()
|
||||
End If
|
||||
|
||||
UPPersonalizar.Update()
|
||||
|
||||
@@ -417,9 +417,9 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LbVerificarExistencia" Visible="false" runat="server"><i class='fa fa-list-alt'></i>Verificar Existencias</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkEnvioDeCorreoFactura" runat="server" CausesValidation="False" OnClick="LnkEnvioDeCorreoFactura_Click" Visible="false" > <i class="fa fa-envelope-o" aria-hidden="true"></i> Envio De Correo</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkEnvioDeCorreoFactura" runat="server" CausesValidation="False" OnClick="LnkEnvioDeCorreoFactura_Click" Visible="false"> <i class="fa fa-envelope-o" aria-hidden="true"></i> Envio De Correo</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />
|
||||
@@ -654,7 +654,7 @@
|
||||
<td runat="server">
|
||||
<asp:Label runat="server" ID="LblTipoVenta"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -995,6 +995,11 @@
|
||||
<td>
|
||||
<asp:Label ID="lblMotivoDev" runat="server"></asp:Label></td>
|
||||
</tr>
|
||||
<tr align="left" id="TrTipoVentaEgs" runat="server" visible="false">
|
||||
<td><b class="truncate">Tipo Venta:</b> </td>
|
||||
<td>
|
||||
<asp:Label ID="LblTipoVentaEGS" runat="server"></asp:Label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1345,7 +1350,7 @@
|
||||
</span>
|
||||
<br />
|
||||
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Label>
|
||||
<asp:Hyperlink ID="HLPS" runat="server" Visible="false" Target="_blank" Text='<%# Eval("CodigoPS") %>'></asp:Hyperlink>
|
||||
<asp:HyperLink ID="HLPS" runat="server" Visible="false" Target="_blank" Text='<%# Eval("CodigoPS") %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" OnSelectedIndexChanged="DdlClasificacion_SelectedIndexChanged1" CssClass="select2me">
|
||||
@@ -7357,7 +7362,14 @@
|
||||
<h4 class="modal-title">Aplicar NC</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="row form-group" id="DivTipoVentaAsingado" runat="server" visible="false">
|
||||
<div class="col-md-2">
|
||||
Tipo Venta:
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<asp:Label runat="server" ID="LblTipoVentaAsignado" ></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col-md-2">
|
||||
Concepto:
|
||||
@@ -8847,6 +8859,11 @@
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlSolCreditoTipoDocto.ClientID.ToString()%>">Tipo Documento:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="DivTipoVentaSol" runat="server">
|
||||
<asp:DropDownList ID="DdlTipoVentaSolCredito" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="TipoVenta" DataValueField="CveTipoVenta">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlTipoVentaSolCredito.ClientID.ToString()%>">Tipo:</label>
|
||||
</div>
|
||||
<div id="DivAutorizacion" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoAutorizacion" runat="server" Width="100%" CssClass="form-control marginFixRow select2me" AutoPostBack="true">
|
||||
<asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem>
|
||||
@@ -9016,7 +9033,7 @@
|
||||
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpDvModalTipoVenta" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content" style="width:650px;">
|
||||
<div class="modal-content" style="width: 650px;">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID="LblDvModalTipoVentaTitulo" runat="server">Tipo de Venta</asp:Label>
|
||||
@@ -9114,11 +9131,11 @@
|
||||
<div class="row" runat="server" id="DVGvPSProced" visible="false">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<asp:CheckBox ID="ChkVerTodosPS" runat="server" Text="Ver Todos los productos" AutoPostBack="true" OnCheckedChanged="ChkVerTodosPS_CheckedChanged" />
|
||||
<asp:CheckBox ID="ChkVerTodosPS" runat="server" Text="Ver Todos los productos" AutoPostBack="true" OnCheckedChanged="ChkVerTodosPS_CheckedChanged" />
|
||||
</div>
|
||||
<div class="col-md-4" style="text-align: right">
|
||||
<input type="text" id="TxtBus" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvPSProced.ClientID) %>" style="display: inline-block; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvPSProced.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
<div class="col-md-4" style="text-align: right">
|
||||
<input type="text" id="TxtBus" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvPSProced.ClientID) %>" style="display: inline-block; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBus','{0}')", GvPSProced.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
@@ -9137,18 +9154,18 @@
|
||||
</asp:BoundField>
|
||||
<asp:BoundField DataField="CodigoPS" HeaderText="Producto">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
</asp:BoundField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Precio" ItemStyle-Width="30px">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("Precio", "{0:#,###.00##}") %>' Style="text-align: right!important" Width="70px" Enabled="false"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Ed. Médica" ItemStyle-Width="40px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtEdMedica" runat="server" Style="text-align: right!important" Width="70px"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtEdMedica" runat="server" Style="text-align: right!important" Width="70px"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
@@ -9311,8 +9328,9 @@
|
||||
<asp:GridView ID="GvExist" runat="server" AutoGenerateColumns="true" GridLines="None" BorderWidth="0" CssClass="table table-striped table-hover">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Producto">
|
||||
<ItemTemplate >
|
||||
<span style="width:400px; display:flex;"> <asp:Literal ID="LtlProducto" runat="server" Text='<%# Eval("Producto") %>'></asp:Literal> </span>
|
||||
<ItemTemplate>
|
||||
<span style="width: 400px; display: flex;">
|
||||
<asp:Literal ID="LtlProducto" runat="server" Text='<%# Eval("Producto") %>'></asp:Literal> </span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
@@ -9326,63 +9344,63 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="ModalDivMailFactura" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-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">Envio de Correo</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpSendMailFactura" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnCveVentaFactura" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnFolioVenta" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnTipoDocto" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnSerieFolio" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnSubProyecto" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HiddenField2" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<div class="row">
|
||||
<div class="col-xs-4">Para:</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtParaMailFactura" runat="server" Width="370px" CssClass="form-control" ClientIDMode="Static"></asp:TextBox>
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Envio de Correo</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpSendMailFactura" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnCveVentaFactura" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnFolioVenta" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnTipoDocto" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnSerieFolio" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HdnSubProyecto" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField ID="HiddenField2" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<div class="row">
|
||||
<div class="col-xs-4">Para:</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtParaMailFactura" runat="server" Width="370px" CssClass="form-control" ClientIDMode="Static"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
Con copia para:<br />
|
||||
(Separar con: ;)
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
Con copia para:<br />
|
||||
(Separar con: ;)
|
||||
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtCCFactura" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtCCFactura" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">Texto Adicional:</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtBodyFactura" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">Texto Adicional:</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtBodyFactura" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnSendMailFactura" Text="Enviar" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" OnClick="BtnSendMailFactura_Click" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnSendMailFactura" Text="Enviar" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" OnClick="BtnSendMailFactura_Click" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
|
||||
@@ -5275,6 +5275,13 @@ Partial Class Ventas
|
||||
EsNCDevolucionEfectivo = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
If Not String.IsNullOrEmpty(DbRowVenta("TipoVenta").ToString()) Then
|
||||
TrTipoVentaEgs.Visible = True
|
||||
LblTipoVentaEGS.Text = DbRowVenta("TipoVenta").ToString()
|
||||
End If
|
||||
End If
|
||||
|
||||
Case "Rem"
|
||||
Trsaldo.Visible = True
|
||||
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
|
||||
@@ -10210,45 +10217,10 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
If PermiteAutorizacion Then
|
||||
|
||||
Dim ImporteAutorizacion As Decimal = 0
|
||||
Dim TipoAutorizacion As Integer = 0
|
||||
|
||||
Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero()
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, "Egs", CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = Nothing
|
||||
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Egs'", Orderby:="Importe DESC")
|
||||
|
||||
If RowAutorizacion IsNot Nothing Then
|
||||
ImporteAutorizacion = RowAutorizacion("Importe").ToString().ToDecimal()
|
||||
CveAutorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
|
||||
TipoAutorizacion = RowAutorizacion("TipoAutorizacion").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If TipoAutorizacion = 1 Then
|
||||
If ImporteAutorizacion < TxtTotal.Text.ToDecimal() Then
|
||||
Dim BloquearCredito As Boolean = True
|
||||
CveAutorizacion = -1
|
||||
|
||||
If BloquearCredito Then
|
||||
Alert($"El importe autorizado es insuficiente. Importe autorizado:{ImporteAutorizacion:N2}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
CveAutorizacion = -1
|
||||
Alert($"No se encontro una autorización de crédito.", TipoMensaje.MsgAdvertencia)
|
||||
VerificaAutorizacionEgs(VerificarImportes:=True)
|
||||
If Me.CveAutorizacion <= 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -10532,6 +10504,50 @@ Partial Class Ventas
|
||||
EmitirImprimirNew(TipoDoctoViejo)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub VerificaAutorizacionEgs(Optional VerificarImportes As Boolean = True)
|
||||
Dim ImporteAutorizacion As Decimal = 0
|
||||
Dim TipoAutorizacion As Integer = 0
|
||||
|
||||
Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero()
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, "Egs", CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = Nothing
|
||||
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Egs'", Orderby:="Importe DESC")
|
||||
|
||||
If RowAutorizacion IsNot Nothing Then
|
||||
ImporteAutorizacion = RowAutorizacion("Importe").ToString().ToDecimal()
|
||||
CveAutorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
|
||||
TipoAutorizacion = RowAutorizacion("TipoAutorizacion").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If TipoAutorizacion = 1 Then
|
||||
If VerificarImportes Then
|
||||
If ImporteAutorizacion < TxtTotal.Text.ToDecimal() Then
|
||||
Dim BloquearCredito As Boolean = True
|
||||
CveAutorizacion = -1
|
||||
|
||||
If BloquearCredito Then
|
||||
Alert($"El importe autorizado es insuficiente. Importe autorizado:{ImporteAutorizacion:N2}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
CveAutorizacion = -1
|
||||
Alert($"No se encontro una autorización de crédito.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " NNNNEEEEEEEWWWWWW "
|
||||
@@ -14644,31 +14660,49 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso factura.TipoDocto = "Egs" AndAlso Not factura.EsGarantia Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
CveTipoVentaGuardar = -1
|
||||
|
||||
If NCDescuento Then
|
||||
If ListaNCDescuento IsNot Nothing AndAlso ListaNCDescuento.Count > 0 Then
|
||||
'VERIFICA SI BONIFICACION
|
||||
If ListaNCDescuento.Any(Function(RNC) (RNC.Num1 = 2)) Then
|
||||
CveTipoVentaGuardar = 7 ' BONIFICACION
|
||||
ElseIf ListaNCDescuento.Any(Function(RNC) (RNC.Num1 = 1)) Then
|
||||
CveTipoVentaGuardar = 9 ' CANCELACION DE USADOS
|
||||
If factura.TipoDocto = "Egs" AndAlso Not factura.EsGarantia Then
|
||||
If NCDescuento Then
|
||||
If ListaNCDescuento IsNot Nothing AndAlso ListaNCDescuento.Count > 0 Then
|
||||
'VERIFICA SI BONIFICACION
|
||||
If ListaNCDescuento.Any(Function(RNC) (RNC.Num1 = 2)) Then
|
||||
CveTipoVentaGuardar = 7 ' BU - BONIFICACION DE USADO
|
||||
ElseIf ListaNCDescuento.Any(Function(RNC) (RNC.Num1 = 1)) Then
|
||||
CveTipoVentaGuardar = 9 ' CU - CANCELACION DE USADO
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then
|
||||
'VERIFICA SI BONIFICACION
|
||||
If ListaRemisionesNC.Any(Function(RNC) (RNC.Num1 = 2)) Then
|
||||
CveTipoVentaGuardar = 7 ' BONIFICACION
|
||||
ElseIf ListaRemisionesNC.Any(Function(RNC) (RNC.Num1 = 1)) Then
|
||||
CveTipoVentaGuardar = 9 ' CANCELACION DE USADOS
|
||||
Else
|
||||
If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then
|
||||
'VERIFICA SI BONIFICACION
|
||||
If ListaRemisionesNC.Any(Function(RNC) (RNC.Num1 = 2)) Then
|
||||
CveTipoVentaGuardar = 7 ' BU - BONIFICACION DE USADO
|
||||
ElseIf ListaRemisionesNC.Any(Function(RNC) (RNC.Num1 = 1)) Then
|
||||
CveTipoVentaGuardar = 9 ' CU - CANCELACION DE USADO
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
'GA - GARANTIAS Y AJUSTES
|
||||
If factura.TipoDocto = "Egs" AndAlso factura.EsGarantia Then CveTipoVentaGuardar = 11
|
||||
|
||||
'DM - DEVOLUCION DE MERCANCIA
|
||||
If factura.TipoDocto = "Dev" Then CveTipoVentaGuardar = 10
|
||||
|
||||
'SI TIENE TIPO VENTA LA AUTORIZACION TOMAR DE AHI
|
||||
If factura.TipoDocto = "Egs" AndAlso Me.CveAutorizacion > 0 Then
|
||||
If ObjVentas.GetAutorizacion(Me.CveAutorizacion, UsuarioActual.CveEmpresa) Then
|
||||
If ObjVentas.DtResultados.FiltroPrimeroValor("CveTipoVenta").ToEntero() > 0 Then CveTipoVentaGuardar = ObjVentas.DtResultados.FiltroPrimeroValor("CveTipoVenta").ToEntero()
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC,
|
||||
factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC,
|
||||
factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, 0, factura.FechaPago, factura.Fecha, factura.MotivoDescuento,
|
||||
@@ -31844,6 +31878,18 @@ Partial Class Ventas
|
||||
BtnEmitirImprimir.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Me.CveAutorizacion > 0 Then
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetAutorizacion(CveAutorizacion, UsuarioActual.CveEmpresa) Then
|
||||
If Not String.IsNullOrEmpty(ObjVentas.DtResultados.FiltroPrimeroValor("TipoVenta")) Then
|
||||
TrTipoVentaEgs.Visible = True
|
||||
TxtObsFact.Text = $"{ObjVentas.DtResultados.FiltroPrimeroValor("TipoVenta")}"
|
||||
UPObservaciones.Update()
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al aplicar NC", ex)
|
||||
End Try
|
||||
@@ -36380,10 +36426,19 @@ Partial Class Ventas
|
||||
Select Case RblRNCTipo.SelectedValue
|
||||
Case "1" 'CARGOS
|
||||
NCConcepto = ArrayNC(3).ToEntero()
|
||||
If DivTipoVentaAsingado.Visible Then
|
||||
LblTipoVentaAsignado.Text = "CU - CANCELACION DE USADO "
|
||||
End If
|
||||
Case "2" 'BONIFICACIONES
|
||||
NCConcepto = ArrayNC(4).ToEntero()
|
||||
If DivTipoVentaAsingado.Visible Then
|
||||
LblTipoVentaAsignado.Text = "BU - BONIFICACION DE USADO"
|
||||
End If
|
||||
Case "3" 'AJUSTE/GARANTIAS
|
||||
NCConcepto = ArrayNC(1).ToEntero()
|
||||
If DivTipoVentaAsingado.Visible Then
|
||||
LblTipoVentaAsignado.Text = "GA - GARANTIAS Y AJUSTES"
|
||||
End If
|
||||
End Select
|
||||
|
||||
'CARGOS/AJUSTES POR GARANTIA POR PRODUCTO
|
||||
@@ -36455,6 +36510,7 @@ Partial Class Ventas
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
'CARGOS/AJUSTES POR GARANTIA POR TOTAL
|
||||
ElseIf RblRNCTipo.SelectedValue.Contiene("1", "3") AndAlso Not ChkMostarProductosRNC.Checked Then
|
||||
|
||||
@@ -36574,6 +36630,7 @@ Partial Class Ventas
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
'BONIFICACIONES POR TOTAL
|
||||
ElseIf RblRNCTipo.SelectedValue.Contiene("2") AndAlso Not ChkMostarProductosRNCBon.Checked Then
|
||||
For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows
|
||||
@@ -38385,6 +38442,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
TxtImporteSolicitud.Text = ""
|
||||
DdlSolCreditoTipoDocto_SelectedIndexChanged(Nothing, EventArgs.Empty)
|
||||
RegistraScript("$('#DivModalSolicitarCredito').modal('show')")
|
||||
UpModalSolicitud.Update()
|
||||
End Sub
|
||||
@@ -38427,9 +38485,18 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
Dim Motivo As String = TxtMotivoAutorizacion.Text
|
||||
Dim CveTipoVenta As Integer = -1
|
||||
If DdlTipoVentaSolCredito.SelectedValue.ToEntero() > 0 Then
|
||||
CveTipoVenta = DdlTipoVentaSolCredito.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
If CveTipoVenta <= 0 AndAlso TipoDocto = "Egs" Then
|
||||
Alert("Debe seleccionar un tipo de venta", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjPS As New ClsVentas
|
||||
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlSolCreditoTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos, Motivo:=Motivo) Then
|
||||
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlSolCreditoTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos, Motivo:=Motivo, CveTipoVenta:=CveTipoVenta) Then
|
||||
RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
|
||||
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
|
||||
'signal
|
||||
@@ -38460,10 +38527,16 @@ Partial Class Ventas
|
||||
DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2"))
|
||||
DivMotivoAutorizacion.Visible = True
|
||||
End If
|
||||
DivTipoVentaSol.Visible = False
|
||||
Case "Egs"
|
||||
'QUITAR LA DE VENCIMIENTO
|
||||
DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2"))
|
||||
DivMotivoAutorizacion.Visible = True
|
||||
|
||||
DivTipoVentaSol.Visible = True
|
||||
DdlTipoVentaSolCredito.DataSource = GlobalDTTipoVenta(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' AND TipoDocto = 'Egs' AND CveTipoVenta NOT IN (7,9,10,11) ")
|
||||
DdlTipoVentaSolCredito.DataBind()
|
||||
DdlTipoVentaSolCredito.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Select
|
||||
UpModalSolicitud.Update()
|
||||
End Sub
|
||||
@@ -40482,7 +40555,7 @@ Partial Class Ventas
|
||||
|
||||
Protected Sub LBNotaCredito_Click(sender As Object, e As EventArgs)
|
||||
CargaDdlNCPS()
|
||||
|
||||
DivTipoVentaAsingado.Visible = False
|
||||
If CveVenta <= 0 Then 'cuando es nueva la factura
|
||||
DivGvCxC.Visible = True
|
||||
CargaCxC()
|
||||
@@ -40490,6 +40563,24 @@ Partial Class Ventas
|
||||
UpAplicarNC.Update()
|
||||
'CARGAR RNC
|
||||
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
VerificaAutorizacionEgs(VerificarImportes:=True)
|
||||
If Me.CveAutorizacion <= 0 Then
|
||||
Exit Sub
|
||||
Else
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetAutorizacion(Me.CveAutorizacion, UsuarioActual.CveEmpresa) Then
|
||||
If ObjVentas.DtResultados.FiltroPrimeroValor("CveTipoVenta").ToEntero() > 0 Then
|
||||
DivTipoVentaAsingado.Visible = True
|
||||
LblTipoVentaAsignado.Text = ObjVentas.DtResultados.FiltroPrimeroValor("TipoVenta")
|
||||
DdlNCPS.Enabled = True
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
End If
|
||||
|
||||
RegistraScript("$('#ModalAplicarNC').modal('show');", "ModalNC")
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user