Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -203,7 +203,7 @@ Partial Class CatClientes
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Clasificaciones de Clientes
|
||||
Catálogo de giros de clientes
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
@@ -34,7 +34,7 @@
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvClasificacion" runat="server" AutoGenerateColumns="False" DataKeyNames="CveClienteClasificacion" EmptyDataText="No se encontraron Clasificaciones." ToolTip="Listado de Clasificacaiones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="ClienteClasificacion" ItemStyle-Width="30%" HeaderText="Clasificación" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:BoundField DataField="ClienteClasificacion" ItemStyle-Width="30%" HeaderText="Giro" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="30%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:BoundField DataField="Usuario" ItemStyle-Width="30%" HeaderText="Usuario" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
|
||||
@@ -4054,7 +4054,7 @@ Partial Class Clientes
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
@@ -6380,7 +6380,7 @@ Partial Class Clientes
|
||||
params.Add(New ReportParameter("Cliente", LtlCliente.Text))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
@@ -6425,7 +6425,7 @@ Partial Class Clientes
|
||||
params.Add(New ReportParameter("Cliente", LtlCliente.Text))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
@@ -6800,7 +6800,7 @@ Partial Class Clientes
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime().ToShortDateString()))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
@@ -9872,7 +9872,7 @@ Partial Class Clientes
|
||||
params.Add(New ReportParameter("AgrupadoPor", "Cliente: " & LtlCliente.Text))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -8165,7 +8165,7 @@ Partial Class PV
|
||||
'End If
|
||||
|
||||
'If Imagen.Exists Then
|
||||
' params.Add(New ReportParameter("LogoPath", logouri))
|
||||
' params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
'Else
|
||||
' params.Add(New ReportParameter("LogoPath", ""))
|
||||
'End If
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ProductosServicios.aspx.vb" Inherits="ProductosyServicios" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<script runat="server">
|
||||
|
||||
Protected Sub RBLCantidad_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
End Sub
|
||||
</script>
|
||||
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
<link href="/Metronic/assets/global/plugins/cubeportfolio/css/cubeportfolio.css" rel="stylesheet" type="text/css" />
|
||||
@@ -577,7 +572,7 @@
|
||||
<i></i>
|
||||
</div>--%>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtRetIVA" CssClass="form-control" runat="server" MaxLength="2" Text="0"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtRetIVA" CssClass="form-control" runat="server" MaxLength="7" Text="0"></asp:TextBox>
|
||||
<label for="<%= TxtRetIVA.ClientID.ToString()%>">Retención de IVA:</label><asp:RequiredFieldValidator ID="RFVRetIVA" runat="server" ControlToValidate="TxtRetIVA" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Retención de IVA''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVRetIVA" runat="server" ControlToValidate="TxtRetIVA" Display="None" ErrorMessage="El campo <b>''Retención de IVA''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCRetIVA1" runat="server" HighlightCssClass="vco" TargetControlID="RFVRetIVA" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
@@ -585,7 +580,7 @@
|
||||
<i>%</i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtRetISR" CssClass="form-control" runat="server" MaxLength="2" Text="0"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtRetISR" CssClass="form-control" runat="server" MaxLength="7" Text="0"></asp:TextBox>
|
||||
<label for="<%= TxtRetISR.ClientID.ToString()%>">Retención de ISR:</label><asp:RequiredFieldValidator ID="RFVRetISR" runat="server" ControlToValidate="TxtRetISR" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Retención de ISR''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVRetISR" runat="server" ControlToValidate="TxtRetISR" Display="None" ErrorMessage="El campo <b>''Retención de ISR''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVRetISR" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
@@ -1906,10 +1901,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
El producto seleccionado en el recuadro de arriba sera unificado en el producto actual
|
||||
|
||||
|
||||
|
||||
El producto seleccionado en el recuadro de arriba sera unificado en el producto actual
|
||||
<b>
|
||||
<asp:Literal Text="" ID="LtProductoUnificar" runat="server" /></b>
|
||||
</p>
|
||||
|
||||
@@ -1993,7 +1993,7 @@ Partial Class ProductosyServicios
|
||||
RegistraScript("$('#DivUnificar').modal();LimpiaModalUnificar()")
|
||||
End Sub
|
||||
Public Sub CargaPSUnificar()
|
||||
DdlPsUnificar.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
DdlPsUnificar.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, Estatus:=-1)
|
||||
DdlPsUnificar.DataBind()
|
||||
'DdlPsUnificar.setEsWebService(True)
|
||||
'DdlPsUnificar.ddlWS.Attributes.Add("data-clear", "1")
|
||||
|
||||
@@ -288,7 +288,7 @@ Partial Class Ventas_RepAuxiliarFacturas
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", $"{Cliente}{FechaInicio}{FechaFin}{Clasificacion}{PS}{Proyecto}{Estatus}"))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -138,7 +138,7 @@ Partial Class RepRemisiones
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -100,7 +100,7 @@ Partial Class RepRemisionesDetalle
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -176,7 +176,7 @@ Partial Class RepCotizacionesxFacturar
|
||||
' params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
' params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
' If Imagen.Exists Then
|
||||
' params.Add(New ReportParameter("LogoPath", logouri))
|
||||
' params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
' Else
|
||||
' params.Add(New ReportParameter("LogoPath", ""))
|
||||
' End If
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Activities.Expressions;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
@@ -138,7 +139,7 @@ public partial class Ventas_RepNCxAplicar : ClsPaginas
|
||||
|
||||
if (Imagen.Exists)
|
||||
{
|
||||
@params.Add(new ReportParameter("LogoPath", logouri));
|
||||
@params.Add(new ReportParameter("LogoPath", $"file://{Imagen.FullName}"));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -220,7 +220,7 @@ Partial Class Ventas_RepPS
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -102,7 +102,7 @@ Partial Class Ventas_RepPUESinPago
|
||||
params.Add(New ReportParameter("AgrupadoPor", $"{FI}{FF}{cliente}{subProy}{vendedor}"))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -286,7 +286,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label title="Clasificación Cliente" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Clasif. Cli.:</label>
|
||||
<label title="Giro del Cliente" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Giro Cli.:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClienteClasificacion" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteClasificacion_SelectedIndexChanged" runat="server" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" DataTextField="ClienteClasificacion" DataValueField="CveClienteClasificacion" Style="width: 100%;" ></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
@@ -573,7 +573,7 @@ Partial Class Ventas_RepProductosServicios
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", $"{Grupo}{Cliente}{FechaInicio}{FechaFin}{Categoria}{Clasificacion}{PS}{Proyecto}{Estatus}{Usuario}{Proveedor}"))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -287,7 +287,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label title="Clasificación Cliente" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Clasif.Cliente:</label>
|
||||
<label title="Giro del Cliente" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Giro Cliente:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClienteClasificacion" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteClasificacion_SelectedIndexChanged" runat="server" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" DataTextField="ClienteClasificacion" DataValueField="CveClienteClasificacion" Style="width: 100%"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
@@ -784,7 +784,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -254,15 +254,15 @@ Partial Class Ventas_RepRecuperacion
|
||||
RutaPDF = "Empresas/Grales/Formatos/RepRecuperacion.rdlc"
|
||||
End If
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -351,15 +351,15 @@ Partial Class Ventas_RepRecuperacionDetalle
|
||||
RutaPDF = "Empresas/Grales/Formatos/RepRecuperacionDetalle.rdlc"
|
||||
End If
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningun corte" DataKeyNames="CveVenta"
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ninguna remisión pendiente por facturar" DataKeyNames="CveVenta"
|
||||
ToolTip="Remisiones sin Facturar"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
data-sort="true" Style="text-align: center;" GridLines="None">
|
||||
|
||||
@@ -145,7 +145,7 @@ Partial Class RepRemisiones
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -168,7 +168,7 @@ Partial Class RepRemisionesNC
|
||||
' params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
' params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
' If Imagen.Exists Then
|
||||
' params.Add(New ReportParameter("LogoPath", logouri))
|
||||
' params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
' Else
|
||||
' params.Add(New ReportParameter("LogoPath", ""))
|
||||
' End If
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label title="Clasificación Cliente" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Clasif. Cli.:</label>
|
||||
<label title="Giro del Cliente" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Giro Cli.:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClienteClasificacion" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteClasificacion_SelectedIndexChanged" runat="server" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" DataTextField="ClienteClasificacion" DataValueField="CveClienteClasificacion"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
@@ -1050,7 +1050,7 @@ Partial Class RepVentaDetalle
|
||||
params.Add(New ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {Grupo} {TipoDocto} {FechaIn} {FechaFn} {FechaIEjec} {FechaFEjec} {CveCliente} {CveSucursal} {CveSucursalEjec} {Vendedor} {CveUsuario} {CveEstatusFactura} {CondicionesPago} "))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label title="Clasificación Cliente" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Clasif. Cli.:</label>
|
||||
<label title="Giro del Cliente" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Giro Cli.:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClienteClasificacion" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteClasificacion_SelectedIndexChanged" runat="server" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" DataTextField="ClienteClasificacion" DataValueField="CveClienteClasificacion"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
@@ -695,7 +695,7 @@ Partial Class Ventas_RepVentas
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -325,7 +325,7 @@ Partial Class Ventas_RepVentas
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -330,7 +330,7 @@ Partial Class RepVentasPeriodo
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -337,7 +337,7 @@ Partial Class Ventas_RepVentasUtilidad
|
||||
params.Add(New ReportParameter("UtilidadPerdida", LblNombreNeto.Text))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -331,7 +331,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
|
||||
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
@@ -380,7 +380,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
|
||||
params.Add(New ReportParameter("AgrupadoPor", $"{Cliente}{Sucursal}{Vendedor}{PS}{Clasificacion}{FechaIn}{FechaFn}"))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -297,7 +297,7 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
params.Add(New ReportParameter("Rentabilidad", $"{LblRentabilidad.Text}%"))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
@@ -784,6 +784,18 @@
|
||||
<td>activado
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="left" id="TrTipoContable" runat="server" visible="False">
|
||||
<td><b>Tipo Contable:</b> </td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlTipoContable" runat="server" CssClass="form-control input-sm select2me" Width="80%">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Complementaria" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoContable" runat="server" ControlToValidate="DdlTipoContable" InitialValue="-1" ErrorMessage="Debe Seleccionarse un tipo contable" ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCETipoContable" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoContable" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
|
||||
@@ -2242,10 +2242,10 @@ Partial Class Ventas
|
||||
|
||||
Private Property SaldoLineaAdicional As Decimal
|
||||
Get
|
||||
Return (IfNull(ViewState("ImporteLineaAdicional"), "0", ViewState("ImporteLineaAdicional"))).ToString().ToDecimal()
|
||||
Return (IfNull(ViewState("SaldoLineaAdicional"), "0", ViewState("SaldoLineaAdicional"))).ToString().ToDecimal()
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("ImporteLineaAdicional") = value
|
||||
ViewState("SaldoLineaAdicional") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -5568,6 +5568,17 @@ Partial Class Ventas
|
||||
LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
|
||||
End If
|
||||
|
||||
'SI ES COMPLEMENTARIA, NO DEBE PERMITIR FACTURAR
|
||||
If UsuarioActual.Empresa.Funcionalidad(706) = "1" AndAlso DbRowVenta("TipoContable").ToString() <> "-1" Then
|
||||
If DbRowVenta("TipoContable").ToString() = "0" Then
|
||||
BtnsFacturar.Visible = False
|
||||
End If
|
||||
|
||||
TrTipoContable.Visible = True
|
||||
DdlTipoContable.SelectedValueExist(DbRowVenta("TipoContable").ToString())
|
||||
DdlTipoContable.Enabled = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If DbRowVenta("TipoDocto").ToString().Contiene("Cot", "Pd2") Then
|
||||
@@ -8974,15 +8985,15 @@ Partial Class Ventas
|
||||
EsValido = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(133).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
|
||||
CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo)
|
||||
'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
|
||||
If PU <= CostoMayor Then
|
||||
EsValidoMayor = True
|
||||
End If
|
||||
Else
|
||||
EsValidoMayor = True
|
||||
End If
|
||||
'If UsuarioActual.Empresa.Funcionalidad(133).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
|
||||
' CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo)
|
||||
' 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
|
||||
' If PU <= CostoMayor Then
|
||||
' EsValidoMayor = True
|
||||
' End If
|
||||
'Else
|
||||
' EsValidoMayor = True
|
||||
'End If
|
||||
|
||||
'VALIDA PROMOCION: SI TIENE PROMOCION Y EL PRECIO ES MENOR AL PRECIO DE PROMOCION, NO PASA | SI YA CUMPLE NO VUELVE A VALIDAR
|
||||
If Not EsValido Or PU = 0 Then
|
||||
@@ -8998,24 +9009,24 @@ Partial Class Ventas
|
||||
End If
|
||||
'NO DEJA REGISTRAR CON VALIDACION DE COSTO ALMACEN O PROMOCION
|
||||
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
||||
If Not EsValido Then
|
||||
'If Not EsValido Then
|
||||
|
||||
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio menor de su Costo ni a un precio mayor de su rango aceptado<br/>", dr("PS").ToString())
|
||||
If TienePermisoImportes Then
|
||||
MensajeCosto.AppendFormat("El costo del producto es: <b>{0:#,###.00}$</b> <br/>", Costo)
|
||||
MensajeCosto.AppendFormat("El rango menor aceptado es: {0} <b>{1:#,###.00}$</b> <br/>", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor)
|
||||
MensajeCosto.AppendFormat("El precio indicado es: <b>{0:#,###.00}$</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
|
||||
End If
|
||||
End If
|
||||
' MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio menor de su Costo ni a un precio mayor de su rango aceptado<br/>", dr("PS").ToString())
|
||||
' If TienePermisoImportes Then
|
||||
' MensajeCosto.AppendFormat("El costo del producto es: <b>{0:#,###.00}$</b> <br/>", Costo)
|
||||
' MensajeCosto.AppendFormat("El rango menor aceptado es: {0} <b>{1:#,###.00}$</b> <br/>", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor)
|
||||
' MensajeCosto.AppendFormat("El precio indicado es: <b>{0:#,###.00}$</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If Not EsValidoMayor Then
|
||||
MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio mayor de su rango aceptado<br/>", dr("PS").ToString())
|
||||
If TienePermisoImportes Then
|
||||
MensajeCosto.AppendFormat("El costo del producto es: <b>{0:#,###.00}$</b> <br/>", Costo)
|
||||
MensajeCosto.AppendFormat("El rango mayor aceptado es: {0} <b>{1:#,###.00}$</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor)
|
||||
MensajeCosto.AppendFormat("El precio indicado es: <b>{0:#,###.00}$</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
|
||||
End If
|
||||
End If
|
||||
'If Not EsValidoMayor Then
|
||||
' MensajeCosto.AppendFormat("El Producto <b>{0}</b>. No se puede vender a un precio mayor de su rango aceptado<br/>", dr("PS").ToString())
|
||||
' If TienePermisoImportes Then
|
||||
' MensajeCosto.AppendFormat("El costo del producto es: <b>{0:#,###.00}$</b> <br/>", Costo)
|
||||
' MensajeCosto.AppendFormat("El rango mayor aceptado es: {0} <b>{1:#,###.00}$</b> <br/>", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor)
|
||||
' MensajeCosto.AppendFormat("El precio indicado es: <b>{0:#,###.00}$</b> ({1}% de ganancia) <br/>", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
|
||||
' End If
|
||||
'End If
|
||||
|
||||
' SOLO SI TIENE LA FUNCIONALIDAD DE RESTRICCION VALIDA EL IMPORTE CERO
|
||||
If UsuarioActual.Empresa.Funcionalidad(139).ToString().ToEntero() > 0 Then
|
||||
@@ -9115,10 +9126,13 @@ Partial Class Ventas
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
Dim Archivo2 As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
Dim ArchivoSti As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta))
|
||||
Dim ArchivoSti2 As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.mrt", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
LnkImprimir.Visible = False
|
||||
|
||||
'If (UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 81, 83) And UsuarioActual.CveUsuario = 100) Or UsuarioActual.CveEmpresa.Contiene(80, 83) Or UsuarioActual.CveUsuario = 100 Then
|
||||
If (Archivo.Exists Or Archivo2.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then
|
||||
If (Archivo.Exists Or Archivo2.Exists Or ArchivoSti.Exists Or ArchivoSti2.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then
|
||||
HplDownPDF.Visible = True
|
||||
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
@@ -12640,7 +12654,13 @@ Partial Class Ventas
|
||||
tCveTipoPoliza = 1 ' que sea siempre ingreso.
|
||||
End If
|
||||
|
||||
factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVenta", factura.CvePlantillaPoliza, factura.Total, factura.Total, factura.CveMoneda, factura.Fecha, If(CveEmpresaCRM > 0, LblEmpresaCRM.Text, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa, CveTipoPoliza:=tCveTipoPoliza)
|
||||
Dim TipoContable As Integer = -1
|
||||
If UsuarioActual.Empresa.Funcionalidad(706) = "1" AndAlso factura.TipoDocto = "Rem" Then
|
||||
'1-Contable, 0-Complementaria
|
||||
TipoContable = DdlTipoContable.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVenta", factura.CvePlantillaPoliza, factura.Total, factura.Total, factura.CveMoneda, factura.Fecha, If(CveEmpresaCRM > 0, LblEmpresaCRM.Text, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa, CveTipoPoliza:=tCveTipoPoliza, TipoContable:=TipoContable)
|
||||
|
||||
Dim RFCReceptor As String = ""
|
||||
|
||||
@@ -13126,7 +13146,7 @@ Partial Class Ventas
|
||||
|
||||
If ErrorList.Count = 0 Then
|
||||
'prepoliza
|
||||
GuardarVentaPrePolizas(ObjConta, factura, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, EsNCAmortizacion:=EsNCAmortizacion, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCDescuento, ObjInventario:=ObjInventario)
|
||||
GuardarVentaPrePolizas(ObjConta, factura, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, EsNCAmortizacion:=EsNCAmortizacion, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCDescuento, ObjInventario:=ObjInventario, TipoContable:=TipoContable)
|
||||
If ErrorList.Count = 0 Then
|
||||
|
||||
'INVENTARIOS
|
||||
@@ -13161,7 +13181,7 @@ Partial Class Ventas
|
||||
Private Sub GuardarVentaPrePolizas(ByRef ObjConta As ClsContabilidad, factura As Modelos.Factura, TmpDTDetalleMovimientos As DataTable, CveNCaVincular As Integer,
|
||||
ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing,
|
||||
ByRef Optional ObjEventos As ClsOIEventos = Nothing, Optional EsNCAmortizacion As Boolean = False, Optional NCDescuento As Boolean = False,
|
||||
Optional ValorMultiplicador As Integer = 1, Optional ListaNCDescuento As List(Of Modelos.Factura) = Nothing, Optional ObjInventario As ClsInventarios = Nothing)
|
||||
Optional ValorMultiplicador As Integer = 1, Optional ListaNCDescuento As List(Of Modelos.Factura) = Nothing, Optional ObjInventario As ClsInventarios = Nothing, Optional TipoContable As Integer = -1)
|
||||
|
||||
Dim CveIE As Integer = -1
|
||||
Dim DT As DataTable = Nothing
|
||||
@@ -13180,7 +13200,7 @@ Partial Class Ventas
|
||||
If DdlTipoComprobante.SelectedValue <> "Cot" Then
|
||||
If factura.CvePrePoliza > 0 Then
|
||||
|
||||
If ProcesoPrepolizas(ObjConta, factura, CveIE, TmpDTDetalleMovimientos, objContPaqi, ValorMultiplicador, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, EsNCAmortizacion:=EsNCAmortizacion, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCDescuento, ObjInventario:=ObjInventario) Then
|
||||
If ProcesoPrepolizas(ObjConta, factura, CveIE, TmpDTDetalleMovimientos, objContPaqi, ValorMultiplicador, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, EsNCAmortizacion:=EsNCAmortizacion, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCDescuento, ObjInventario:=ObjInventario, TipoContable:=TipoContable) Then
|
||||
ErrorList.Add("Ocurrió un error al agregar los Movimientos de la prepoliza.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
End If
|
||||
|
||||
@@ -13192,7 +13212,7 @@ Partial Class Ventas
|
||||
Private Function ProcesoPrepolizas(ByRef ObjConta As ClsContabilidad, ObjFactura As Modelos.Factura, CveIE As Integer, TmpDTDetalle As DataTable, ByRef objContPaqi As ClsContPAQi,
|
||||
Optional ValorMultiplicador As Integer = 1, ByRef Optional ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing,
|
||||
ByRef Optional ObjEventos As ClsOIEventos = Nothing, Optional EsNCAmortizacion As Boolean = False, Optional NCDescuento As Boolean = False,
|
||||
Optional ListaNCDescuento As List(Of Modelos.Factura) = Nothing, Optional ObjInventario As ClsInventarios = Nothing) As Boolean
|
||||
Optional ListaNCDescuento As List(Of Modelos.Factura) = Nothing, Optional ObjInventario As ClsInventarios = Nothing, Optional TipoContable As Integer = -1) As Boolean
|
||||
Try
|
||||
Dim DT As DataTable
|
||||
Dim CvePlantilaPoliza As Integer
|
||||
@@ -13343,8 +13363,13 @@ Partial Class Ventas
|
||||
End If
|
||||
IdCtaContableCliente = IdCtaContable
|
||||
|
||||
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 190, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 193, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=False, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||
Dim ContabilizableRem As Boolean = False
|
||||
If TipoContable <> -1 Then
|
||||
ContabilizableRem = True
|
||||
End If
|
||||
|
||||
If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 190, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=ContabilizableRem, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 193, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), Contabilizable:=ContabilizableRem, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
Else
|
||||
@@ -14841,16 +14866,14 @@ Partial Class Ventas
|
||||
Next
|
||||
End If
|
||||
|
||||
If DivAlmacen.Visible AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
|
||||
If factura.TipoDocto.Contiene("Ing", "Dev") AndAlso DivAlmacen.Visible AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
|
||||
|
||||
Dim Filtro As String = ""
|
||||
Select Case factura.TipoDocto
|
||||
Case "Ing", "Ped"
|
||||
Case "Ing"
|
||||
Filtro = "CveConcepto IN (3,40)"
|
||||
Case "Dev"
|
||||
Filtro = "CveConcepto IN (3,40)"
|
||||
Case Else
|
||||
Filtro = "CveConcepto = 9"
|
||||
End Select
|
||||
|
||||
Dim CveConceptoAlmacen As Integer = 3
|
||||
@@ -15776,47 +15799,8 @@ Partial Class Ventas
|
||||
For Each gvr As GridViewRow In GVAnticipos.Rows
|
||||
If gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
|
||||
|
||||
|
||||
Dim FechaUltimaFluctuacion As Date = MinFecha
|
||||
Dim TipoCambioFluctuacion As Decimal = 1
|
||||
Dim tFecha As Date = Now
|
||||
|
||||
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
|
||||
If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
|
||||
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
|
||||
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN PESOS
|
||||
tipoCambioPago = 1
|
||||
tipoCambioVenta = 1
|
||||
tipoCambioVentaValuacion = 1
|
||||
PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal
|
||||
ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN DOLARES Y SE VA A PAGAR EN PESOS
|
||||
tipoCambioPago = gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
|
||||
tipoCambioVenta = TxtTipoCambio.Text.ToDecimal
|
||||
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
|
||||
PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
|
||||
ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 2 Then 'SI LA VENTA VIENE EN DOLARES Y SE VA A PAGAR EN DOLARES
|
||||
tipoCambioPago = gvr.DataKey("TipoCambio").ToString().ToDecimal
|
||||
tipoCambioVenta = TxtTipoCambio.Text.ToDecimal
|
||||
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
|
||||
PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal
|
||||
ElseIf DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 2 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN DOLARES
|
||||
tipoCambioPago = gvr.DataKey("TipoCambioHoy").ToDecimal() ' gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
|
||||
tipoCambioVenta = 1
|
||||
tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
|
||||
PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
|
||||
End If
|
||||
|
||||
Dim importeMovimiento As Decimal = 0
|
||||
Dim importeMN As Decimal = 0
|
||||
Dim TC As Decimal
|
||||
Dim IdCtaContable As Integer
|
||||
Dim TipoMovimiento As Boolean = True
|
||||
Dim Concepto As String = VentaActual.SerieFolio
|
||||
@@ -15886,81 +15870,22 @@ Partial Class Ventas
|
||||
If gvr.DataKey("CveIE").ToEntero() > 0 Then
|
||||
|
||||
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
|
||||
IdCtaContable = IdCtaContClientes
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
|
||||
Dim Pago As New VentaPago
|
||||
Pago.ImportePagoVenta = importeMovimiento
|
||||
Pago.ImportePago = importeMovimiento
|
||||
Pago.CveIE = CveIEAnticipo
|
||||
Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero()
|
||||
Pago.TipoPago = "A"
|
||||
Pago.TCPago = gvr.DataKey("TipoCambio").ToDecimal
|
||||
Pago.TipoPago = "I"
|
||||
Pago.FechaDocumentoRelacionado = gvr.DataKey("Fecha").ToDate
|
||||
Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero()
|
||||
Pago.AplicaTraslado = gvr.DataKey("RegresarImpuesto") = "1"
|
||||
Pago.Referencia = gvr.DataKey("Folio")
|
||||
|
||||
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
|
||||
|
||||
' Agregamos el 2
|
||||
If tipoCambioPago = 1 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContClientes, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, CveSubProyecto:=CveSubProyectoVenta) Then
|
||||
ErrorConta = True
|
||||
End If
|
||||
Else 'Cuando son dolares
|
||||
If importeMovimiento <> 0 Then
|
||||
If IdCtaContComplementaria > 0 Or 0 > 0 Then
|
||||
'Agregamos la Complementaria
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, 0, Concepto, 207, Concepto, Now, IdCtaContComplementaria, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then
|
||||
ErrorConta = True
|
||||
End If
|
||||
'Agregamos la Extranjera
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then
|
||||
ErrorConta = True
|
||||
End If
|
||||
Else
|
||||
'Agregamos la Extranjera
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then
|
||||
ErrorConta = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
importeMovimiento = ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / TxtTotal.Text.ToDecimal) * TxtIVA.Text.ToDecimal)
|
||||
importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero)
|
||||
|
||||
|
||||
'Agregamos el 92
|
||||
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal 'gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo" & gvr.RowIndex).ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)
|
||||
importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero)
|
||||
IdCtaContable = IdCtaContAnticipos
|
||||
|
||||
If ObjCliente.GetClientes(gvr.DataKey("CveCliente").ToEntero(), "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
If Not tipoCambioPago = 1 Then
|
||||
IdCtaContable = ObjCliente.IdCtaMonedaExtranjeraAnticipos
|
||||
Else
|
||||
IdCtaContable = ObjCliente.IdCtaContAnticipos
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(119) Then
|
||||
If gvr.DataKey("Fecha").ToDate.Year <= 2017 AndAlso TxtFechaAnticipoCliente.Text.ToDate.Year >= 2018 Then
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
If Not tipoCambioPago = 1 Then
|
||||
IdCtaContable = ObjCliente.IdCtaContMonedaExtranjera
|
||||
Else
|
||||
IdCtaContable = ObjCliente.IdCtaContClientes
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, 555, Concepto, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMN, CveCuenta:=-1, TipoCambio:=tipoCambioPago, CveSubProyecto:=CveSubProyectoVenta) Then
|
||||
ErrorConta = True
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End Select
|
||||
@@ -16621,189 +16546,194 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region "I M A G E - B U T T O N S"
|
||||
Protected Function CancelarFactura(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjAC As ClsContPAQi, ByRef ObjBancos As ClsBancos) As Boolean
|
||||
Dim IDPoliza As Integer = -1
|
||||
Dim CvePrePoliza As Integer
|
||||
Dim CvePlantillaPoliza As Integer
|
||||
'Protected Function CancelarFactura(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjAC As ClsContPAQi, ByRef ObjBancos As ClsBancos) As Boolean
|
||||
' Dim IDPoliza As Integer = -1
|
||||
' Dim CvePrePoliza As Integer
|
||||
' Dim CvePlantillaPoliza As Integer
|
||||
|
||||
Dim ErrorCancelar As Boolean = False
|
||||
Dim Mensaje As String = ""
|
||||
' Dim ErrorCancelar As Boolean = False
|
||||
' Dim Mensaje As String = ""
|
||||
|
||||
Try
|
||||
ObjFacturaDevolucion.TipoDocto = ObjFactura.TipoDocto
|
||||
' Try
|
||||
' ObjFacturaDevolucion.TipoDocto = ObjFactura.TipoDocto
|
||||
|
||||
If ObjFacturaDevolucion.TipoDocto.Contiene("Egs", "Dev") Then
|
||||
CvePlantillaPoliza = 7
|
||||
ElseIf ObjFacturaDevolucion.TipoDocto.Contiene("Ing", "Rem", "Ant") Then
|
||||
CvePlantillaPoliza = 4
|
||||
End If
|
||||
' Dim TipoContable As Integer = -1
|
||||
' If ObjFacturaDevolucion.TipoDocto.Contiene("Egs", "Dev") Then
|
||||
' CvePlantillaPoliza = 7
|
||||
' ElseIf ObjFacturaDevolucion.TipoDocto.Contiene("Ing", "Rem", "Ant") Then
|
||||
' CvePlantillaPoliza = 4
|
||||
' End If
|
||||
|
||||
' If UsuarioActual.Empresa.Funcionalidad(706) = "1" AndAlso Then
|
||||
|
||||
' End If
|
||||
|
||||
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardaEstatus", CvePlantillaPoliza, TxtTotal.Text.ToDouble, TxtTotal.Text.Replace(",", "").ToDouble, DdlMoneda.SelectedValue.ToEntero(), Now, NombreCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
ObjFacturaDevolucion.CveVenta = CveVenta
|
||||
ObjFacturaDevolucion.CvePrePoliza = CvePrePoliza
|
||||
' CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardaEstatus", CvePlantillaPoliza, TxtTotal.Text.ToDouble, TxtTotal.Text.Replace(",", "").ToDouble, DdlMoneda.SelectedValue.ToEntero(), Now, NombreCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
' ObjFacturaDevolucion.CveVenta = CveVenta
|
||||
' ObjFacturaDevolucion.CvePrePoliza = CvePrePoliza
|
||||
|
||||
|
||||
If NuevaFactura = 1 AndAlso UsuarioActual.TienePermisoProceso(222) Then
|
||||
If ObjVentas.GetVentaDetalle(ObjFacturaDevolucion.CveVenta) Then
|
||||
TmpDT = ObjVentas.DtResultados
|
||||
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
||||
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
|
||||
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
|
||||
End If
|
||||
ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
|
||||
Else
|
||||
ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
|
||||
End If
|
||||
' If NuevaFactura = 1 AndAlso UsuarioActual.TienePermisoProceso(222) Then
|
||||
' If ObjVentas.GetVentaDetalle(ObjFacturaDevolucion.CveVenta) Then
|
||||
' TmpDT = ObjVentas.DtResultados
|
||||
' TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
||||
' TmpDT.Columns.Add("TieneProntoPago", GetType(String))
|
||||
' TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
|
||||
' End If
|
||||
' ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
|
||||
' Else
|
||||
' ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
|
||||
' End If
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFacturaDevolucion, -1)
|
||||
End If
|
||||
' If Not ErrorCancelar Then
|
||||
' ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFacturaDevolucion, -1)
|
||||
' End If
|
||||
|
||||
If CveEstatus = 4 Then
|
||||
' If CveEstatus = 4 Then
|
||||
|
||||
If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", Now, CveVenta, IDPoliza) Then
|
||||
Mensaje = "El nuevo estatus se guardó correctamente"
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", Now, CveVenta, IDPoliza) Then
|
||||
' Mensaje = "El nuevo estatus se guardó correctamente"
|
||||
' Else
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
|
||||
'Si se está mandando a Cancelada SAT
|
||||
ElseIf CveEstatus = 5 Then
|
||||
' 'Si se está mandando a Cancelada SAT
|
||||
' ElseIf CveEstatus = 5 Then
|
||||
|
||||
Dim DT As DataTable = Nothing
|
||||
' Dim DT As DataTable = Nothing
|
||||
|
||||
If FolioFiscal = "" Then
|
||||
Dim XmlDoc As New XmlDocument
|
||||
XmlDoc.Load(Ruta & "XML\" & DdlTipoComprobante.SelectedValue & "\" & VentaFolio & ".xml")
|
||||
ViewState("FolioFiscal") = XmlDoc.DocumentElement("cfdi:Complemento").FirstChild.Attributes("UUID").InnerText
|
||||
End If
|
||||
' If FolioFiscal = "" Then
|
||||
' Dim XmlDoc As New XmlDocument
|
||||
' XmlDoc.Load(Ruta & "XML\" & DdlTipoComprobante.SelectedValue & "\" & VentaFolio & ".xml")
|
||||
' ViewState("FolioFiscal") = XmlDoc.DocumentElement("cfdi:Complemento").FirstChild.Attributes("UUID").InnerText
|
||||
' End If
|
||||
|
||||
Dim ObjCancelacion As New Timbrado
|
||||
' Dim ObjCancelacion As New Timbrado
|
||||
|
||||
Dim Total As Decimal = TxtTotal.Text.ToDecimal
|
||||
Dim RFCReceptor As String = HdnRFCVenta.Value
|
||||
' Dim Total As Decimal = TxtTotal.Text.ToDecimal
|
||||
' Dim RFCReceptor As String = HdnRFCVenta.Value
|
||||
|
||||
If Not ObjVentas.UpdateEstatusFactura(13, FolioFiscal, "", Now, CveVenta, IDPoliza) Then 'Marcamos la factura como refacturada, si no se cancelo en el SAT el estatus nos dejara cancelarla despues
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
Dim RespCancelacion = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC)
|
||||
If RespCancelacion.Verificado Then
|
||||
'falta verificar traer el acuse y reenviarlo
|
||||
' If Not ObjVentas.UpdateEstatusFactura(13, FolioFiscal, "", Now, CveVenta, IDPoliza) Then 'Marcamos la factura como refacturada, si no se cancelo en el SAT el estatus nos dejara cancelarla despues
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
' Dim RespCancelacion = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC)
|
||||
' If RespCancelacion.Verificado Then
|
||||
' 'falta verificar traer el acuse y reenviarlo
|
||||
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
Dim IDMPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFacturaDevolucion, True)
|
||||
IDPoliza = IDMPoliza.IdPoliza
|
||||
If IDMPoliza.IdPoliza <= 0 Then
|
||||
Mensaje = "No se pudo generar la poliza"
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
End If
|
||||
' If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
' Dim IDMPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFacturaDevolucion, True)
|
||||
' IDPoliza = IDMPoliza.IdPoliza
|
||||
' If IDMPoliza.IdPoliza <= 0 Then
|
||||
' Mensaje = "No se pudo generar la poliza"
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, ObjCancelacion.CancelacionAcuse, Now, CveVenta, IDPoliza, CvePAC:=UsuarioActual.Empresa.CvePAC) Then
|
||||
Mensaje = "El nuevo estatus se guardó correctamente"
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
' If Not ErrorCancelar Then
|
||||
' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, ObjCancelacion.CancelacionAcuse, Now, CveVenta, IDPoliza, CvePAC:=UsuarioActual.Empresa.CvePAC) Then
|
||||
' Mensaje = "El nuevo estatus se guardó correctamente"
|
||||
' Else
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
|
||||
ObjCancelacion = Nothing
|
||||
' ObjCancelacion = Nothing
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
GuardaLog("CancelF." & ex.ToString())
|
||||
ErrorCancelar = True
|
||||
End Try
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
' GuardaLog("CancelF." & ex.ToString())
|
||||
' ErrorCancelar = True
|
||||
' End Try
|
||||
|
||||
Return Not ErrorCancelar
|
||||
End Function
|
||||
Protected Function CancelarFactura2(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjAC As ClsContPAQi, ObjBancos As ClsBancos) As Boolean
|
||||
' Return Not ErrorCancelar
|
||||
'End Function
|
||||
'Protected Function CancelarFactura2(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjAC As ClsContPAQi, ObjBancos As ClsBancos) As Boolean
|
||||
|
||||
Dim IDPoliza As Integer = -1
|
||||
Dim CvePrePoliza As Integer
|
||||
Dim CvePlantillaPoliza As Integer
|
||||
' Dim IDPoliza As Integer = -1
|
||||
' Dim CvePrePoliza As Integer
|
||||
' Dim CvePlantillaPoliza As Integer
|
||||
|
||||
Dim ErrorCancelar As Boolean = False
|
||||
Dim Mensaje As String = ""
|
||||
' Dim ErrorCancelar As Boolean = False
|
||||
' Dim Mensaje As String = ""
|
||||
|
||||
CreaObjetosVenta()
|
||||
' CreaObjetosVenta()
|
||||
|
||||
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
||||
CvePlantillaPoliza = 7
|
||||
ElseIf ObjFactura.TipoDocto.Contiene("Ing", "Rem") Then
|
||||
CvePlantillaPoliza = 4
|
||||
End If
|
||||
' If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
||||
' CvePlantillaPoliza = 7
|
||||
' ElseIf ObjFactura.TipoDocto.Contiene("Ing", "Rem") Then
|
||||
' CvePlantillaPoliza = 4
|
||||
' End If
|
||||
|
||||
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardaEstatus", CvePlantillaPoliza, TxtTotal.Text.ToDouble, TxtTotal.Text.Replace(",", "").ToDouble, DdlMoneda.SelectedValue.ToEntero(), Now, NombreCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
ObjFactura.CveVenta = CveVenta
|
||||
ObjFactura.CvePrePoliza = CvePrePoliza
|
||||
' CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardaEstatus", CvePlantillaPoliza, TxtTotal.Text.ToDouble, TxtTotal.Text.Replace(",", "").ToDouble, DdlMoneda.SelectedValue.ToEntero(), Now, NombreCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
' ObjFactura.CveVenta = CveVenta
|
||||
' ObjFactura.CvePrePoliza = CvePrePoliza
|
||||
|
||||
If HplSaldoAuxiliar.Text.ToDecimal > 0 Then
|
||||
ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
|
||||
End If
|
||||
' If HplSaldoAuxiliar.Text.ToDecimal > 0 Then
|
||||
' ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFactura, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
|
||||
' End If
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, -1)
|
||||
End If
|
||||
' If Not ErrorCancelar Then
|
||||
' ErrorCancelar = GuardarVentaImpuestosLocales(ObjVentas, ObjConta, ObjFactura, -1)
|
||||
' End If
|
||||
|
||||
If CveEstatus = 4 Then
|
||||
' If CveEstatus = 4 Then
|
||||
|
||||
If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", Now, CveVenta, IDPoliza) Then
|
||||
Mensaje = "El nuevo estatus se guardó correctamente"
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", Now, CveVenta, IDPoliza) Then
|
||||
' Mensaje = "El nuevo estatus se guardó correctamente"
|
||||
' Else
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
|
||||
'Si se está mandando a Cancelada SAT
|
||||
ElseIf CveEstatus = 5 Then
|
||||
' 'Si se está mandando a Cancelada SAT
|
||||
' ElseIf CveEstatus = 5 Then
|
||||
|
||||
Dim DT As DataTable = Nothing
|
||||
' Dim DT As DataTable = Nothing
|
||||
|
||||
If FolioFiscal = "" Then
|
||||
Dim XmlDoc As New XmlDocument
|
||||
XmlDoc.Load(Ruta & "XML\" & DdlTipoComprobante.SelectedValue & "\" & VentaFolio & ".xml")
|
||||
ViewState("FolioFiscal") = XmlDoc.DocumentElement("cfdi:Complemento").FirstChild.Attributes("UUID").InnerText
|
||||
End If
|
||||
' If FolioFiscal = "" Then
|
||||
' Dim XmlDoc As New XmlDocument
|
||||
' XmlDoc.Load(Ruta & "XML\" & DdlTipoComprobante.SelectedValue & "\" & VentaFolio & ".xml")
|
||||
' ViewState("FolioFiscal") = XmlDoc.DocumentElement("cfdi:Complemento").FirstChild.Attributes("UUID").InnerText
|
||||
' End If
|
||||
|
||||
'Si es cancelar en el SAT:
|
||||
Dim CFDi As New ClbNegBICFDv3_2.ClsNegEDI
|
||||
Dim Respuesta As New ClbNegBICFDv3_2.ClsNegRespuesta
|
||||
Respuesta = CFDi.CancelaCFdi(UsuarioActual.Empresa.BIUsuario, UsuarioActual.Empresa.BIContraseña, Ruta & "Certificados\" & UsuarioActual.Empresa.ArchivoPfx, UsuarioActual.Empresa.ContraseñaKey, UsuarioActual.Empresa.RFC, FolioFiscal, "http://208.43.160.178/srvCFDi/service1.asmx")
|
||||
' 'Si es cancelar en el SAT:
|
||||
' Dim CFDi As New ClbNegBICFDv3_2.ClsNegEDI
|
||||
' Dim Respuesta As New ClbNegBICFDv3_2.ClsNegRespuesta
|
||||
' Respuesta = CFDi.CancelaCFdi(UsuarioActual.Empresa.BIUsuario, UsuarioActual.Empresa.BIContraseña, Ruta & "Certificados\" & UsuarioActual.Empresa.ArchivoPfx, UsuarioActual.Empresa.ContraseñaKey, UsuarioActual.Empresa.RFC, FolioFiscal, "http://208.43.160.178/srvCFDi/service1.asmx")
|
||||
|
||||
If Respuesta Is Nothing Then
|
||||
'Alert("La factura no se pudo cancelar. <br />Posbiles causas:<br /> - Los servicios del SAT están ocupados.<br /> - El Folio Fiscal no ha quedado registrado.", TipoMensaje.MsgError)
|
||||
Me.GuardaLog(CFDi.MsgError)
|
||||
ErrorCancelar = True
|
||||
Mensaje = "La factura no se pudo cancelar. <br />Posbiles causas:<br /> - Los servicios del SAT están ocupados.<br /> - El Folio Fiscal no ha quedado registrado."
|
||||
ElseIf Respuesta.NoCertificadoSAT <> String.Empty Then
|
||||
' If Respuesta Is Nothing Then
|
||||
' 'Alert("La factura no se pudo cancelar. <br />Posbiles causas:<br /> - Los servicios del SAT están ocupados.<br /> - El Folio Fiscal no ha quedado registrado.", TipoMensaje.MsgError)
|
||||
' Me.GuardaLog(CFDi.MsgError)
|
||||
' ErrorCancelar = True
|
||||
' Mensaje = "La factura no se pudo cancelar. <br />Posbiles causas:<br /> - Los servicios del SAT están ocupados.<br /> - El Folio Fiscal no ha quedado registrado."
|
||||
' ElseIf Respuesta.NoCertificadoSAT <> String.Empty Then
|
||||
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
Dim IDMPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFacturaDevolucion, True)
|
||||
IDPoliza = IDMPoliza.IdPoliza
|
||||
If IDMPoliza.IdPoliza <= 0 Then
|
||||
Mensaje = "No se pudo generar la poliza"
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
End If
|
||||
' If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
' Dim IDMPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFacturaDevolucion, True)
|
||||
' IDPoliza = IDMPoliza.IdPoliza
|
||||
' If IDMPoliza.IdPoliza <= 0 Then
|
||||
' Mensaje = "No se pudo generar la poliza"
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, Respuesta.NoCertificadoSAT, Respuesta.FechaTimbrado, CveVenta, IDPoliza) Then
|
||||
Mensaje = "El nuevo estatus se guardó correctamente"
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' If Not ErrorCancelar Then
|
||||
' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, Respuesta.NoCertificadoSAT, Respuesta.FechaTimbrado, CveVenta, IDPoliza) Then
|
||||
' Mensaje = "El nuevo estatus se guardó correctamente"
|
||||
' Else
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
End If
|
||||
' End If
|
||||
|
||||
Return Not ErrorCancelar
|
||||
End Function
|
||||
' Return Not ErrorCancelar
|
||||
'End Function
|
||||
|
||||
Protected Sub ImgBtnAddC_Click(sender As Object, e As ImageClickEventArgs) Handles ImgBtnAddC.Click
|
||||
Dim Row As DataRow = Nothing
|
||||
@@ -17218,6 +17148,10 @@ Partial Class Ventas
|
||||
tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(706) = "1" AndAlso (CveVenta <= 0 OrElse EsCreaApartirDe) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
|
||||
TrTipoContable.Visible = True
|
||||
End If
|
||||
|
||||
Updatetabs.Update()
|
||||
UPCondicionesPago.Update()
|
||||
UpCliente.Update()
|
||||
@@ -19916,6 +19850,7 @@ Partial Class Ventas
|
||||
If Not OcurrioError AndAlso RemisionesLista.Count > 0 AndAlso DtRemConceptosSurtidos IsNot Nothing Then
|
||||
If DtRemConceptosSurtidos.SUMD("Surtido") <> DtRemConceptosSurtidos.SUMD("Cantidad") Then
|
||||
OcurrioError = True
|
||||
Alert("Lo facturado no coincide con lo surtido en inventario", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -26509,7 +26444,7 @@ Partial Class Ventas
|
||||
params.Add(New ReportParameter("FechaEstimada", FechaEstimada))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
@@ -33462,11 +33397,14 @@ Partial Class Ventas
|
||||
TxtPedidoContrato.Enabled = True
|
||||
TxtObsAlmacen.Enabled = True
|
||||
RblPaqueteria.Enabled = True
|
||||
DdlLineaAdicional.Enabled = True
|
||||
|
||||
LnkUpdateLineaAdicional.Visible = True
|
||||
'Acciones
|
||||
BtnEditar.Text = "Guardar"
|
||||
|
||||
CalculaLineasAdicionales()
|
||||
DdlLineaAdicional.Enabled = True
|
||||
|
||||
UpParametros.Update()
|
||||
UPObservaciones.Update()
|
||||
UpFacturar.Update()
|
||||
@@ -35348,9 +35286,17 @@ Partial Class Ventas
|
||||
|
||||
Me.CveCategoriaLineaAdicional = RowLinea("CveCategoria").ToString().ToEntero()
|
||||
Me.CveMonedaLineaAdicional = RowLinea("CveMoneda").ToString().ToEntero()
|
||||
Me.SaldoLineaAdicional = RowLinea("Saldo").ToString().ToDecimal()
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("No se pudieron obtener datos de la linea adicional", TipoMensaje.MsgAdvertencia)
|
||||
Me.SaldoLineaAdicional = 0
|
||||
Me.CveCategoriaLineaAdicional = 0
|
||||
End If
|
||||
Else
|
||||
Alert("No se pudieron obtener datos de la linea adicional", TipoMensaje.MsgAdvertencia)
|
||||
Me.SaldoLineaAdicional = 0
|
||||
Me.CveCategoriaLineaAdicional = 0
|
||||
End If
|
||||
End Using
|
||||
Else
|
||||
|
||||
@@ -409,7 +409,7 @@ Partial Class Ventas_eFacturas
|
||||
' params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
' params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
' If Imagen.Exists Then
|
||||
' params.Add(New ReportParameter("LogoPath", logouri))
|
||||
' params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
|
||||
' Else
|
||||
' params.Add(New ReportParameter("LogoPath", ""))
|
||||
' End If
|
||||
|
||||
Reference in New Issue
Block a user