--merge RepCancelacionesPorRespuesta.aspx

This commit is contained in:
2024-06-26 12:00:12 -07:00
25 changed files with 423 additions and 152 deletions

View File

@@ -2,7 +2,7 @@
Option Strict On
Imports System.Data
Imports System.IO
Imports System.IO
Imports Extensiones
Partial Class Ventas_PVCobranza
@@ -17,8 +17,6 @@ Partial Class Ventas_PVCobranza
End Set
End Property
Private Property DineroCaja As Double
Get
Return If(IsNothing(ViewState("DineroCaja")), 0, ViewState("DineroCaja").ToString().ToDecimal())
@@ -183,7 +181,7 @@ Partial Class Ventas_PVCobranza
If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then
If ObjPVenta.DtResultados.Rows.Count > 0 Then
Total = ObjPVenta.DtResultados(0)("ImporteInicial").ToString().ToDouble + ObjPVenta.DtResultados(0)("VentasEfectivo").ToString().ToDouble + ObjPVenta.DtResultados(0)("Ingresado").ToString().ToDouble - ObjPVenta.DtResultados(0)("Retirado").ToString().ToDouble - ObjPVenta.DtResultados(0)("Devoluciones").ToString().ToDouble
Total = ObjPVenta.DtResultados(0)("ImporteInicial").ToString.ToDouble + ObjPVenta.DtResultados(0)("VentasEfectivo").ToString().ToDouble + ObjPVenta.DtResultados(0)("Ingresado").ToString().ToDouble - ObjPVenta.DtResultados(0)("Retirado").ToString().ToDouble - ObjPVenta.DtResultados(0)("Devoluciones").ToString().ToDouble
DineroCaja = Total
LblEfectivoEsperado.Text = Total.FormatoNumero(2)
LblEfectivoBloqueo.Text = Total.FormatoNumero(2)
@@ -388,6 +386,7 @@ Partial Class Ventas_PVCobranza
End If
Dim PagadoSinEfectivo As Decimal = Pagado - TxtImporteEfectivo.Text.ToDecimal
Dim tCveCorte As Integer = CveCorte
If PagadoSinEfectivo > LtlSaldo.Text.ToDecimal() Then
Alert("El pago con los metodos de pago actuales no puede ser mayor al importe de la venta", TipoMensaje.MsgAdvertencia)
@@ -422,9 +421,10 @@ Partial Class Ventas_PVCobranza
VentaActual.PorcentajeIVA = DbRowVenta("PorcentajeIVA").ToString.ToDecimal
VentaActual.UsuarioActual = UsuarioActual
VentaActual.CveSubProyecto = DbRowVenta("CveSubProyecto").ToString.ToEntero
If tCveCorte <= 0 AndAlso DbRowVenta("CveCorte").ToString.ToEntero > 0 Then tCveCorte = DbRowVenta("CveCorte").ToString.ToEntero
Dim CvePrePoliza As Integer
Dim Fecha As Date = NowADS()
Dim Fecha As Date = DbRowVenta("Fecha").ToString.ToDate 'NowADS()
Dim MsgError As String = ""
Dim SaldoPendiente As Decimal = DbRowVenta("Saldo").ToString.ToDecimal
@@ -440,75 +440,76 @@ Partial Class Ventas_PVCobranza
Try
'FACTURAR LA REMISION PARA HACER EL PAGO
If UsuarioActual.CveEmpresa = 189 AndAlso VentaActual.TipoDocto = "Rem" Then
If UsuarioActual.CveEmpresa.Contiene(189, 197) AndAlso VentaActual.TipoDocto = "Rem" Then
respFactura = GenerarFactura(VentaActual, ObjVentas2, ObjClientes)
If respFactura Is Nothing Then
MsgError = "Ocurrío un error al generar la factura"
MsgError = "Ocurrió un error al generar la factura"
ElseIf (respFactura IsNot Nothing AndAlso respFactura.Mensajes.Count > 0) AndAlso respFactura.TieneError Then
MsgError = respFactura.Mensajes(0)
End If
'REALIZAR EL PAGO EN LA FACTURA
If respFactura IsNot Nothing AndAlso Not respFactura.TieneError Then
CveVenta = respFactura.CveVenta
End If
End If
CvePrePoliza = ObjConta.AddPrePolizas("PVCobranza", 11, 0, 0, 1, Fecha, $"Pago {VentaActual.SerieFolio}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
If MsgError = "" Then
CvePrePoliza = ObjConta.AddPrePolizas("PVCobranza", 11, 0, 0, 1, Fecha, $"Pago {VentaActual.SerieFolio}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
If CvePrePoliza > 0 Then
If CvePrePoliza > 0 Then
If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteCredito.Text.ToDecimal > 0 Then
MsgError = RegistraIE(12, DdlCuentaTarjetaCredito.SelectedValue.ToEntero, TxtImporteCredito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2)
SaldoPendiente -= TxtImporteCredito.Text.ToDecimal
PagoAplicado += TxtImporteCredito.Text.ToDecimal
End If
If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteDebito.Text.ToDecimal > 0 Then
MsgError = RegistraIE(11, DdlCuentaTarjetaDebito.SelectedValue.ToEntero, TxtImporteDebito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2)
SaldoPendiente -= TxtImporteDebito.Text.ToDecimal
PagoAplicado += TxtImporteDebito.Text.ToDecimal
End If
If SaldoPendiente > 0 AndAlso TxtImporteCheque.Text.ToDecimal > 0 Then
MsgError = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2)
SaldoPendiente -= TxtImporteCheque.Text.ToDecimal
PagoAplicado += TxtImporteCheque.Text.ToDecimal
End If
If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteTransferencia.Text.ToDecimal > 0 Then
MsgError = RegistraIE(8, DdlCuentaTransferencia.SelectedValue.ToEntero, TxtImporteTransferencia.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2)
SaldoPendiente -= TxtImporteTransferencia.Text.ToDecimal
PagoAplicado += TxtImporteTransferencia.Text.ToDecimal
End If
If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteEfectivo.Text.ToDecimal > 0 Then
Dim PagoEfectivo As Decimal = TxtImporteEfectivo.Text.ToDecimal
PagoAplicado += PagoEfectivo
If PagoAplicado >= SaldoTotalInicial Then
TxtCambio.Text = (PagoAplicado - SaldoTotalInicial).FormatoNumero
PagoEfectivo = SaldoPendiente
If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteCredito.Text.ToDecimal > 0 Then
MsgError = RegistraIE(12, DdlCuentaTarjetaCredito.SelectedValue.ToEntero, TxtImporteCredito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte)
SaldoPendiente -= TxtImporteCredito.Text.ToDecimal
PagoAplicado += TxtImporteCredito.Text.ToDecimal
End If
MsgError = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, PagoEfectivo, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2)
SaldoPendiente -= PagoEfectivo
End If
If SaldoPendiente > 0 Then
MsgError = "Tiene saldo pendiente por aplicar"
End If
If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteDebito.Text.ToDecimal > 0 Then
MsgError = RegistraIE(11, DdlCuentaTarjetaDebito.SelectedValue.ToEntero, TxtImporteDebito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte)
SaldoPendiente -= TxtImporteDebito.Text.ToDecimal
PagoAplicado += TxtImporteDebito.Text.ToDecimal
End If
If MsgError = "" AndAlso Not ObjVentas2.UpdateVentaCorte(CveVenta, UsuarioActual.CveEmpresa, CveCorte) Then
MsgError = "Error al aplicar el corte"
End If
If SaldoPendiente > 0 AndAlso TxtImporteCheque.Text.ToDecimal > 0 Then
MsgError = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte)
SaldoPendiente -= TxtImporteCheque.Text.ToDecimal
PagoAplicado += TxtImporteCheque.Text.ToDecimal
End If
If MsgError = "" AndAlso Not ObjVentas2.UpdateVentaTicketImpreso(CveVenta, 0) Then
MsgError = "No se pudo desmarcar la impresión"
End If
If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteTransferencia.Text.ToDecimal > 0 Then
MsgError = RegistraIE(8, DdlCuentaTransferencia.SelectedValue.ToEntero, TxtImporteTransferencia.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte)
SaldoPendiente -= TxtImporteTransferencia.Text.ToDecimal
PagoAplicado += TxtImporteTransferencia.Text.ToDecimal
End If
Else
MsgError = "Error al registrar prepólizas"
If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteEfectivo.Text.ToDecimal > 0 Then
Dim PagoEfectivo As Decimal = TxtImporteEfectivo.Text.ToDecimal
PagoAplicado += PagoEfectivo
If PagoAplicado >= SaldoTotalInicial Then
TxtCambio.Text = (PagoAplicado - SaldoTotalInicial).FormatoNumero
PagoEfectivo = SaldoPendiente
End If
MsgError = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, PagoEfectivo, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte)
SaldoPendiente -= PagoEfectivo
End If
If SaldoPendiente > 0 Then
MsgError = "Tiene saldo pendiente por aplicar"
End If
If MsgError = "" AndAlso Not ObjVentas2.UpdateVentaCorte(CveVenta, UsuarioActual.CveEmpresa, tCveCorte) Then
MsgError = "Error al aplicar el corte"
End If
If MsgError = "" AndAlso Not ObjVentas2.UpdateVentaTicketImpreso(CveVenta, 0) Then
MsgError = "No se pudo desmarcar la impresión"
End If
Else
MsgError = "Error al registrar prepólizas"
End If
End If
Catch ex As Exception
MsgError = "Error al registrar el pago"
@@ -517,16 +518,14 @@ Partial Class Ventas_PVCobranza
If MsgError = "" Then
ObjVentas2.Commit()
Dim msBuild As New StringBuilder()
'SI SE GENERO FACTURA DE INGRESO, TIMBRARLA DESPUES DE REALIZAR EL PAGO
If respFactura IsNot Nothing Then
If Not respFactura.Factura.TimbrarFactura() Then
Alert("La factura no se pudo timbrar", TipoMensaje.MsgAdvertencia)
msBuild.Append("La factura no se pudo timbrar<br/> ")
End If
End If
Dim msBuild As New StringBuilder()
If respFactura IsNot Nothing Then
msBuild.Append($"Pago Registrado correctamente.")
For Each m In respFactura.Mensajes
@@ -632,7 +631,7 @@ Partial Class Ventas_PVCobranza
ObjFactura.GenerarSalidaAlmacen = True
ObjFactura.DtInventario = ObjFactura.DtDetalle.FiltraParametros("CveTipoPS = 2").Copy()
ObjFactura.CveAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 1 AND CveSubProyecto = {VentaRemision.CveSubProyecto}").ToString().ToEntero()
ObjFactura.CveAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 1 AND CveSubProyecto = {VentaRemision.CveSubProyecto}", "Orden").ToString().ToEntero()
ObjFactura.CalculaTotales()
ObjFactura.PreparaTimbre()
@@ -706,11 +705,11 @@ Partial Class Ventas_PVCobranza
Return Retorno
End Function
Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImportePago As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad, ByRef ObjVentas As ClsVentas) As String
Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImportePago As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad, ByRef ObjVentas As ClsVentas, tCveCorte As Integer) As String
Dim Retorno As String = ""
Dim CveIEPago As Integer = 0
Dim ErrorConta As Boolean
CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, VentaActual.SerieFolio, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte)
CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, VentaActual.SerieFolio, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte)
If CveIEPago > 0 Then
Dim Pago As New VentaPago
Pago.ImportePagoVenta = ImportePago

