This commit is contained in:
rrene
2020-03-04 10:43:18 -07:00
23 changed files with 1195 additions and 300 deletions

115
Ventas/MetasVendedores.aspx Normal file
View File

@@ -0,0 +1,115 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="MetasVendedores.aspx.vb" Inherits="MetasVendedores" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.table-scrollable {
margin-top: 0px !important;
margin-bottom: 0px !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Metas de Vendedores
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="LnkAgregar" runat="server"> Agregar Meta</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkPDF" runat="server"><i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<div id="DivAgregarTiposD" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTiposD" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Motivos de baja</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<label for="DdlVendedores">Vendedor:</label>
<asp:DropDownList ID="DdlVendedores" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control input-sm select2me"></asp:DropDownList>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="MotivoTxt">Mes y Año:</label>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
<asp:TextBox Style="width: 110px !important;" ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="DdlMarcas">Marca:</label>
<asp:DropDownList ID="DdlMarcas" runat="server" DataTextField="Marca" DataValueField="CveMarca" CssClass="form-control input-sm select2me"></asp:DropDownList>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMetaCantidad" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtTiposD" runat="server" ControlToValidate="TxtMetaCantidad" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad meta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
<label for="MotivoTxt">Cantidad meta:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMetaImporte" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtMetaImporte" runat="server" ControlToValidate="TxtMetaImporte" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe meta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
<label for="MotivoTxt">Importe meta:</label>
<i></i>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAgregarMetaVendedor" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTiposD" />
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
</asp:Content>

View File

@@ -0,0 +1,56 @@
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class MetasVendedores
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaDatosModal()
End If
End Sub
Private Sub CargaDatosModal()
DdlVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedores.DataBind()
DdlVendedores.Items.Insert(0, New ListItem("Seleccionar", "-1"))
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
DdlMarcas.DataSource = ObjPS.DtResultados
End If
ObjPS.Dispose()
DdlMarcas.DataBind()
DdlMarcas.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub ResetDatosSeleccionadosModal()
DdlVendedores.SelectedValue = "-1"
TxtFechaI.Text = ""
DdlMarcas.SelectedValue = "-1"
TxtMetaCantidad.Text = ""
TxtMetaImporte.Text = ""
UpModalTiposD.Update()
End Sub
Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"))
End Sub
Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click
If DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 Then
Dim ObjVentas As New ClsVentas
If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal) Then
Alert("Se agregó la meta al vendedor")
Else
Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError)
End If
Else
Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, ")))
End If
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"))
ResetDatosSeleccionadosModal()
End Sub
End Class

164
Ventas/RepPS.aspx Normal file
View File

