Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -3266,7 +3266,7 @@ Partial Class ProductosyServicios
|
||||
HabilitaAplicaCaducidadTiempo()
|
||||
End Sub
|
||||
Private Sub HabilitaAplicaCaducidadTiempo()
|
||||
If UsuarioActual.CveEmpresa.Contiene(119, 158) Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(119, 158, 199) Then
|
||||
DivTiempoCaducidad.Visible = ChkCaducidad.Checked
|
||||
RfvTxtTiempoCaducidad.Enabled = ChkCaducidad.Checked
|
||||
End If
|
||||
@@ -3349,25 +3349,33 @@ Partial Class ProductosyServicios
|
||||
Else
|
||||
|
||||
If ObjPS.GetPS(-1, -1, CveEmpresaFranquicia, Codigo:=TxtCodigo.Text.Trim.ToUpper) Then
|
||||
Dim CvePS As Integer = ObjPS.DtResultados.FiltroPrimeroValor("CvePS", String.Format(" Codigo = '{0}'", TxtCodigo.Text.Trim.ToUpper)).ToEntero()
|
||||
If Not ObjPS.UpdatePS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtNumeroParte.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble,
|
||||
(TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, -1, True, ChkAplicaParaVenta.Checked, ChkEstado.Checked, UsuarioActual.CveUsuario, CvePS, CveMetodoInv,
|
||||
EsPaquete, DdlSATPS.SelectedValue.ToEntero, CveEmpresaFranquicia, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarcaFranquicia,
|
||||
AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim, AplicaIEPS:=ChkAplicaIeps.Checked, IEPSPorcentaje:=DdlIEPSPorcentaje.SelectedValue.ToDecimal,
|
||||
CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero, IEPSGrabaIVA:=ChkIepsIVA.Checked,
|
||||
VentaMinima:=TxtVentaMinima.Text.ToDecimal, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, RetISR:=(TxtRetISR.Text.Trim.ToDouble / 100), PrecioMinimo:=TxtPrecioMinimo.Text.ToDecimal,
|
||||
CveTipoFactor:=DdlTipoFactor.SelectedValue.ToEntero, CveFraccionArancelaria:=DdlFraccionArancelaria.SelectedValue.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario,
|
||||
CveClasificacionDetalle:=CveTipo, CveTamaño:=DdlTamanio.SelectedValue.ToEntero, CveModelo:=CveModelo,
|
||||
CveMedida:=CveMedida, CveRinTamaño:=CveRin, ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString,
|
||||
CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero,
|
||||
ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString,
|
||||
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked,
|
||||
TiempoCaducidad:=TxtTiempoCaducidad.Text.ToEntero()) Then
|
||||
Return True
|
||||
|
||||
If ObjPS.DtResultados IsNot Nothing AndAlso ObjPS.DtResultados.Rows.Count = 1 Then
|
||||
Dim CvePS As Integer = ObjPS.DtResultados.FiltroPrimeroValor("CvePS", String.Format(" Codigo = '{0}'", TxtCodigo.Text.Trim.ToUpper)).ToEntero()
|
||||
If Not ObjPS.UpdatePS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtNumeroParte.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble,
|
||||
(TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, -1, True, ChkAplicaParaVenta.Checked, ChkEstado.Checked, UsuarioActual.CveUsuario, CvePS, CveMetodoInv,
|
||||
EsPaquete, DdlSATPS.SelectedValue.ToEntero, CveEmpresaFranquicia, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarcaFranquicia,
|
||||
AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim, AplicaIEPS:=ChkAplicaIeps.Checked, IEPSPorcentaje:=DdlIEPSPorcentaje.SelectedValue.ToDecimal,
|
||||
CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero, IEPSGrabaIVA:=ChkIepsIVA.Checked,
|
||||
VentaMinima:=TxtVentaMinima.Text.ToDecimal, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, RetISR:=(TxtRetISR.Text.Trim.ToDouble / 100), PrecioMinimo:=TxtPrecioMinimo.Text.ToDecimal,
|
||||
CveTipoFactor:=DdlTipoFactor.SelectedValue.ToEntero, CveFraccionArancelaria:=DdlFraccionArancelaria.SelectedValue.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario,
|
||||
CveClasificacionDetalle:=CveTipo, CveTamaño:=DdlTamanio.SelectedValue.ToEntero, CveModelo:=CveModelo,
|
||||
CveMedida:=CveMedida, CveRinTamaño:=CveRin, ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString,
|
||||
CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero,
|
||||
ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString,
|
||||
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked,
|
||||
TiempoCaducidad:=TxtTiempoCaducidad.Text.ToEntero()) Then
|
||||
Return True
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert(String.Format("El producto no existe en la franquicia: '{0}'", GlobalDTEmpresas(CveEmpresaFranquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
Return True
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert(String.Format("El producto no existe en la franquicia: '{0}'", GlobalDTEmpresas(CveEmpresaFranquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
Alert(String.Format("Se presento un error al consultar la existencia en la franquicia: '{0}'", GlobalDTEmpresas(CveEmpresaFranquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -855,6 +855,7 @@ Partial Class Ventas_Promociones
|
||||
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
|
||||
If Not ObjVentas.SincronizarPromocionesClonar(CvePromocion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1) Then
|
||||
TieneError = True
|
||||
CvePromocion = -1
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -375,14 +375,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div id="chartdiv" style="text-align: center;height:600px!important">
|
||||
</div>
|
||||
<div id="div_ventas" runat="server" style="text-align: center;">
|
||||
<img src="/Metronic/assets/admin/layout/img/loading.gif" alt="loading" />
|
||||
<%--<img src="/Metronic/assets/admin/layout/img/loading.gif" alt="loading" />--%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END REGIONAL STATS PORTLET-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
@@ -396,50 +400,51 @@
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function CargaGrafica() { }
|
||||
function CargaGrafica3() { }
|
||||
function filldata() {
|
||||
//function CargaGrafica() { }
|
||||
//function CargaGrafica3() { }
|
||||
//function filldata() {
|
||||
|
||||
// CargaGrafica();
|
||||
// CargaGrafica3();
|
||||
// if ($('#C_DivIndicadores')) {
|
||||
// $('#C_DivIndicadores').slick({
|
||||
// lazyLoad: 'ondemand',
|
||||
// slidesToShow: 3,
|
||||
// slidesToScroll: 1,
|
||||
// dots: true,
|
||||
// infinite: true,
|
||||
// autoplay: true,
|
||||
// autoplaySpeed: 5000,
|
||||
// responsive: [
|
||||
// {
|
||||
// breakpoint: 1024,
|
||||
// settings: {
|
||||
// slidesToShow: 2,
|
||||
// slidesToScroll: 1,
|
||||
// infinite: true,
|
||||
// dots: true
|
||||
// }
|
||||
// }, {
|
||||
// breakpoint: 600,
|
||||
// settings: {
|
||||
// slidesToShow: 1,
|
||||
// slidesToScroll: 1,
|
||||
// infinite: true,
|
||||
// dots: true
|
||||
// }
|
||||
// }]
|
||||
// });
|
||||
// $('#C_DivIndicadores').show();
|
||||
// $('#C_chartcheckboxes').hide();
|
||||
// }
|
||||
//}
|
||||
|
||||
CargaGrafica();
|
||||
CargaGrafica3();
|
||||
if ($('#C_DivIndicadores')) {
|
||||
$('#C_DivIndicadores').slick({
|
||||
lazyLoad: 'ondemand',
|
||||
slidesToShow: 3,
|
||||
slidesToScroll: 1,
|
||||
dots: true,
|
||||
infinite: true,
|
||||
autoplay: true,
|
||||
autoplaySpeed: 5000,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 1024,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: true
|
||||
}
|
||||
}, {
|
||||
breakpoint: 600,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: true
|
||||
}
|
||||
}]
|
||||
});
|
||||
$('#C_DivIndicadores').show();
|
||||
$('#C_chartcheckboxes').hide();
|
||||
}
|
||||
}
|
||||
$(document).ready(function () {
|
||||
|
||||
filldata();
|
||||
Sys.Application.add_load(function (s, e) {
|
||||
filldata()
|
||||
});
|
||||
//filldata();
|
||||
//Sys.Application.add_load(function (s, e) {
|
||||
// filldata()
|
||||
//});
|
||||
});
|
||||
function CargaDia(pFecha) {
|
||||
__doPostBack('txtFecha', pFecha);
|
||||
@@ -465,5 +470,127 @@
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Librería principal de amCharts 4 -->
|
||||
<script src="https://cdn.amcharts.com/lib/4/core.js"></script>
|
||||
|
||||
<!-- Módulo de gráficos de XYChart -->
|
||||
<script src="https://cdn.amcharts.com/lib/4/charts.js"></script>
|
||||
|
||||
<!-- Tema animado de amCharts 4 -->
|
||||
<script src="https://cdn.amcharts.com/lib/4/themes/animated.js"></script>
|
||||
|
||||
<!-- Paquete de idioma español -->
|
||||
<script src="https://cdn.amcharts.com/lib/4/lang/es_ES.js"></script>
|
||||
|
||||
<script >
|
||||
|
||||
// Función para crear series dinámicamente
|
||||
function createSeries(field, name) {
|
||||
var series = chart.series.push(new am4charts.LineSeries());
|
||||
series.dataFields.valueY = field;
|
||||
series.dataFields.categoryX = "mes";
|
||||
series.name = name;
|
||||
series.strokeWidth = 2;
|
||||
|
||||
// Añadir bullets a la serie
|
||||
var bullet = series.bullets.push(new am4charts.CircleBullet());
|
||||
bullet.circle.radius = 4;
|
||||
bullet.circle.fill = am4core.color("#fff");
|
||||
bullet.circle.strokeWidth = 2;
|
||||
|
||||
// Configurar el tooltip para cada serie
|
||||
series.tooltipText = "{name}: [bold]{valueY}[/]";
|
||||
series.tooltip.pointerOrientation = "vertical";
|
||||
series.tooltip.background.cornerRadius = 5;
|
||||
series.tooltip.background.fillOpacity = 0.8;
|
||||
series.tooltip.label.padding(10, 10, 10, 10);
|
||||
|
||||
// Asegurar que el label del tooltip sea visible
|
||||
series.tooltip.label.fill = am4core.color("#000"); // Texto en negro
|
||||
|
||||
// Mostrar el tooltip solo al pasar el cursor sobre la serie
|
||||
series.tooltip.showInViewport = false;
|
||||
|
||||
// Habilitar interacciones en la serie
|
||||
series.interactionsEnabled = true;
|
||||
}
|
||||
|
||||
|
||||
function generaGrafico(dtGrafico,dtseries) {
|
||||
|
||||
// Importar las librerías de amCharts
|
||||
am4core.useTheme(am4themes_animated);
|
||||
|
||||
// Crear el gráfico
|
||||
var chart = am4core.create("chartdiv", am4charts.XYChart);
|
||||
|
||||
// Ejemplo de datos dinámicos
|
||||
chart.data = dtGrafico; //[
|
||||
|
||||
var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());
|
||||
categoryAxis.dataFields.category = "mes";
|
||||
categoryAxis.renderer.grid.template.location = 0;
|
||||
categoryAxis.renderer.minGridDistance = 30;
|
||||
|
||||
// Configuración del eje Y (Importe)
|
||||
var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());
|
||||
valueAxis.title.text = "Importe";
|
||||
|
||||
for (var i = 0; i < dtseries.length; i++) {
|
||||
var item = dtseries[i];
|
||||
var key = Object.keys(item)[0];
|
||||
var value = item[key];
|
||||
|
||||
var series = chart.series.push(new am4charts.LineSeries());
|
||||
series.dataFields.valueY = key;
|
||||
series.dataFields.categoryX = "mes";
|
||||
series.name = value;
|
||||
series.strokeWidth = 2;
|
||||
|
||||
// Añadir bullets a la serie
|
||||
var bullet = series.bullets.push(new am4charts.CircleBullet());
|
||||
bullet.circle.radius = 4;
|
||||
bullet.circle.fill = am4core.color("#fff");
|
||||
bullet.circle.strokeWidth = 2;
|
||||
|
||||
// Configurar el tooltip para cada serie
|
||||
series.tooltipText = "{name}: [bold]{valueY}[/]";// "{" + value + "}: [bold]{" + key +"}[/]";
|
||||
series.tooltip.pointerOrientation = "vertical";
|
||||
series.tooltip.background.cornerRadius = 5;
|
||||
series.tooltip.background.fillOpacity = 0.8;
|
||||
series.tooltip.label.padding(10, 10, 10, 10);
|
||||
|
||||
// Asegurar que el label del tooltip sea visible
|
||||
series.tooltip.label.fill = am4core.color("#000"); // Texto en negro
|
||||
|
||||
// Mostrar el tooltip solo al pasar el cursor sobre la serie
|
||||
series.tooltip.showInViewport = false;
|
||||
|
||||
// Habilitar interacciones en la serie
|
||||
series.interactionsEnabled = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Habilitar el cursor pero deshabilitar su tooltip
|
||||
chart.cursor = new am4charts.XYCursor();
|
||||
chart.cursor.behavior = "none"; // Deshabilitar pan o zoom
|
||||
chart.cursor.lineX.disabled = true;
|
||||
chart.cursor.lineY.disabled = true;
|
||||
chart.cursor.tooltipEnabled = false; // Deshabilitar el tooltip del cursor
|
||||
|
||||
// Leyenda
|
||||
chart.legend = new am4charts.Legend();
|
||||
|
||||
// Exportar el gráfico
|
||||
chart.exporting.menu = new am4core.ExportMenu();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using System.Data;
|
||||
using static Extensiones.ModExtensiones;
|
||||
@@ -280,14 +280,19 @@ public partial class Ventas_RepProductosServiciosPeriodo : ClsPaginas
|
||||
CveClienteClasificacion: DdlClienteClasificacion.SelectedValue.ToEntero(), ModalidadContable: !ChkLecturaAdmin.Checked))
|
||||
{
|
||||
GvDatos.DataSource = ObjVentas.DtResultados;
|
||||
DtVentas = ObjVentas.DtResultados;
|
||||
}
|
||||
DtVentas = ObjVentas.DtResultados;
|
||||
}
|
||||
CveProyecto = DdlProyecto.SelectedValue.ToEntero();
|
||||
ObjVentas.Dispose();
|
||||
GvDatos.DataBind();
|
||||
if (GvDatos.Rows.Count > 0)
|
||||
{
|
||||
//CargaGraficas(DtVentas);
|
||||
//this.DvGraficas.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.DvGraficas.Visible = false;
|
||||
}
|
||||
UPDatos.Update();
|
||||
|
||||
@@ -298,6 +303,37 @@ public partial class Ventas_RepProductosServiciosPeriodo : ClsPaginas
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region GRAFICA
|
||||
|
||||
private void CargaGraficas(DataTable DtVentas)
|
||||
{
|
||||
MuestraGrafica(div_ventas, DtVentas, "GPO", "Total", "", "", "gh2", "");
|
||||
}
|
||||
private void CargaGraficaNEW(DataTable D_T_Datos)
|
||||
{
|
||||
JArray jsonData = new JArray();
|
||||
for (int x=24; x <= 35 ; x++)
|
||||
{
|
||||
string Mes = D_T_Datos.Columns[x].ColumnName;
|
||||
|
||||
|
||||
JObject obj = new JObject();
|
||||
obj.Add(new JProperty("mes", Mes));
|
||||
for (int y = 1; y <= D_T_Datos.Rows.Count - 1; y++) // y Empiesa en 1 para no agregar el total
|
||||
{
|
||||
obj.Add(new JProperty(D_T_Datos.Rows[y][4].ToString(), D_T_Datos.Rows[y][x].ToString()));
|
||||
}
|
||||
jsonData.Add(obj);
|
||||
}
|
||||
|
||||
JArray jsonSeries = new JArray();
|
||||
for (int y = 1; y <= D_T_Datos.Rows.Count - 1; y++) // y Empiesa en 1 para no agregar el total
|
||||
{
|
||||
JObject obj = new JObject(
|
||||
new JProperty(D_T_Datos.Rows[y][4].ToString(), D_T_Datos.Rows[y][4].ToString())
|
||||
);
|
||||
jsonSeries.Add(obj);
|
||||
}
|
||||
string jsdatos = jsonData.ToString();
|
||||
string jsseries = jsonSeries.ToString();
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<asp:LinkButton ID="LnkVerGrafica" OnClick="LnkVerGrafica_Click" runat="server">Ver Grafica</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkModalPorcentajes" OnClick="LnkModalPorcentajes_Click" runat="server" Visible="false"><i class="fa fa-list" aria-hidden="true"></i> Consultar porcentajes</asp:LinkButton>
|
||||
<asp:LinkButton ID="LnkModalPorcentajes" OnClick="LnkModalPorcentajes_Click" runat="server" Visible="false"><i class="fa fa-list" aria-hidden="true"></i> Ventas Menores %</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -286,7 +286,7 @@
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID="LblModalTituloPorcentajes" runat="server" ClientIDMode="Static" Text="">Consulta Porcentajes</asp:Label>
|
||||
<asp:Label ID="LblModalTituloPorcentajes" runat="server" ClientIDMode="Static" Text="">Consulta Ventas menores a </asp:Label>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@@ -326,8 +326,8 @@
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtModalPorcentaje" runat="server" CausesValidation="true" CssClass="form-control" MaxLength="13" Text="5" Enabled="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtModalPorcentaje" CssClass="help-block errorimput" runat="server" ControlToValidate="TxtModalPorcentaje" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Porcentaje''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalPorcentaje"></asp:RequiredFieldValidator>
|
||||
<ajax:FilteredTextBoxExtender ID="FIETTxtModalPorcentaje" TargetControlID="TxtModalPorcentaje" FilterType="Numbers,Custom" ValidChars="-" runat="server" />
|
||||
<label for="<%= TxtModalPorcentaje.ClientID.ToString()%>">Porcentaje Menor a:</label>
|
||||
<ajax:FilteredTextBoxExtender ID="FIETTxtModalPorcentaje" TargetControlID="TxtModalPorcentaje" FilterType="Numbers,Custom" ValidChars="-." runat="server" />
|
||||
<label for="<%= TxtModalPorcentaje.ClientID.ToString()%>">% Menor a:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
@@ -346,17 +346,18 @@
|
||||
CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None" OnRowDataBound="GvPorcentajes_RowDataBound" >
|
||||
<Columns>
|
||||
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Left" HeaderText="SubProyecto" DataField="SubProyecto" ItemStyle-Width="200px" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Left" HeaderText="SubProyecto" DataField="SubProyecto" ItemStyle-Width="120px" />
|
||||
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Serie Folio" DataTextField="SerieFolio" DataTextFormatString="{0}" Target="_blank"
|
||||
DataNavigateUrlFields="CveVenta"
|
||||
DataNavigateUrlFormatString="Ventas.aspx?CveVenta={0}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Center" HeaderText="Fecha" DataField="FechaVenta" DataFormatString="{0:d}" ItemStyle-Width="100px" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:N}" ItemStyle-Width="100px" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Center" HeaderText="Fecha" DataField="FechaVenta" DataFormatString="{0:d}" ItemStyle-Width="85px" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:N}" ItemStyle-Width="90px" />
|
||||
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Costo" DataField="Costo" DataFormatString="{0:N}" ItemStyle-Width="90px" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="% Neto" DataField="PorNeto" DataFormatString="{0:N}" ItemStyle-Width="70px" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Left" HeaderText="Vendedor" DataField="Vendedor" ItemStyle-Width="100px" />
|
||||
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Costo" DataField="Costo" DataFormatString="{0:N}" ItemStyle-Width="100px" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="% Neto" DataField="PorNeto" DataFormatString="{0:N}" ItemStyle-Width="100px" />
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
|
||||
@@ -1987,18 +1987,23 @@
|
||||
<asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Serie">
|
||||
<asp:TemplateField HeaderText="Serie" visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSerie" Text='<%# Eval("Serie") %>' Visible="false" runat="server" />
|
||||
<asp:TextBox ID="TxtSerie" AutoPostBack="false" Text='<%# Eval("Serie") %>' Visible="false" runat="server" />
|
||||
<asp:Button Text="" ID="BtnSerie" Style="display: none;" OnClick="BtnSerie_Click" runat="server" />
|
||||
<asp:HiddenField runat="server" Value='<%# Eval("Serie") %>' ID="HdnSerie" />
|
||||
|
||||
<%--<asp:HiddenField runat="server" ID="HdnSerieLote" Value='<%# Eval("SerieLote")%>' />--%>
|
||||
<asp:HiddenField runat="server" Value='<%# Eval("Serie") %>' ID="HdnSerie" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Lote" HeaderText="Lote" />
|
||||
<asp:BoundField DataField="Lote" HeaderText="Lote" Visible="False" />
|
||||
<asp:BoundField DataField="FechaCaducidad" HeaderText="F. Caducidad" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Lote/Caducidad" ItemStyle-HorizontalAlign="Left" Visible="false" ItemStyle-Width="270px">
|
||||
<ItemTemplate>
|
||||
<asp:DropDownList ID="DdlCaducidadProducto" CssClass="select2me" Width="100%" runat="server" Visible="false" CausesValidation="true" >
|
||||
<asp:ListItem Selected="True" Text="-" Value="|"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
|
||||
@@ -6716,6 +6716,9 @@ Partial Class Ventas
|
||||
ddlAlmacen.Items.Clear()
|
||||
|
||||
DTAlmacen = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}")
|
||||
If UsuarioActual.CveEmpresa = 199 Then
|
||||
DTAlmacen.Merge(GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto <> {DdlSubProyectoDatos.SelectedValue.ToEntero()}"))
|
||||
End If
|
||||
ddlAlmacen.DataSource = DTAlmacen
|
||||
|
||||
ddlAlmacen.Items.Insert(0, New ListItem("Seleccione ", "-1"))
|
||||
@@ -9526,18 +9529,18 @@ Partial Class Ventas
|
||||
e.Row.FCLiteral("LtlSerie").Visible = True
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("CveTipoInvPS").ToEntero() = 5 And CveVenta <= 0 Then
|
||||
|
||||
e.Row.FCTextBox("TxtSerie").Visible = True
|
||||
e.Row.FCTextBox("TxtSerie").Attributes.Remove("onkeypress")
|
||||
e.Row.FCTextBox("TxtSerie").Attributes.Add("onkeypress", String.Format("SeriePS(event,{0},this,{1});", e.Row.FCButton("BtnSerie").ClientID, e.Row.FCHiddenField("HdnSerie").ClientID))
|
||||
e.Row.FCTextBox("TxtSerie").Attributes.Remove("onblur")
|
||||
e.Row.FCTextBox("TxtSerie").Attributes.Add("onblur", String.Format("SeriePSBlur({0},this,{1});", e.Row.FCButton("BtnSerie").ClientID, e.Row.FCHiddenField("HdnSerie").ClientID))
|
||||
|
||||
'e.Row.FCTextBox("TxtSerie").Attributes.Add("onkeyup", String.Format("LimpiaAF(1, '{0}'); EnterAFEdit(event,this,{1},{2});", e.Row.FCHiddenField("HdnCveConcepto").Value, e.Row.FCHiddenField("HdnCveAF").ClientID, e.Row.FCHiddenField("HdnCodAF").ClientID))
|
||||
|
||||
'e.Row.FCTextBox("LblCodigo").Attributes.Add("onkeyup", String.Format("LimpiaAF(1, '{0}'); EnterAFEdit(event,this,{1},{2});", e.Row.FCHiddenField("HdnCveConcepto").Value, e.Row.FCHiddenField("HdnCveAF").ClientID, e.Row.FCHiddenField("HdnCodAF").ClientID))
|
||||
'e.Row.FCTextBox("LblCodigo").Attributes.Add("onblur", String.Format("LimpiaAF(1, '{0}'); AFBlurEdit(this,{1},{2});", e.Row.FCHiddenField("HdnCveConcepto").Value, e.Row.FCHiddenField("HdnCveAF").ClientID, e.Row.FCHiddenField("HdnCodAF").ClientID))
|
||||
If CveVenta <= 0 Then
|
||||
If e.Row.DBCampo("AplicaSerie").ToEntero() = 1 Then
|
||||
GvInv.Columns(4).Visible = True
|
||||
e.Row.FCTextBox("TxtSerie").Visible = True
|
||||
e.Row.FCTextBox("TxtSerie").Attributes.Remove("onkeypress")
|
||||
e.Row.FCTextBox("TxtSerie").Attributes.Add("onkeypress", String.Format("SeriePS(event,{0},this,{1});", e.Row.FCButton("BtnSerie").ClientID, e.Row.FCHiddenField("HdnSerie").ClientID))
|
||||
e.Row.FCTextBox("TxtSerie").Attributes.Remove("onblur")
|
||||
e.Row.FCTextBox("TxtSerie").Attributes.Add("onblur", String.Format("SeriePSBlur({0},this,{1});", e.Row.FCButton("BtnSerie").ClientID, e.Row.FCHiddenField("HdnSerie").ClientID))
|
||||
End If
|
||||
If e.Row.DBCampo("AplicaLote").ToEntero() = 1 Then
|
||||
CargarCaducidadProducto(e.Row.DBCampo("CvePS").ToEntero, e.Row.FCDropDownList("DdlCaducidadProducto"), "", Nothing)
|
||||
End If
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("CvePS") = "" Then
|
||||
@@ -9590,6 +9593,37 @@ Partial Class Ventas
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargarCaducidadProducto(CvePS As Integer, ByRef DdlLoteFechaCaducidad As DropDownList, ValorAsignado As String, DtDatosDevolucion As DataTable)
|
||||
DdlLoteFechaCaducidad.Items.Clear()
|
||||
DdlLoteFechaCaducidad.Items.Add(New ListItem("-", "|"))
|
||||
|
||||
Dim almacenes As String = ddlAlmacen.SelectedValue
|
||||
If almacenes = "" Then
|
||||
almacenes = "-1"
|
||||
End If
|
||||
GvInv.Columns(7).Visible = True
|
||||
If DtDatosDevolucion IsNot Nothing Then
|
||||
DdlLoteFechaCaducidad.Visible = True
|
||||
For Each dr As DataRow In DtDatosDevolucion.FiltraParametros($"CvePS = {CvePS}", DistinctColumns:={"Lote", "FechaCaducidad"}).Rows
|
||||
DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} - Cad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"))
|
||||
Next
|
||||
Else
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
|
||||
DdlLoteFechaCaducidad.Visible = True
|
||||
For Each dr As DataRow In ObjInventarios.DtResultados.FiltraParametros("", DistinctColumns:={"Lote", "FechaCaducidad"}).Rows
|
||||
DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} - Cad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"))
|
||||
Next
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(ValorAsignado) Then
|
||||
DdlLoteFechaCaducidad.SelectedValueExist(ValorAsignado)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GVINV_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvInv.RowEditing
|
||||
GvInv.EditIndex = e.NewEditIndex
|
||||
CargaGVInv(DtInv.FiltraParametros("CveTipoPS=2"))
|
||||
@@ -10132,6 +10166,8 @@ Partial Class Ventas
|
||||
Dim CveProducto As Integer
|
||||
Dim Existencia As Double
|
||||
Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero()
|
||||
Dim tCveSubProyecto As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
|
||||
If UsuarioActual.CveEmpresa = 199 Then tCveSubProyecto = -1
|
||||
For Each dr As DataRow In TmpDT.FiltraParametros("CveTipoPS = 2").Rows
|
||||
|
||||
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
|
||||
@@ -10141,7 +10177,7 @@ Partial Class Ventas
|
||||
Cantidad = TmpDT.SUM("Cantidad", $"CvePS = {CveProducto} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") 'VALIDA CONTRA LA SUMA DEL MISMO PS
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso RemisionesLista.Count < 1 AndAlso dr("EntregaDirecta").ToString().ToEntero() < 1 Then
|
||||
Dim BuscarEnTabla As Boolean = If(UsuarioActual.Empresa.Funcionalidad(715) = "1", True, False)
|
||||
Existencia = ObjInventarios.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(),
|
||||
Existencia = ObjInventarios.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=tCveSubProyecto,
|
||||
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, PendientePorSurtir:=1,
|
||||
RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
|
||||
If Existencia < Cantidad Then
|
||||
@@ -16606,8 +16642,16 @@ Partial Class Ventas
|
||||
End If
|
||||
Dim CveSeccionAlmacen As Integer = -3
|
||||
'If AplicaSeccion Then CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacen, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen", "").ToEntero
|
||||
Dim Lote As String = "-1"
|
||||
Dim FCaducidad As Date = MinFecha
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Dr("Serie").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
||||
If GvInv.Rows(i).FCDropDownList("DdlCaducidadProducto") IsNot Nothing AndAlso GvInv.Rows(i).FCDropDownList("DdlCaducidadProducto").Visible Then
|
||||
Dim ArrayCaducidad As String() = GvInv.Rows(i).FCDropDownList("DdlCaducidadProducto").SelectedValue.Split("|"c)
|
||||
Lote = ArrayCaducidad(0)
|
||||
FCaducidad = ArrayCaducidad(1).ToDate
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Dr("Serie").ToString(), Lote:=Lote, FechaCaducidad:=FCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
||||
OcurrioError = True
|
||||
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
|
||||
Exit For
|
||||
@@ -19181,6 +19225,16 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'ECONO, SOLO EL CLIENTE SIGI, PUEDE MODIFICAR EL IVA A 16%
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DdlIVA.Visible Then
|
||||
If TxtCodigo.Text.Trim().ToUpper() = "SIGI" Then
|
||||
DdlIVA.Enabled = True
|
||||
Else
|
||||
DdlIVA.Enabled = False
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
UpFacturar.Update()
|
||||
@@ -20331,6 +20385,9 @@ Partial Class Ventas
|
||||
Row("CodigoPS") = DrPS("PSCodigo").ToString()
|
||||
Row("CveTipoPS") = DrPS("CveTipoPS")
|
||||
Row("CveTipoInvPS") = DrPS("Inv_CveMetodoInventario")
|
||||
Row("AplicaSerie") = DrPS("AplicaSerie")
|
||||
Row("AplicaLote") = DrPS("AplicaLote")
|
||||
Row("AplicaCaducidad") = DrPS("AplicaCaducidad")
|
||||
Row("CveTamaño") = DrPS("CveTamaño")
|
||||
Row("CodigoObjetoImpuesto") = DrPS("CodigoObjetoImpuesto")
|
||||
|
||||
@@ -20589,6 +20646,9 @@ Partial Class Ventas
|
||||
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
|
||||
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("AplicaSerie", GetType(Integer))
|
||||
TmpDT.Columns.Add("AplicaLote", GetType(Integer))
|
||||
TmpDT.Columns.Add("AplicaCaducidad", GetType(Integer))
|
||||
TmpDT.Columns.Add("Serie", GetType(String))
|
||||
TmpDT.Columns.Add("CuentaPredial", GetType(String))
|
||||
TmpDT.Columns.Add("Obs", GetType(String))
|
||||
@@ -24949,6 +25009,8 @@ Partial Class Ventas
|
||||
ObjInventarios.Dispose()
|
||||
UpINV.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function ValidaSerieINV() As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim Existencia As Decimal = 0
|
||||
@@ -25295,7 +25357,7 @@ Partial Class Ventas
|
||||
DtTemporal.Columns.Add(colNew)
|
||||
End If
|
||||
|
||||
GvInv.Columns(4).Visible = DtTemporal.MAX("Serie", "Serie <> ''") <> "" Or CveVenta <= 0
|
||||
GvInv.Columns(4).Visible = DtTemporal.MAX("Serie", "Serie <> ''") <> ""
|
||||
GvInv.Columns(5).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> ""
|
||||
GvInv.Columns(6).Visible = DtTemporal.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
|
||||
@@ -32612,6 +32674,15 @@ Partial Class Ventas
|
||||
GvPS.Columns(20).Visible = True
|
||||
End If
|
||||
|
||||
'ECONO, SOLO EL CLIENTE SIGI, PUEDE MODIFICAR EL IVA A 16%
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DdlIVA.Visible Then
|
||||
If TxtCodigo.Text.Trim().ToUpper() = "SIGI" Then
|
||||
DdlIVA.Enabled = True
|
||||
Else
|
||||
DdlIVA.Enabled = False
|
||||
End If
|
||||
End If
|
||||
|
||||
UpPS.Update()
|
||||
UPPDescuento.Update()
|
||||
UPObservaciones.Update()
|
||||
|
||||
Reference in New Issue
Block a user