View File

@@ -571,11 +571,12 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
{
factura.RealizarDevolucionAlmacen = true;
}
if (UsuarioActual.TienePermisoProceso(269) && UsuarioActual.Empresa.Funcionalidad(109) == "1" && factura.TipoDocto == "Ing" && factura.SaldoAlmacen != 0)
bool AplicaCancelacionConPagos = false;
if (UsuarioActual.Empresa.Funcionalidad(382) == "1")
{
factura.RealizarDevolucionAlmacen = true;
AplicaCancelacionConPagos = true;
}
retorno = factura.EjecutarCancelacionPendiente(CveEstatus, CancelacionFecha, CancelacionAcuse);
retorno = factura.EjecutarCancelacionPendiente(CveEstatus, CancelacionFecha, CancelacionAcuse,AplicaCancelacionConPagos: AplicaCancelacionConPagos);
}

198
Ventas/RepPedidosSTF.aspx Normal file
View File

@@ -0,0 +1,198 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPedidosSTF.aspx.vb" Inherits="Ventas_RepPedidosSTF" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.SegundoNivel, .SegundoNivel:hover {
background-color: rgba(172, 195, 222, 0.65) !important;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<%-- <li>
<asp:LinkButton ID="LnkPdf" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
</li>--%>
<li>
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
</li>
<%-- <asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkVerGrafica" runat="server">Ver Grafica</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>--%>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group pull-right btn-separete">
<%-- <asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-fit-height btnopaco" />--%>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</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" class="btn btn-primary" OnClick="BtnConsultar_Click" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<asp:Label ID="LblProyecto" runat="server" class="col-md-1 truncate">Proyecto:</asp:Label>
<div runat="server" id="DivProyecto" class="col-md-2">
<asp:DropDownList ID="DdlProyecto" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
</div>
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
<div runat="server" id="DivSubProyecto" class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
<%-- <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>
<label class="col-md-1 truncate">Vendedor:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlVendedor" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
<%-- <asp:DropDownList ID="DdlVendedor" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" 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 Ventas con los filtros especificados"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None" Width="99%">
<Columns>
<asp:BoundField HeaderText="Grupo" DataField="GPO" ItemStyle-Width="40%" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-Width="20%">
<HeaderTemplate>
<asp:Literal runat="server" Text='<%# NowADS().Year %>'></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Anio1", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="20%">
<HeaderTemplate>
<asp:Literal runat="server" Text='<%# (NowADS().Year - 1) %>'></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Anio2", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="20%">
<HeaderTemplate>
<asp:Literal runat="server" Text='<%# (NowADS().Year - 2) %>'></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Anio3", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UpTipoCambio" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivTipoCambio" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="Label2" runat="server" ClientIDMode="Static" Text="Cambiar Tipo Cambio de Dólares"></asp:Label></h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpBodyTipoCambio" UpdateMode="Conditional">
<ContentTemplate>
<asp:RadioButtonList runat="server" ID="RblTipoCambio" AutoPostBack="true">
<asp:ListItem Selected="true" Text="Moneda Original" Value="1"></asp:ListItem>
<asp:ListItem Text="Dólares en Tipo Cambio de la Fecha Compra" Value="2"></asp:ListItem>
<asp:ListItem Text="Tipo Cambio Especifico" Value="3"></asp:ListItem>
</asp:RadioButtonList>
<div class="row" style="margin-left: 10px;" runat="server" id="LiEspecifico" visible="false">
Especifico:
<asp:TextBox ID="TxtEspecifico" runat="server" Width="55px" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:Button ID="BtnTipoCambio" runat="server" Text="Aceptar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivModalGrafica" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog modal-lg" runat="server" ID="UPModalProd" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="LblTituloGrafica" runat="server" ClientIDMode="Static" Text=""></asp:Label>
</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-2"></div>
<label class="col-md-1 truncate">Grafica:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlGrafica" runat="server" AutoPostBack="true" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Barras" Value="1"></asp:ListItem>
<asp:ListItem Text="Pastel" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 truncate">&nbsp;&nbsp;&nbsp;Ver:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlVer" runat="server" AutoPostBack="true" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Total" Value="1"></asp:ListItem>
<asp:ListItem Text="SubTotal" Value="2"></asp:ListItem>
<asp:ListItem Text="IVA" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<br />
<div id="chartdiv"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,50 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class Ventas_RepPedidosSTF
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaCombos()
End If
End Sub
Private Sub CargaCombos()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
'Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)") 'vendedores y vendedores de piso
DdlVendedor.DataBind()
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
DdlVendedor.Items.Insert(1, New ListItem("Sin Vendedor", "-2"))
End Sub
Protected Sub CargaDatos()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetRepPedidosSTF(DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
GvDatos.DataBind()
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("TipoFila")
Case "1"
e.Row.CssClass = "Totales"
Case "2"
e.Row.CssClass = "SubTotales"
Case "3"
e.Row.CssClass = "Texto"
End Select
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
UPDatos.Update()
End Sub
End Class

View File

@@ -9330,6 +9330,7 @@ Partial Class Ventas
e.Row.CssClass = "SubTotales"
End If
Else
e.Row.FCLiteral("LtlPS").Text = String.Format("<a Class='Texto' target='_blank' href='/Inventarios/Kardex.aspx?CvePS={0}&CveAlmacen={1}&FechaI={2}&FechaF={3}'> {4}</a>", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveAlmacen"), e.Row.DBCampo("Fecha").ToDate.AddDays(-7).ToShortDateString, e.Row.DBCampo("Fecha").ToDate.AddDays(7).ToShortDateString, e.Row.DBCampo("PS"))
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
e.Row.FCCheckBox("cbInv").Visible = True
@@ -24500,6 +24501,11 @@ Partial Class Ventas
If Not DtTemporal.Columns.Contains("Serie") Then
DtTemporal.Columns.Add("Serie", Type.GetType("System.String"))
End If
If Not DtTemporal.Columns.Contains("CveAlmacen") Then DtTemporal.Columns.Add("CveAlmacen", GetType(Integer))
If Not DtTemporal.Columns.Contains("Fecha") Then
Dim colNew As DataColumn = New DataColumn("Fecha", GetType(Date)) With {.DefaultValue = NowADS()}
DtTemporal.Columns.Add(colNew)
End If
GvInv.Columns(4).Visible = DtTemporal.MAX("Serie", "Serie <> ''") <> "" Or CveVenta <= 0
GvInv.Columns(5).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> ""
@@ -37637,16 +37643,7 @@ Partial Class Ventas
Private Sub CargaDdlClientesSucursal()
Dim objcliente As New ClsClientes
If objcliente.GetClienteSucursales(-1, UsuarioActual.CveEmpresa) Then
DdlClienteSucursal.DataSource = objcliente.DtResultados
Else
DdlClienteSucursal.DataSource = Nothing
End If
objcliente.Dispose()
DdlClienteSucursal.DataSource = GlobalDTClientesSucursales(UsuarioActual.CveEmpresa)
DdlClienteSucursal.DataBind()
DdlClienteSucursal.Items.Insert(0, New ListItem("Seleccione uno", "-1"))