@@ -0,0 +1,164 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPS.aspx.vb" Inherits="Ventas_RepPS" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
table > tbody > .SubTotales, table > tbody > .SubTotales:hover, table > tbody > .SubTotales:nth-of-type(odd) {
background: #CCCCCC !important;
}
table > tbody > .SubTotalesB, table > tbody > .SubTotalesB:hover, table > tbody > .SubTotalesB:nth-of-type(odd) {
background: #DDD !important;
}
.SegundoNivel, .SegundoNivel:hover {
background-color: rgba(172, 195, 222, 0.65) !important;
}
.select2 .select2-selection__rendered {
line-height: 1;
color: #111;
}
.select2 .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 20px;
user-select: none;
-webkit-user-select: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
margin-top: 10px;
}
.select2-selection__rendered {
margin-top: 0px;
height: 25px;
}
.select2-selection {
margin-top: 0px;
height: 31px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: none;
outline: 0;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Ventas por Producto
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" OnClick="BtnConsultar_Click" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label runat="server" id="LblSubProyecto" class="col-md-1 truncate">SubProyecto:</label>
<div runat="server" id="DivSubProyecto" class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 truncate">
Fecha Inicio:
</div>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1 truncate">
Fecha Fin:
</div>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Grupo:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlGrupo" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Familia-Marca-Linea" Value="1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron productos con los filtros especificados" ToolTip="Listado de Ventas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None" Width="99%">
<Columns>
<asp:TemplateField HeaderText="Grupo" ItemStyle-Width="30%" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlGrupo" runat="server" Text='<%# Eval("GPO") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%">
<ItemTemplate>
<asp:Literal ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:N0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="P. Promedio" DataField="PUPromedio" ItemStyle-Width="10%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Venta Total" DataField="SubTotal" ItemStyle-Width="10%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Descuentos" DataField="Descuento" ItemStyle-Width="10%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Venta Neta" DataField="VentaNeta" ItemStyle-Width="10%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="IVA" DataField="IVA" ItemStyle-Width="10%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Total" DataField="Total" ItemStyle-Width="10%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

102
Ventas/RepPS.aspx.vb Normal file
View File

@@ -0,0 +1,102 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
Partial Class Ventas_RepPS
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaDatosIniciales()
CargaCombos()
CargaDatos()
End If
End Sub
Private Sub CargaDatosIniciales()
txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
End Sub
Private Sub CargaCombos()
CargaTipoCentroCosto()
End Sub
Private Sub CargaTipoCentroCosto()
If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
DdlSubProyecto.Items.Clear()
LblSubProyecto.InnerText = "Sucursal:"
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyecto.DataBind()
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then
DdlSubProyecto.Items.Clear()
LblSubProyecto.InnerText = "Proyecto:"
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyecto.DataBind()
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Then
DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1"))
DdlGrupo.Items.Insert(1, New ListItem("SubProyecto", "2"))
DdlGrupo.Items.Insert(17, New ListItem("SubProyecto Ejec.", "19"))
DdlGrupo.DataBind()
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then
LblSubProyecto.InnerText = "Proyecto:"
DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1"))
DdlGrupo.Items.Insert(1, New ListItem("SubProyecto", "2"))
DdlGrupo.Items.Insert(17, New ListItem("SubProyecto Ejec.", "19"))
DdlGrupo.DataBind()
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then
LblSubProyecto.InnerText = "Sucursal:"
End If
End Sub
Private Sub CargaDatos()
Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero()
Dim Grupo As Integer = DdlGrupo.SelectedValue.ToEntero()
Dim CvePS As Integer = -1
Dim CveMoneda As Integer = -1
Dim TC As Integer = 1
Dim TCEspecifico As Decimal = -1
Dim FechaI, FechaF As DateTime
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.ToDate, MinFecha)
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
Dim ObjVentas As New ClsVentas()
If ObjVentas.GetRepPSEcono(CveSubProyecto, CvePS, FechaI, FechaF, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=Grupo, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico) Then
GvDatos.DataSource = ObjVentas.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjVentas.Dispose()
GvDatos.DataBind()
UPDatos.Update()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Select Case e.Row.DBCampo("Orden").ToString.ToEntero()
Case 4
e.Row.CssClass = "Totales"
Case 3
e.Row.CssClass = "SubTotales2"
Case 2
e.Row.CssClass = "SubTotales"
Case 1
e.Row.CssClass = "SubTotalesB"
Case 0
e.Row.CssClass = "Texto"
End Select
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
End Class

View File

@@ -83,7 +83,7 @@
</div>
<div class="col-md-1 truncate">Fecha Fin: </div>
<div class="col-md-1 truncate text-right">Fecha Fin: </div>
<div class="col-md-2 col-sm-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
<asp:TextBox Style="width: 80px !important;" ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
@@ -95,35 +95,34 @@
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
<div class="col-md-1 truncate">Sucursal: </div>
<div class="col-md-1 truncate text-right">Sucursal: </div>
<div class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="form-control input-sm select2me" Width="250" DataValueField="CveSubProyecto" DataTextField="SubProyecto"></asp:DropDownList>
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="form-control input-sm select2me" Width="50%" DataValueField="CveSubProyecto" DataTextField="SubProyecto"></asp:DropDownList>
</div>
</div>
<div class="row" style="margin-top:10px">
<div class="col-md-1 truncate" style="width:170px">Clasificación de Productos: </div>
<div class="col-md-2">
<asp:DropDownList ID="DdlClasificacionesPS" runat="server" CssClass="form-control input-sm select2me" Width="250" DataValueField="CveClasificacion" DataTextField="Clasificacion"></asp:DropDownList>
<label class="col-md-1 ">Clasificación de Productos: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlClasificacionesPS" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveClasificacion" DataTextField="Clasificacion"></asp:DropDownList>
</div>
<div class="col-md-1 truncate" style="width:170px">Vendedor: </div>
<div class="col-md-2">
<asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control input-sm select2me" Width="250" DataValueField="CveVendedor" DataTextField="Vendedor"></asp:DropDownList>
<label class="col-md-1 text-right">Vendedor: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlVendedor" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveVendedor" DataTextField="Vendedor"></asp:DropDownList>
</div>
<div class="col-md-1 truncate" style="width:170px">Marca: </div>
<div class="col-md-2">
<asp:DropDownList ID="DdlMarca" runat="server" CssClass="form-control input-sm select2me" Width="250" DataValueField="CveMarca" DataTextField="Marca"></asp:DropDownList>
<label class="col-md-1 text-right">Marca: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlMarca" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="30%" DataValueField="CveMarca" DataTextField="Marca"></asp:DropDownList>
</div>
</div>
<div class="row" style="margin-top:10px">
<div class="col-md-1 truncate" style="width:170px">Grupo: </div>
<div class="col-md-2">
<asp:DropDownList ID="DdlModalidad" runat="server" CssClass="form-control input-sm select2me" Width="100px">
<div class="row">
<label class="col-md-1">Grupo: </label>
<div class="col-md-3">
<asp:DropDownList ID="DdlModalidad" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100px">
<asp:ListItem Value="0">Clientes</asp:ListItem>
<asp:ListItem Value="1">Sucursales</asp:ListItem>
<asp:ListItem Value="2">Productos Servicios</asp:ListItem>
</asp:DropDownList>
</div>
</div>

View File

@@ -5835,6 +5835,11 @@ Partial Class Ventas
Descuento = (GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal).RoundSQL(NumeroDecimales)
CuentaPredial = GvPS.Rows(e.RowIndex).FCTextBox("TxtPredial").Text.Trim
If PU <= 0 AndAlso UsuarioActual.CveEmpresa = 141 Then
Alert("El precio debe ser mayor a 0", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If UsuarioActual.CveEmpresa = 140 Then
Descuento = CalcularDescuentos(TmpDT.Rows(e.RowIndex)("CvePS").ToString.ToEntero, Cantidad, PU)
End If
@@ -13920,6 +13925,11 @@ Partial Class Ventas
Return False
End If
If PU <= 0 AndAlso UsuarioActual.CveEmpresa = 141 Then
Alert("El precio debe ser mayor a 0", TipoMensaje.MsgAdvertencia)
Return False
End If
'VALIDA PROMOCIONES
Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
@@ -23895,6 +23905,20 @@ Partial Class Ventas
#End Region
#Region " EMITIR DOCUMENTO NUEVO "
Private Function ValidaFacturarCotizacion() As Boolean
Dim Retorno As Boolean = True
If UsuarioActual.CveEmpresa = 141 Then
If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = False
Return Retorno
End If
End If
Return Retorno
End Function
Private Sub EmitirDocumentoNuevo(TipoDoctoNuevo As String)
If GvPagos.Rows.Count = 0 And UsuarioActual.Empresa.Funcionalidad(558).ToEntero = 1 And RBLPago.SelectedValue.ToEntero = 2 Then
Alert("No se puede facturar hasta que se haya especificado detalladamente la forma de pago", TipoMensaje.MsgAdvertencia)
@@ -23903,11 +23927,17 @@ Partial Class Ventas
'CARGA LO PENDIENTE POR FACTURAR DE COTIZACION
If EraCotizacion = 1 Then
If Not ValidaFacturarCotizacion() Then
Exit Sub
End If
If Not PreparaFacturarCotizacion() Then
EraCotizacion = 0
DdlTipoComprobante.SelectedValue = "Cot"
Exit Sub
End If
End If
'CARGA LO PENDIENTE POR FACTURAR DE REMISION