-
This commit is contained in:
@@ -85,7 +85,7 @@ Partial Class Acumuladores_RepEntradasUsadosClientes
|
||||
|
||||
Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = DatosEntradasUsadosClientes}
|
||||
|
||||
ImprimirPDF(String.Format("Empresas/{0}/Formatos/RepEntradasUsadosClientes.rdlc", UsuarioActual.CveEmpresa), DatosEntradasUsadosClientes, params, "prueba", "PDF")
|
||||
ImprimirPDF(String.Format("Empresas/{0}/Formatos/RepEntradasUsadosClientes.rdlc", UsuarioActual.CveEmpresa), DatosEntradasUsadosClientes, params, "Entradas usados clientes", "PDF")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
396
Acumuladores/RepIndicadorDiario.aspx
Normal file
396
Acumuladores/RepIndicadorDiario.aspx
Normal file
@@ -0,0 +1,396 @@
|
||||
<%@ Page Title="Reporte de Compras Clasificación" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIndicadorDiario.aspx.vb" Inherits="ACumuladores_RepIndicadorDiario" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server">
|
||||
<i class="fa fa-ad-excel"></i> Exportar Excel
|
||||
</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte Indicador Diario
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.Widthall {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollHeadInner {
|
||||
width: 100% !important;
|
||||
background-color: #dddddd;
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollFoot {
|
||||
display: none;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.table-scrollable {
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scroll {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.table.dataTable {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollBody {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollBody table th {
|
||||
padding: 0px !important;
|
||||
padding-right: 4px !important;
|
||||
padding-left: 4px !important;
|
||||
}
|
||||
|
||||
/* 31/05/2018 - ListBoxs */
|
||||
.select2 .select2-selection__rendered {
|
||||
line-height: 1;
|
||||
color: #111;
|
||||
}
|
||||
|
||||
.select2 .select2-selection--multiple {
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
min-height: 20px;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.select2-selection__rendered {
|
||||
margin-top: 0px;
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
.select2-selection {
|
||||
margin-top: 0px;
|
||||
height: 31px;
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--focus .select2-selection--multiple {
|
||||
border: none;
|
||||
outline: 0;
|
||||
}
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="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" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Inicio:
|
||||
</div>
|
||||
<div class="col-md-1" style="min-width:115px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Fin:
|
||||
</div>
|
||||
<div class="col-md-1" style="min-width:115px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<asp:Label runat="server" ID="LblSubProyecto" CssClass="col-md-1">SubProyecto:</asp:Label>
|
||||
<div class="col-md-2">
|
||||
<%-- <asp:DropDownList ID="DdlSubProyecto" CssClass="select2me" AppendDataBoundItems="true" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="100%">
|
||||
<asp:ListItem Selected="true" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>--%>
|
||||
<asp:ListBox ID="DdlSubProyecto" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="select2me" Style="width: 100%;" runat="server"></asp:ListBox>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" data-sort="true" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip=""
|
||||
DataKeyNames="Tipo,Seccion,TipoCategoria,Ordernador2"
|
||||
>
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="60">
|
||||
<HeaderTemplate>
|
||||
Concepto
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTipo" runat="server" Text='<%# Eval("Tipo") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Acumulado
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCantidadAcumulado" runat="server" Text='<%# Eval("CantidadAcumulado") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="20" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Importe Acumulado
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlImporteAcumulado" runat="server" Text='<%# Eval("ImporteAcumulado", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="80" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Venta Diaria
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCantidadAlDia" runat="server" Text='<%# Eval("CantidadAldia") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="80" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Importe Al Día
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlImporteAldia" runat="server" Text='<%# Eval("ImporteAlDia", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="60" ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Cantidad Total
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCantidadTotal" runat="server" Text='<%# Eval("CantidadTotal")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="80" ItemStyle-HorizontalAlign="Right" >
|
||||
<HeaderTemplate>
|
||||
Total
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlTotal" style="margin-right:10px" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
|
||||
|
||||
</Columns>
|
||||
</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">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID="Label1" 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" />
|
||||
<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">×</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" OnSelectedIndexChanged="DdlGrafica_SelectedIndexChanged" 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"> Ver:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlVer" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlVer_SelectedIndexChanged" 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="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
|
||||
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<script>
|
||||
|
||||
function CargaGraficaBarras(data) {
|
||||
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"dataProvider": data,
|
||||
"startDuration": 2,
|
||||
"valueAxes": [{
|
||||
"position": "left",
|
||||
"title": "Ventas"
|
||||
}],
|
||||
"graphs": [{
|
||||
"balloonText": "[[category]]: <b>[[value]]</b> [[Moneda]]",
|
||||
"colorField": "Color",
|
||||
"fillAlphas": 1,
|
||||
"lineAlpha": 0.1,
|
||||
"type": "column",
|
||||
"valueField": "Valor"
|
||||
}],
|
||||
"depth3D": 20,
|
||||
"angle": 30,
|
||||
"chartCursor": {
|
||||
"categoryBalloonEnabled": false,
|
||||
"cursorAlpha": 0,
|
||||
"zoomable": false
|
||||
},
|
||||
"categoryField": "Texto",
|
||||
"categoryAxis": {
|
||||
"gridPosition": "start",
|
||||
"labelRotation": 90
|
||||
},
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function CargaGraficaPastel(data) {
|
||||
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "pie",
|
||||
"theme": "light",
|
||||
"dataProvider":
|
||||
data,
|
||||
"valueField": "Valor",
|
||||
"titleField": "Texto",
|
||||
"outlineAlpha": 0.4,
|
||||
"depth3D": 0,
|
||||
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]% [[Moneda]])</span>",
|
||||
"angle": 0,
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
366
Acumuladores/RepIndicadorDiario.aspx.vb
Normal file
366
Acumuladores/RepIndicadorDiario.aspx.vb
Normal file
@@ -0,0 +1,366 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Data
|
||||
|
||||
Partial Class ACumuladores_RepIndicadorDiario
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region " PROPIEDADES "
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property NumeroRemesa As String
|
||||
Get
|
||||
NumeroRemesa = ViewState("NumeroRemesa").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("NumeroRemesa") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property TCEspecifico As Double
|
||||
Get
|
||||
If ViewState("TCEspecifico") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return DirectCast(ViewState("TCEspecifico"), Double)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Double)
|
||||
ViewState("TCEspecifico") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtColor As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtColor"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtColor") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property Agrupador As String
|
||||
Get
|
||||
Return ViewState("Agrupador").ToString
|
||||
End Get
|
||||
|
||||
Set(value As String)
|
||||
ViewState("Agrupador") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveMoneda As Integer
|
||||
Get
|
||||
CveMoneda = ViewState("CveMoneda").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveMoneda") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
txtFechaI.Text = Now.FirstDayOfMonth().ToString("dd/MM/yyyy")
|
||||
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
||||
|
||||
CargaCombos()
|
||||
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "CARGAS"
|
||||
|
||||
Private Sub CargaCombos()
|
||||
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSubProyecto.SelectedValuesIfExist("-1")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub CargaDatos()
|
||||
|
||||
Dim ObjAcum As New ClsAcumuladores()
|
||||
|
||||
Dim FechaI, FechaF As Date
|
||||
FechaI = txtFechaI.Text.ToDate
|
||||
FechaF = txtFechaF.Text.ToDate
|
||||
|
||||
If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then
|
||||
TCEspecifico = TxtEspecifico.Text.ToDouble
|
||||
Else
|
||||
TCEspecifico = -1
|
||||
End If
|
||||
|
||||
If ObjAcum.GetRepIndicadorDiario(FechaI, FechaF, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjAcum.DtResultados
|
||||
DtDatos = ObjAcum.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjAcum.Dispose()
|
||||
GvDatos.DataBind()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "SELECTED INDEX CHANGE"
|
||||
|
||||
|
||||
|
||||
Private Sub RblTipoCambio_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipoCambio.SelectedIndexChanged
|
||||
If RblTipoCambio.SelectedValue.ToEntero = 3 Then
|
||||
Dim TipoCambio As Double
|
||||
LiEspecifico.Visible = True
|
||||
TipoCambio = GlobalTipoCambio(Now)
|
||||
TxtEspecifico.Text = TipoCambio.ToString
|
||||
Else
|
||||
LiEspecifico.Visible = False
|
||||
End If
|
||||
UpBodyTipoCambio.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "CONSULTAR"
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "GRIDVIEW"
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DataKey("Ordernador2").ToEntero = 100 Or e.Row.DataKey("Seccion").ToEntero = 3 And (e.Row.DataKey("TipoCategoria").ToEntero = 6 Or e.Row.DataKey("TipoCategoria").ToEntero = 7) Then
|
||||
e.Row.Font.Bold = True
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " IMPRIMIR "
|
||||
|
||||
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
'GvDatos.ExportToExcel("ReporteComprasClasificacion" & Now.ToShortDateString)
|
||||
GenerarPDF("EXCEL")
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkPdf_Click(sender As Object, e As EventArgs)
|
||||
GenerarPDF("PDF")
|
||||
End Sub
|
||||
Private Sub GenerarPDF(Opcion As String)
|
||||
Dim FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text)
|
||||
Dim FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text)
|
||||
|
||||
|
||||
|
||||
Dim FechaIn As String = $" <b>Fecha Inicio:</b> {txtFechaI.Text}"
|
||||
Dim FechaFn As String = $" <b>Fecha Fin:</b> {txtFechaF.Text}"
|
||||
If txtFechaI.Text = "" Then FechaIn = ""
|
||||
If txtFechaF.Text = "" Then FechaFn = ""
|
||||
|
||||
|
||||
Dim SubProyecto = If(DdlSubProyecto.GetSelectedText = "", "", $" <b>SubProyecto:</b> {DdlSubProyecto.GetSelectedText}")
|
||||
|
||||
|
||||
Dim FechaIF, FechaFF As String
|
||||
FechaIF = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
||||
FechaFF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
||||
|
||||
|
||||
|
||||
If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then
|
||||
|
||||
|
||||
|
||||
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 params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("FechaInicio", FechaI))
|
||||
params.Add(New ReportParameter("FechaFin", FechaF))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToString))
|
||||
params.Add(New ReportParameter("AgrupadoPor", $"<b>Filtros Por:</b> {FechaIn} {FechaFn} {SubProyecto} "))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepIndicadorDiario.rdlc", DtDatos, params, $"RepIndicadorDiario_{Now.ToString("yyyyMMddhhmmss")}", Opcion)
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "GRAFICA"
|
||||
|
||||
Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs)
|
||||
If Not DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then
|
||||
Alert("No hay datos disponibles", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
LblTituloGrafica.Text = $"Agrupado por: {Agrupador}"
|
||||
RegistraScript("$('#DivModalGrafica').modal('show')")
|
||||
CambioGrafica()
|
||||
End Sub
|
||||
Private Sub CreaDataTableColor()
|
||||
DtColor = New DataTable
|
||||
DtColor.Columns.Add("Color")
|
||||
Dim RowColor As DataRow = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#FF0F00"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#FF6600"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#FF9E01"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#FCD202"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#F8FF01"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#B0DE09"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#04D215"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#0D8ECF"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#0D52D1"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#2A0CD0"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#8A0CCF"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#CD0D74"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#754DEB"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#DDDDDD"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#999999"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#333333"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
RowColor = Nothing
|
||||
RowColor = DtColor.NewRow()
|
||||
RowColor("Color") = "#000000"
|
||||
DtColor.Rows.Add(RowColor)
|
||||
End Sub
|
||||
|
||||
Private Sub CambioGrafica()
|
||||
Dim Dt As New DataTable()
|
||||
Dt.Columns.Add("Texto")
|
||||
Dt.Columns.Add("Valor")
|
||||
Dt.Columns.Add("Color")
|
||||
Dt.Columns.Add("Moneda")
|
||||
Dim RowColorIndex As Integer = 0
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
If Not Dr("CveCompra").ToString.ToEntero > 0 Then
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = Dt.NewRow()
|
||||
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {CveMoneda}").Rows(0)("Abreviatura").ToString}"
|
||||
Select Case DdlVer.SelectedValue.ToEntero
|
||||
Case 1
|
||||
Row("Valor") = Dr("Total").ToString.FormatoNumero
|
||||
Case 2
|
||||
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
|
||||
Case 3
|
||||
Row("Valor") = Dr("IVA").ToString.FormatoNumero
|
||||
End Select
|
||||
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
||||
Row("Moneda") = GlobalDTMonedas().FiltraParametros($"CveMoneda = {CveMoneda}").Rows(0)("Moneda").ToString
|
||||
Dt.Rows.Add(Row)
|
||||
RowColorIndex += 1
|
||||
If RowColorIndex = 17 Then
|
||||
RowColorIndex = 0
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim query = From s In Dt.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
||||
Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(query)
|
||||
Select Case DdlGrafica.SelectedValue.ToEntero
|
||||
Case 1
|
||||
RegistraScript($"CargaGraficaBarras({json})", "22")
|
||||
Case 2
|
||||
RegistraScript($"CargaGraficaPastel({json})", "22")
|
||||
End Select
|
||||
UPModalProd.Update()
|
||||
End Sub
|
||||
Protected Sub DdlGrafica_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CambioGrafica()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlVer_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CambioGrafica()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -583,12 +583,27 @@ Public Class ClsAcumuladores
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
End Function
|
||||
|
||||
Public Function GetNuevoConsecutivoFolio(CveFolioGarantia As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
SqlDataAdapter(String.Format("SELECT MAX(Consecutivo) + 1 AS NuevoConsecutivo FROM Acum_GarantiasDetalle d WHERE d.CveFolioGarantia = {0}", CveFolioGarantia), CommandType.Text)
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError(String.Format("Ocurrió un error al consultar un nuevo consecutivo para el folio {0}", CveFolioGarantia), ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " GARANTÍAS MESES "
|
||||
|
||||
|
||||
Public Function GarantiasMesesGet(CveGarantiaMes As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional CveTipoUso As Integer = -1, Optional Mes As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
'Data = New DataTable
|
||||
@@ -703,7 +718,7 @@ Public Class ClsAcumuladores
|
||||
Public Function AddGarantiasDetalle(CveVentaDetalle As Integer, CvePS As Integer, CveFolioGarantia As Integer, CveTipoUso As Integer,
|
||||
CodigoEnsamble As String, CodigoLinea As String, CodigoInspeccion As String,
|
||||
CveTipoDefecto As Integer, NumPoliza As String, Importe As Double,
|
||||
Consecutivo As String) As Boolean
|
||||
Consecutivo As String, FechaAjuste As DateTime) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
SqlDataAdapter("PA_Acum_GarantiasDetalleAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -717,7 +732,8 @@ Public Class ClsAcumuladores
|
||||
.Add("@CveTipoDefecto", SqlDbType.Int).Value = CveTipoDefecto
|
||||
.Add("@NumPoliza", SqlDbType.VarChar).Value = NumPoliza
|
||||
.Add("@Importe", SqlDbType.Float).Value = Importe
|
||||
.Add("@Consecutivo", SqlDbType.VarChar).Value = Consecutivo
|
||||
.Add("@Consecutivo", SqlDbType.VarChar).Value = Consecutivo
|
||||
.Add("@FechaAjuste", SqlDbType.DateTime).Value = FechaAjuste
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -894,16 +910,16 @@ Public Class ClsAcumuladores
|
||||
End Function
|
||||
|
||||
|
||||
Public Function GetRepInicadorDiario(FechaInicio As Date, FechaFin As Date, CveSubProeycto As Integer, CveEmpresa As Integer) As Boolean
|
||||
Public Function GetRepIndicadorDiario(FechaInicio As Date, FechaFin As Date, CveSubProeycto As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
SqlDataAdapter("PA_Acum_RepInicadorDiarioGet")
|
||||
SqlDataAdapter("PA_Acum_RepIndicadorDiarioGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
|
||||
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
|
||||
.Add("@CveSubProeycto", SqlDbType.Int).Value = CveSubProeycto
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProeycto
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
|
||||
@@ -4627,7 +4627,8 @@ Public Class ClsContabilidad
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function AddCuenta(CvePadre As Integer, Codigo As String, Nombre As String, Tipo As String, CtaMayor As Integer, CveMoneda As Integer, Optional DigAgrupador As Integer = -1, Optional CveAgrupadorSAT As Integer = -1, Optional NomIdioma As String = "") As Integer
|
||||
Public Function AddCuenta(CvePadre As Integer, Codigo As String, Nombre As String, Tipo As String, CtaMayor As Integer, CveMoneda As Integer, Optional DigAgrupador As Integer = -1,
|
||||
Optional CveAgrupadorSAT As Integer = -1, Optional NomIdioma As String = "", Optional CveEmpresaParam As Integer = -1) As Integer
|
||||
Dim Retorno As Integer = 0
|
||||
DataAdapter("PA_Conta_AddCuentas")
|
||||
|
||||
@@ -4641,6 +4642,7 @@ Public Class ClsContabilidad
|
||||
.Add("@DigAgrupador", SqlDbType.Int).Value = DigAgrupador
|
||||
.Add("@NomIdioma", SqlDbType.VarChar).Value = NomIdioma
|
||||
.Add("@CveAgrupadorSAT", SqlDbType.Int).Value = CveAgrupadorSAT
|
||||
.Add("@CveEmpresaParam", SqlDbType.Int).Value = CveEmpresaParam
|
||||
'.Add("@CveCuenta", SqlDbType.Int).Value = 0
|
||||
'.Add("@Error", SqlDbType.VarChar).Value = ""
|
||||
'.Add("@Error", SqlDbType.VarChar).Direction = ParameterDirection.Output
|
||||
|
||||
@@ -171,6 +171,32 @@ Public Class ClsNominas
|
||||
#End Region
|
||||
|
||||
#Region "ClsNominas_Nominas"
|
||||
Public Function AddComprobantesEmitidos(ByVal cveEmpresa As Integer, ByVal folioFiscal As String, ByVal tipoDocto As String, ByVal importeTotal As Decimal, ByVal estatus As Integer, ByVal fecha As String, ByVal moneda As String, ByVal rFCReceptor As String, ByVal rutaXml As String, ByVal rFCEmisor As String, ByVal serie As String, ByVal folio As String) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_Sat_ComprobantesAdd", CommandType.StoredProcedure)
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@cveEmpresa", SqlDbType.Int).Value = cveEmpresa
|
||||
.Add("@folioFiscal", SqlDbType.VarChar).Value = folioFiscal
|
||||
.Add("@tipoDocto", SqlDbType.VarChar).Value = tipoDocto
|
||||
.Add("@importeTotal", SqlDbType.Decimal).Value = importeTotal
|
||||
.Add("@estatus", SqlDbType.Int).Value = estatus
|
||||
.Add("@fecha", SqlDbType.VarChar).Value = fecha
|
||||
.Add("@moneda", SqlDbType.VarChar).Value = moneda
|
||||
.Add("@rFCReceptor", SqlDbType.VarChar).Value = rFCReceptor
|
||||
.Add("@rFCEmisor", SqlDbType.VarChar).Value = rFCEmisor
|
||||
.Add("@rutaXml", SqlDbType.VarChar).Value = rutaXml
|
||||
.Add("@serie", SqlDbType.VarChar).Value = serie
|
||||
.Add("@folio", SqlDbType.VarChar).Value = folio
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al Realizar el calculo del Aguinaldo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetCalculoAguinaldo(ejercicio As Int32, cveEmpresa As Int32, importe As Double, CveTipoPeriodo As Integer, CvePeriodo As Integer) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
@@ -1835,7 +1861,32 @@ Public Class ClsNominas
|
||||
#End Region
|
||||
|
||||
|
||||
Public Function AddUPNom_NominasDetalles(CveNomina As Integer, CvePeriodo As Integer, CvePersonal As Integer, CveConcepto As Integer, Importe As Decimal, ImporteGravado As Decimal, ImporteExento As Decimal, CveUsuario As Integer) As Boolean
|
||||
Public Function GetInversionNomina(CveEmpresa As Integer, Optional FechaInicio As String = "", Optional FechaFin As String = "",
|
||||
Optional CveProyecto As Integer = -1, Optional CveSubProyecto As Integer = -1,
|
||||
Optional Cve1 As Integer = -1, Optional Cve2 As Integer = -1,
|
||||
Optional CveStr1 As String = "-1", Optional CveStr2 As String = "-1") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Nom_InversionNominaGET")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("FechaInicio", SqlDbType.Int).Value = FechaInicio
|
||||
.Add("FechaFin", SqlDbType.Int).Value = FechaFin
|
||||
.Add("CveProyecto", SqlDbType.Int).Value = CveProyecto
|
||||
.Add("CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("Cve1", SqlDbType.Int).Value = Cve1
|
||||
.Add("Cve2", SqlDbType.Int).Value = Cve2
|
||||
.Add("CveStr1", SqlDbType.Int).Value = CveStr1
|
||||
.Add("CveStr2", SqlDbType.Int).Value = CveStr2
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch Ex1 As SqlException
|
||||
Me.OnError("Ocurrió un error al obtener el reporte de inversión de nomina.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function AddUPNom_NominasDetalles(CveNomina As Integer, CvePeriodo As Integer, CvePersonal As Integer, CveConcepto As Integer, Importe As Decimal, ImporteGravado As Decimal, ImporteExento As Decimal, CveUsuario As Integer, Optional IsEdited As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Nom_NominasDetallesAddUP")
|
||||
@@ -1849,6 +1900,7 @@ Public Class ClsNominas
|
||||
.Add("ImporteGravado", SqlDbType.Float).Value = ImporteGravado
|
||||
.Add("ImporteExento", SqlDbType.Float).Value = ImporteExento
|
||||
.Add("CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("IsEdited", SqlDbType.Bit).Value = IsEdited
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -1902,10 +1954,10 @@ Public Class ClsNominas
|
||||
retorno = True
|
||||
Catch sqEx As SqlException
|
||||
retorno = False
|
||||
OnError("Ocurrió un error al obtener las tablas.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
OnError("Ocurrió un error al obtener las tablas de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Catch ex As Exception
|
||||
retorno = False
|
||||
OnError("Ocurrió un error al obtener las tablas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
OnError("Ocurrió un error al obtener las tablas de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
@@ -4457,6 +4457,8 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/Ventas/RepArqueosDetalle.aspx".ToUpper(), 680)
|
||||
PaginaDict.Add("/Ventas/RepCotizacionesxFacturar.aspx".ToUpper(), 686)
|
||||
PaginaDict.Add("/Ventas/RepRemisionesNC.aspx".ToUpper(), 687)
|
||||
PaginaDict.Add("/Ventas/CatCobranzaEstatus.aspx".ToUpper(), 7003)
|
||||
PaginaDict.Add("/Ventas/CatCobranzaEstatusTurno.aspx".ToUpper(), 7004)
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
@@ -5933,7 +5933,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al Consultar el catalogo de Uniformes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
OnError("Ocurrió un error al agregar permiso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
@@ -3130,6 +3130,149 @@ Public Class ClsVentas
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetCobranzaEstatus(CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_CobranzaEstatusGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As SqlException
|
||||
Me.OnError("Ocurrió un error al intentar obtener los estatus de cobranza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function AddCobranzaEstatus(CobranzaEstatus As String, CveEmpresa As Integer, Estatus As Boolean, CveUsuario As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_CobranzaEstatusAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CobranzaEstatus", SqlDbType.VarChar).Value = CobranzaEstatus
|
||||
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As SqlException
|
||||
Me.OnError("Ocurrió un error al intentar agregar el estatus de cobranza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function RemoveCobranzaEstatus(CveCobranzaEstatus As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_CobranzaEstatusDelete")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCobranzaEstatus", SqlDbType.Int).Value = CveCobranzaEstatus
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As SqlException
|
||||
Me.OnError("Ocurrió un error al intentar agregar el estatus de cobranza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function UpdateCobranzaEstatus(CveCobranzaEstatus As Integer, CobranzaEstatus As String, Estatus As Boolean) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_CobranzaEstatusUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCobranzaEstatus", SqlDbType.Int).Value = CveCobranzaEstatus
|
||||
.Add("@CobranzaEstatus", SqlDbType.VarChar).Value = CobranzaEstatus
|
||||
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As SqlException
|
||||
Me.OnError("Ocurrió un error al intentar agregar el estatus de cobranza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function AddCobranzaEstatusTurno(CobranzaEstatusTurno As String, CveEmpresa As Integer, Estatus As Boolean, CveUsuario As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_CobranzaEstatusTurnoAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CobranzaEstatusTurno", SqlDbType.VarChar).Value = CobranzaEstatusTurno
|
||||
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As SqlException
|
||||
Me.OnError("Ocurrió un error al intentar agregar el estatus turno de cobranza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function RemoveCobranzaEstatusTurno(CveCobranzaEstatus As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_CobranzaEstatusTurnoDelete")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCobranzaEstatusTurno", SqlDbType.Int).Value = CveCobranzaEstatus
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As SqlException
|
||||
Me.OnError("Ocurrió un error al intentar agregar el estatus de cobranza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function UpdateCobranzaEstatusTurno(CveCobranzaEstatus As Integer, CobranzaEstatus As String, Estatus As Boolean) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_CobranzaEstatusTurnoUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCobranzaEstatusTurno", SqlDbType.Int).Value = CveCobranzaEstatus
|
||||
.Add("@CobranzaEstatusTurno", SqlDbType.VarChar).Value = CobranzaEstatus
|
||||
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As SqlException
|
||||
Me.OnError("Ocurrió un error al intentar agregar el estatus de cobranza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "C O M P L E M E N T O S"
|
||||
|
||||
@@ -1349,7 +1349,7 @@ Namespace Modelos
|
||||
For Each Dr As DataRow In DtAjustes.Rows
|
||||
If Not ObjAcum.AddGarantiasDetalle(Dr("CveVentaDetalle").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("CveFolioGarantia").ToString.ToEntero, Dr("CveTipoUso").ToString.ToEntero,
|
||||
Dr("CodigoEnsamble").ToString, Dr("CodigoLinea").ToString, Dr("CodigoInspeccion").ToString, Dr("CveTipoDefecto").ToString.ToEntero,
|
||||
Dr("NumPoliza").ToString, Dr("Importe").ToString.ToDouble, Dr("Consecutivo").ToString) Then
|
||||
Dr("NumPoliza").ToString, Dr("Importe").ToString.ToDouble, Dr("Consecutivo").ToString, Dr("FechaAjuste").ToString.ToDateTime()) Then
|
||||
ErrorList.Add("Ocurrió un error al agregar la garantia detalle.")
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -93,7 +93,7 @@ Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState
|
||||
obj.sale_type = "01" 'PISO
|
||||
obj.sale_type_service = "01" 'PARTICULAR
|
||||
obj.sale_total = ObjFactura.Total
|
||||
obj.sale_discount = ObjFactura.SubTotal
|
||||
obj.sale_discount = 0 'ObjFactura.SubTotal
|
||||
obj.sale_id = GuidGenerator.GenerateTimeBasedGuid().ToString()
|
||||
|
||||
'Dim PS = ObjFactura.DtDetalle.Rows(0)
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<%@ WebHandler Language="VB" Class="TareasProgramadas" %>
|
||||
|
||||
<%@ WebHandler Language="VB" Class="TareasProgramadas" %>
|
||||
|
||||
Imports System
|
||||
Imports System.Web
|
||||
Imports System.Data
|
||||
Imports Newtonsoft.Json
|
||||
Imports Newtonsoft.Json
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Imports Extensiones
|
||||
Imports System.IO
|
||||
Imports System.IO
|
||||
Imports CrystalDecisions.CrystalReports.Engine
|
||||
Imports CrystalDecisions.Shared
|
||||
|
||||
Public Class TareasProgramadas : Implements IHttpHandler
|
||||
|
||||
@@ -14,21 +17,38 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||
context.Response.ContentType = "text/plain"
|
||||
currentcontext = context
|
||||
'timbrarNominab()
|
||||
Dim retorno As String = "no se encontro la variable"
|
||||
Try
|
||||
URLParametros = Parametros(context.Request("var"))
|
||||
Dim metodo As String = URLParametros("metodo")
|
||||
Try
|
||||
Dim metodo As String = ""
|
||||
If context.Request("var") IsNot Nothing Then
|
||||
URLParametros = Parametros(context.Request("var"))
|
||||
metodo = URLParametros("metodo")
|
||||
ElseIf context.Request.Headers("Content-Type") IsNot Nothing AndAlso context.Request.Headers("Content-Type").Contains("json") AndAlso context.Request.InputStream IsNot Nothing Then
|
||||
context.Response.ContentType = "application/json"
|
||||
Using reader As New StreamReader(context.Request.InputStream)
|
||||
Dim json = reader.ReadToEnd()
|
||||
Dim JsonRequest As JObject = JObject.Parse(json)
|
||||
If JsonRequest IsNot Nothing Then
|
||||
metodo = JsonRequest("Metodo").ToString
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
Select Case metodo
|
||||
Case "TimbrarNomina"
|
||||
retorno = "Error Timbrado Nomina"
|
||||
retorno = timbrarNomina()
|
||||
retorno = ""
|
||||
retorno = ""
|
||||
context.Response.Write(retorno)
|
||||
Case "EstadosCuenta"
|
||||
'CargaEstadosCuenta(context, 119, 227774)
|
||||
CargaEstadosCuenta(context, 119, -1)
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
ex.GuardaLog(ex.ToString())
|
||||
ex.GuardaLog(ex.ToString())
|
||||
context.Response.Write(retorno)
|
||||
End Try
|
||||
context.Response.Write(retorno)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -127,18 +147,18 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
|
||||
|
||||
Private Function GetUsuario(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional username As String = "", Optional pass As String = "") As Usuario
|
||||
Dim usuario As Usuario = Nothing
|
||||
Dim usuario As Usuario = Nothing
|
||||
#Region "Valido que los campos usuario contraseña no sean nulos"
|
||||
|
||||
|
||||
If IsNothing(username) Then
|
||||
username = ""
|
||||
End If
|
||||
If IsNothing(pass) Then
|
||||
pass = ""
|
||||
End If
|
||||
End If
|
||||
#End Region
|
||||
#Region "Si el CveUsuario es mayor que cero asigno el username y pass la de la CveUsuario"
|
||||
|
||||
|
||||
If CveUsuario > 0 Then
|
||||
Using Dv As New DataView(DirectCast(currentcontext.Application("GlobalDTUsuarios"), DataTable), $"CveUsuario = 100 AND CveEmpresa ={CveEmpresa}", "", DataViewRowState.CurrentRows)
|
||||
Using GlobalDTUsuarios As DataTable = Dv.ToTable()
|
||||
@@ -149,13 +169,13 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
End If
|
||||
End Using
|
||||
End Using
|
||||
End If
|
||||
End If
|
||||
#End Region
|
||||
#Region "obtengo el usuario con el username y la pass"
|
||||
|
||||
|
||||
Using ObjUsuario As New ClsSisUsuarios()
|
||||
usuario = ObjUsuario.ValidaUsuario(username, pass, IMEI, CveEmpresa)
|
||||
End Using
|
||||
End Using
|
||||
#End Region
|
||||
#Region "Asigno la empresa al usuario"
|
||||
If Not IsNothing(usuario) Then
|
||||
@@ -179,7 +199,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
End If
|
||||
End Using
|
||||
|
||||
End If
|
||||
End If
|
||||
#End Region
|
||||
Return usuario
|
||||
End Function
|
||||
@@ -224,8 +244,6 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Private Function Parametros(Cadena As String) As Hashtable
|
||||
Cadena = Decripta(Cadena)
|
||||
Dim P1() As String = Cadena.Split("&"c)
|
||||
@@ -244,6 +262,438 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
||||
Get
|
||||
Return False
|
||||
End Get
|
||||
End Property
|
||||
End Property
|
||||
|
||||
|
||||
#Region "E S T A D O S D E C U E N T A"
|
||||
Private Sub CargaEstadosCuenta(ByVal context As HttpContext, pCveEmpresa As Integer, pCveCliente As Integer)
|
||||
Dim Retorno As New JArray()
|
||||
Dim DtEmpresas As DataTable = Nothing
|
||||
Using ObjEmpresas As New ClsSisEmpresas()
|
||||
If ObjEmpresas.GetEmpresas(pCveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
DtEmpresas = ObjEmpresas.DtResultados.FiltraParametros("", "", {"CveEmpresa"})
|
||||
End If
|
||||
End Using
|
||||
|
||||
If DtEmpresas IsNot Nothing Then
|
||||
For Each Row As DataRow In DtEmpresas.Rows
|
||||
Dim Usuario = ValidaUsuarioSistema(Row("CveEmpresa").ToString().ToEntero())
|
||||
Dim obj = EjecutarEnvioEstadoCuenta(Usuario, pCveCliente:=pCveCliente)
|
||||
|
||||
Retorno.Add(obj)
|
||||
Next
|
||||
End If
|
||||
|
||||
context.Response.Write(Retorno.ToString())
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
|
||||
Dim UsuarioActual As Usuario = Nothing
|
||||
Dim ObjUsuarios As New ClsSisUsuarios
|
||||
If ObjUsuarios.GetUsuarios(100) Then
|
||||
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
||||
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
||||
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, IMEI, CveEmpresa)
|
||||
UsuarioActual.CveEmpresa = CveEmpresa
|
||||
CreaObjetoEmpresa(UsuarioActual)
|
||||
End If
|
||||
End If
|
||||
ObjUsuarios.Dispose()
|
||||
Return UsuarioActual
|
||||
End Function
|
||||
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
||||
|
||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
|
||||
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
|
||||
|
||||
Dim EmpresasFuncionalidades As New HybridDictionary
|
||||
For Each Row As Data.DataRow In dttmp.Rows
|
||||
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||
Next
|
||||
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||
End If
|
||||
|
||||
UsuarioActual.Empresa = ObjEmpresa.Empresa
|
||||
End If
|
||||
ObjEmpresa.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function EjecutarEnvioEstadoCuenta(UsuarioActual As Usuario, Optional pCveCliente As Integer = -1) As JObject
|
||||
Dim ClientesSinEnviar As New JArray()
|
||||
|
||||
Dim Json As New JObject(
|
||||
New JProperty("Empresa", UsuarioActual.Empresa.Empresa),
|
||||
New JProperty("Usuario", UsuarioActual.Usuario),
|
||||
New JProperty("Fecha", DateTime.Now.ToString("dd/MM/yyy HH:mm:ss"))
|
||||
)
|
||||
Dim DTClientes As DataTable = Nothing
|
||||
|
||||
Using ObjCliente As New ClsClientes
|
||||
If ObjCliente.GetClientes(pCveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, TipoCliente:=-1, Estatus:=1) Then
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
DTClientes = ObjCliente.DtResultados.Copy()
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
|
||||
If DTClientes IsNot Nothing Then
|
||||
For Each RowCliente As DataRow In DTClientes.Rows
|
||||
Dim CveCliente As Integer = RowCliente("CveCliente").ToString().ToEntero()
|
||||
Dim Correo As String = RowCliente("CobranzaCorreo").ToString()
|
||||
|
||||
Dim Cliente As New Modelos.ClienteModel(CveCliente, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim Envio = EnviarEstadoCuenta(UsuarioActual, Correo, Cliente)
|
||||
|
||||
If Envio Then
|
||||
Using ObjBitacora As New ClsOIEventos
|
||||
ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=Cliente.CveCliente)
|
||||
End Using
|
||||
Else
|
||||
ClientesSinEnviar.Add(New JObject(
|
||||
New JProperty("CveCliente", Cliente.CveCliente),
|
||||
New JProperty("Cliente", Cliente.Nombre)
|
||||
))
|
||||
End If
|
||||
Next
|
||||
DTClientes.Dispose()
|
||||
End If
|
||||
Json.Add(New JProperty("ClientesSinEnviar", ClientesSinEnviar))
|
||||
|
||||
Return Json
|
||||
End Function
|
||||
|
||||
Private Function EnviarEstadoCuenta(UsuarioActual As Usuario, Correo As String, Cliente As Modelos.ClienteModel) As Boolean
|
||||
Dim Retorno As Boolean = True
|
||||
|
||||
Dim ArchivoPDF As Byte() = Nothing
|
||||
|
||||
Dim Formato As String = "PDF"
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepClientesCxC.rpt", UsuarioActual.Empresa.Ruta))
|
||||
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", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
'OBTENEMOS LOS DATOS
|
||||
Dim DtCxCFact As DataTable = Nothing
|
||||
|
||||
Dim SaldoIngDolares As Double = 0
|
||||
Dim SaldoIngPesos As Double = 0
|
||||
Dim SaldoIngDolaresPesos As Double = 0
|
||||
Dim TotalIng As Double = 0
|
||||
Dim SaldoAntDolares As Double = 0
|
||||
Dim SaldoAntPesos As Double = 0
|
||||
Dim SaldoAntDolaresPesos As Double = 0
|
||||
Dim TotalAnt As Double = 0
|
||||
Dim ContaIng As Integer = 0
|
||||
Dim ContaAnt As Integer = 0
|
||||
Dim FechaCorte As Date = ("9999/01/01").ToDate
|
||||
|
||||
Dim TipoDocto2 As String = "'Ing','NC','Dev'"
|
||||
Dim FechaVencimientoI As String = "-1"
|
||||
Dim FechaVencimientoF As String = "-1"
|
||||
Dim FI As String = "-1"
|
||||
Dim FF As String = "-1"
|
||||
Dim dtt As DataTable = Nothing
|
||||
|
||||
Try
|
||||
Using ObjMovtos As New ClsMovimientos()
|
||||
If ObjMovtos.GetCxCClienteDetalle(Cliente.CveCliente, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, CveClienteSucursal:=-1) Then
|
||||
DtCxCFact = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "TipoDocto")
|
||||
'cargo los anticipos NC
|
||||
DtCxCFact.Columns.Add("SaldoAnticipo", GetType(Decimal))
|
||||
If ObjMovtos.GetAnticiposNCIxCCliente(Cliente.CveCliente, -1, -1) Then
|
||||
dtt = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 AND SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) )")
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
Retorno = False
|
||||
dtt = Nothing
|
||||
OnError("Ocurrió un erro al obtener el CxC", ex)
|
||||
End Try
|
||||
|
||||
If Not Retorno Then
|
||||
Return Retorno
|
||||
End If
|
||||
|
||||
Try
|
||||
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
|
||||
For Each drt As DataRow In dtt.Rows
|
||||
Dim drr As DataRow = DtCxCFact.NewRow
|
||||
drr("TipoDocto") = drt("Tipo")
|
||||
drr("SerieFolio") = drt("Folio")
|
||||
drr("Original") = drt("Original")
|
||||
drr("TipoCambio") = drt("TipoCambio")
|
||||
drr("Saldo") = 0
|
||||
drr("SaldoAnticipo") = drt("Saldo")
|
||||
drr("Fecha") = drt("Fecha")
|
||||
drr("Moneda") = drt("Moneda")
|
||||
drr("CveMoneda") = drt("CveMoneda")
|
||||
DtCxCFact.Rows.Add(drr)
|
||||
Next
|
||||
End If
|
||||
|
||||
If DtCxCFact IsNot Nothing Then
|
||||
For Each Row As DataRow In DtCxCFact.FiltraParametros($"TipoDocto IN ({TipoDocto2})").Rows
|
||||
If Row("TipoDocto").ToString = "Ing" Or Row("TipoDocto").ToString = "Rem" Or (Row("TipoDocto").ToString = "Ant" And Row("Saldo").ToString.ToDouble > 0) Then 'Ingresos
|
||||
ContaIng = ContaIng + 1
|
||||
If Row("CveMoneda").ToString.ToEntero = 1 Then
|
||||
SaldoIngPesos = SaldoIngPesos + Row("Saldo").ToString.ToDouble
|
||||
ElseIf Row("CveMoneda").ToString.ToEntero = 2 Then
|
||||
SaldoIngDolares = SaldoIngDolares + Row("Saldo").ToString.ToDouble
|
||||
SaldoIngDolaresPesos = SaldoIngDolaresPesos + (Row("Saldo").ToString.ToDouble * Row("TipoCambio").ToString.ToDouble)
|
||||
End If
|
||||
|
||||
ElseIf (Row("TipoDocto").ToString = "Ant" And Row("Saldo").ToString.ToDouble = 0) Or Row("TipoDocto").ToString = "IxC" Or Row("TipoDocto").ToString = "NC" Or Row("TipoDocto").ToString = "Dev" Then 'Anticipos, NC, IxC
|
||||
ContaAnt = ContaAnt + 1
|
||||
If Row("CveMoneda").ToString.ToEntero = 1 Then
|
||||
If Row("TipoDocto").ToString = "Dev" Then
|
||||
SaldoAntPesos = SaldoAntPesos + Row("Saldo").ToString.ToDouble
|
||||
Else
|
||||
SaldoAntPesos = SaldoAntPesos + Row("SaldoAnticipo").ToString.ToDouble
|
||||
End If
|
||||
ElseIf Row("CveMoneda").ToString.ToEntero = 2 Then
|
||||
SaldoAntDolares = SaldoAntDolares + Row("Saldo").ToString.ToDouble
|
||||
SaldoAntDolaresPesos = SaldoAntDolaresPesos + (Row("SaldoAnticipo").ToString.ToDouble * Row("TipoCambio").ToString.ToDouble)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
TotalIng = SaldoIngPesos + SaldoIngDolaresPesos
|
||||
TotalAnt = SaldoAntPesos + SaldoAntDolaresPesos
|
||||
|
||||
If TotalIng.RoundSQL(2) = 0 AndAlso TotalAnt.RoundSQL(2) = 0 Then
|
||||
Retorno = False
|
||||
Return Retorno
|
||||
End If
|
||||
|
||||
Dim DtCxCFact2 As DataTable = DtCxCFact.FiltraParametros($"TipoDocto IN ({TipoDocto2})")
|
||||
|
||||
'INGRESOS
|
||||
If SaldoIngPesos > 0 Then
|
||||
Dim drr As DataRow = DtCxCFact2.NewRow
|
||||
drr("SerieFolio") = "Total Ing Pesos"
|
||||
drr("Original") = DtCxCFact2.FiltraParametros("CveMoneda = 1").SUM("Original", "TipoDocto IN ('Ing','Rem') OR (TipoDocto = 'Ant' AND Saldo > 0)")
|
||||
drr("Abonado") = DtCxCFact2.FiltraParametros("CveMoneda = 1").SUM("Abonado", "TipoDocto IN ('Ing','Rem') OR (TipoDocto = 'Ant' AND Saldo > 0)")
|
||||
drr("Saldo") = SaldoIngPesos
|
||||
drr("CveMoneda") = 1
|
||||
DtCxCFact2.Rows.Add(drr)
|
||||
End If
|
||||
If SaldoIngDolares > 0 Then
|
||||
Dim drr As DataRow = DtCxCFact2.NewRow
|
||||
drr("SerieFolio") = "Total Ing Dólares"
|
||||
drr("Original") = DtCxCFact2.FiltraParametros("CveMoneda = 2").SUM("Original", "TipoDocto IN ('Ing','Rem') OR (TipoDocto = 'Ant' AND Saldo > 0)")
|
||||
drr("Abonado") = DtCxCFact2.FiltraParametros("CveMoneda = 2").SUM("Abonado", "TipoDocto IN ('Ing','Rem') OR (TipoDocto = 'Ant' AND Saldo > 0)")
|
||||
drr("Saldo") = SaldoIngDolares
|
||||
drr("CveMoneda") = 2
|
||||
DtCxCFact2.Rows.Add(drr)
|
||||
End If
|
||||
|
||||
'ANTICIPOS
|
||||
If SaldoAntPesos > 0 Then
|
||||
Dim drr As DataRow = DtCxCFact2.NewRow
|
||||
drr("SerieFolio") = "Total Pesos"
|
||||
drr("SaldoAnticipo") = SaldoAntPesos
|
||||
drr("CveMoneda") = 1
|
||||
DtCxCFact2.Rows.Add(drr)
|
||||
End If
|
||||
If SaldoAntDolares > 0 Then
|
||||
Dim drr As DataRow = DtCxCFact2.NewRow
|
||||
drr("SerieFolio") = "Total Dólares"
|
||||
drr("SaldoAnticipo") = SaldoAntDolares
|
||||
drr("CveMoneda") = 2
|
||||
DtCxCFact2.Rows.Add(drr)
|
||||
End If
|
||||
|
||||
If DtCxCFact2 IsNot Nothing AndAlso DtCxCFact2.Rows.Count > 0 Then
|
||||
Dim dr As DataRow = DtCxCFact2.Rows(0)
|
||||
Dim lista = New List(Of CrystalParametro)
|
||||
lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
lista.Add(New CrystalParametro("TipoCuentas", "Con Saldo"))
|
||||
lista.Add(New CrystalParametro("NombreCliente", Cliente.Nombre))
|
||||
lista.Add(New CrystalParametro("FechaInicio", If(FI = "-1", "-", FI)))
|
||||
lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", DateTime.Now.ToShortDateString, FF)))
|
||||
lista.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
lista.Add(New CrystalParametro("DireccionCliente", String.Format("Calle {0} #{1} Colonia {2}", Cliente.Direccion, If(Cliente.NoExt = "", "S/N", Cliente.NoExt), Cliente.Colonia)))
|
||||
lista.Add(New CrystalParametro("ClienteCP", Cliente.CP))
|
||||
lista.Add(New CrystalParametro("ClienteCiudad", Cliente.Ciudad))
|
||||
lista.Add(New CrystalParametro("ClienteRFC", Cliente.RFC))
|
||||
lista.Add(New CrystalParametro("ClienteTelefono", Cliente.Telefono))
|
||||
lista.Add(New CrystalParametro("DiasCredito", Cliente.PlazoCobranza))
|
||||
lista.Add(New CrystalParametro("LimiteCredito", Cliente.LimiteCredito))
|
||||
lista.Add(New CrystalParametro("SaldoDisponible", (Cliente.LimiteCredito - DtCxCFact2(0)("Saldo").ToString.ToDouble).FormatoNumero))
|
||||
lista.Add(New CrystalParametro("SaldoIngDolares", SaldoIngDolares.FormatoNumero))
|
||||
lista.Add(New CrystalParametro("SaldoIngPesos", SaldoIngPesos.FormatoNumero))
|
||||
lista.Add(New CrystalParametro("TotalIng", TotalIng.FormatoNumero))
|
||||
lista.Add(New CrystalParametro("SaldoAntDolares", SaldoAntDolares.FormatoNumero))
|
||||
lista.Add(New CrystalParametro("SaldoAntPesos", SaldoAntPesos.FormatoNumero))
|
||||
lista.Add(New CrystalParametro("TotalAnt", TotalAnt.FormatoNumero))
|
||||
lista.Add(New CrystalParametro("ContaIng", ContaIng))
|
||||
lista.Add(New CrystalParametro("ContaAnt", ContaAnt))
|
||||
|
||||
If Imagen.Exists Then
|
||||
lista.Add(New CrystalParametro("LogoPath", logouri))
|
||||
Else
|
||||
lista.Add(New CrystalParametro("LogoPath", ""))
|
||||
End If
|
||||
|
||||
Try
|
||||
If Archivo.Exists Then
|
||||
ArchivoPDF = ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato)
|
||||
Else
|
||||
ArchivoPDF = ImprimirPDFCrystal(HttpContext.Current.Server.MapPath("~/Empresas/Grales/Formatos/RepClientesCxC.rpt"), DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al mandar MAIL de Orden de Compra", ex)
|
||||
End Try
|
||||
Else
|
||||
Dim lista = New List(Of CrystalParametro)
|
||||
lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
lista.Add(New CrystalParametro("TipoCuentas", "Con Saldo"))
|
||||
lista.Add(New CrystalParametro("NombreCliente", Cliente.Nombre))
|
||||
lista.Add(New CrystalParametro("FechaInicio", If(FI = "-1", "-", FI)))
|
||||
lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", DateTime.Now.ToShortDateString, FF)))
|
||||
lista.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
lista.Add(New CrystalParametro("DireccionCliente", String.Format("Calle {0} #{1} Colonia {2}", Cliente.Direccion, If(Cliente.NoExt = "", "S/N", Cliente.NoExt), Cliente.Colonia)))
|
||||
lista.Add(New CrystalParametro("ClienteCP", Cliente.CP))
|
||||
lista.Add(New CrystalParametro("ClienteCiudad", Cliente.Ciudad))
|
||||
lista.Add(New CrystalParametro("ClienteRFC", Cliente.RFC))
|
||||
lista.Add(New CrystalParametro("ClienteTelefono", Cliente.Telefono))
|
||||
lista.Add(New CrystalParametro("DiasCredito", Cliente.PlazoCobranza))
|
||||
lista.Add(New CrystalParametro("LimiteCredito", Cliente.LimiteCredito))
|
||||
lista.Add(New CrystalParametro("SaldoDisponible", (Cliente.LimiteCredito).FormatoNumero))
|
||||
|
||||
lista.Add(New CrystalParametro("SaldoIngDolares", SaldoIngDolares.FormatoNumero))
|
||||
lista.Add(New CrystalParametro("SaldoIngPesos", SaldoIngPesos.FormatoNumero))
|
||||
lista.Add(New CrystalParametro("TotalIng", TotalIng.FormatoNumero))
|
||||
lista.Add(New CrystalParametro("SaldoAntDolares", SaldoAntDolares.FormatoNumero))
|
||||
lista.Add(New CrystalParametro("SaldoAntPesos", SaldoAntPesos.FormatoNumero))
|
||||
lista.Add(New CrystalParametro("TotalAnt", TotalAnt.FormatoNumero))
|
||||
lista.Add(New CrystalParametro("ContaIng", ContaIng))
|
||||
lista.Add(New CrystalParametro("ContaAnt", ContaAnt))
|
||||
|
||||
If Imagen.Exists Then
|
||||
lista.Add(New CrystalParametro("LogoPath", logouri))
|
||||
Else
|
||||
lista.Add(New CrystalParametro("LogoPath", ""))
|
||||
End If
|
||||
|
||||
Dim drr As DataRow = DtCxCFact2.NewRow
|
||||
drr("SerieFolio") = "Total Ing Pesos"
|
||||
drr("Original") = DtCxCFact2.FiltraParametros("CveMoneda = 1").SUM("Original", "TipoDocto IN ('Ing','Rem') OR (TipoDocto = 'Ant' AND Saldo > 0)")
|
||||
drr("Abonado") = DtCxCFact2.FiltraParametros("CveMoneda = 1").SUM("Abonado", "TipoDocto IN ('Ing','Rem') OR (TipoDocto = 'Ant' AND Saldo > 0)")
|
||||
drr("Saldo") = 0
|
||||
drr("SaldoAnticipo") = 0
|
||||
drr("CveMoneda") = 1
|
||||
DtCxCFact2.Rows.Add(drr)
|
||||
|
||||
If Archivo.Exists Then
|
||||
ArchivoPDF = ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato)
|
||||
Else
|
||||
ArchivoPDF = ImprimirPDFCrystal(HttpContext.Current.Server.MapPath("~/Empresas/Grales/Formatos/RepClientesCxC.rpt"), DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato)
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el pdf", ex)
|
||||
ArchivoPDF = Nothing
|
||||
End Try
|
||||
|
||||
If ArchivoPDF IsNot Nothing Then
|
||||
Try
|
||||
Dim Cuerpo As String = String.Format("Estimado cliente {0}, al presente del correo se anexa su estado actual de cartera en {1}.<br />
|
||||
<br />
|
||||
Quedamos a sus ordenes para cualquier duda o aclaración con su agente de Ventas.<br />
|
||||
<br />
|
||||
<br />
|
||||
Gracias por la atención brindada al presente.<br /> Reciba un cordial saludo.<br />
|
||||
<br />
|
||||
<b>ESTE CORREO SE GENERO EN FORMA AUTOMATICA.</b>", Cliente.NombreComercial, UsuarioActual.Empresa.Empresa)
|
||||
|
||||
Retorno = MandaCorreo(ArchivoPDF, Correo, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo)
|
||||
Catch ex As Exception
|
||||
Retorno = False
|
||||
OnError("Ocurrió un error al enviar el correo", ex)
|
||||
End Try
|
||||
Else
|
||||
Retorno = False
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Function ImprimirPDFCrystal(RutaReporte As String, DataSource As DataTable, Parametros As List(Of CrystalParametro), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportDocument = Nothing) As Byte()
|
||||
'limpio ReportViwer
|
||||
Dim sw As New System.Diagnostics.Stopwatch()
|
||||
sw.Start()
|
||||
If IsNothing(MR) Then MR = New ReportDocument()
|
||||
Dim Bytes As Byte() = Nothing
|
||||
Dim formatType As ExportFormatType = ExportFormatType.NoFormat
|
||||
Try
|
||||
MR.Load(RutaReporte)
|
||||
MR.SetDataSource(DataSource)
|
||||
|
||||
For Each item As CrystalParametro In Parametros
|
||||
MR.SetParameterValue(item.Nombre, item.Valor)
|
||||
Next
|
||||
|
||||
Select Case Formato
|
||||
Case "PDF"
|
||||
formatType = ExportFormatType.PortableDocFormat
|
||||
'Format = "Application/pdf"
|
||||
Case "EXCEL"
|
||||
formatType = ExportFormatType.Excel
|
||||
'Format = "application/ms-excel"
|
||||
End Select
|
||||
Dim Stream As IO.Stream = MR.ExportToStream(formatType)
|
||||
Dim BD As New BinaryReader(MR.ExportToStream(formatType))
|
||||
Bytes = BD.ReadBytes(CInt(MR.ExportToStream(formatType).Length))
|
||||
BD.Dispose()
|
||||
Stream.Dispose()
|
||||
'Dim Buffer(CInt(Stream.Length)) As Byte
|
||||
'Bytes = Buffer
|
||||
'MR.ExportToHttpResponse(formatType, Response, True, NombreArchivo)
|
||||
Catch ex As CrystalReportsException
|
||||
GuardaLog(If(ex.InnerException IsNot Nothing AndAlso ex.Message IsNot Nothing,
|
||||
$"Error: {If(ex.InnerException.Message, ex.Message)} | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing,
|
||||
ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} Ruta {RutaReporte}", $"Sin descripción - Ruta {RutaReporte}"))
|
||||
'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
|
||||
'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
|
||||
Catch ex As Exception
|
||||
GuardaLog(If(ex.InnerException IsNot Nothing AndAlso ex.Message IsNot Nothing,
|
||||
$"Error: {If(ex.InnerException.Message, ex.Message)} | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing,
|
||||
ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} Ruta {RutaReporte}", $"Sin descripción - Ruta {RutaReporte}"))
|
||||
|
||||
'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
|
||||
'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
|
||||
End Try
|
||||
sw.Stop()
|
||||
If sw.Elapsed.TotalSeconds > 10 Then
|
||||
GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ")
|
||||
End If
|
||||
If MR IsNot Nothing Then MR.Dispose()
|
||||
Return Bytes
|
||||
End Function
|
||||
|
||||
Private Function MandaCorreo(File As Byte(), Para As String, Asunto As String, Body As String) As Boolean
|
||||
|
||||
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
|
||||
'a.GuardaLog()
|
||||
Dim Mail As New ClsSisMail()
|
||||
|
||||
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
||||
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"})
|
||||
|
||||
Return Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
@@ -110,14 +110,17 @@
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<div runat="server" id="divLabelTotal" style="width:100%;text-align:right;font-size:1.5em" visible="false">
|
||||
<asp:label runat="server">Importe seleccionado: $</asp:label><asp:label runat="server" ID="lblValorTotal">00.00</asp:label>
|
||||
</div>
|
||||
<br />
|
||||
<asp:GridView ID="GvFacturas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveVenta, CvePrePoliza, CveIE, TipoCambio, CveMoneda, CveCliente, IdCtaContableBancos, IdCtaContClientes, Importe" CssClass="table detallerow table-hover" Style="text-align: center; float: right; width: 100%; font-size: medium;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkFactura" runat="server" Checked="false" Enabled="True" />
|
||||
<asp:CheckBox ID="ChkFactura" OnCheckedChanged="ChkFactura_Click" runat="server" Checked="false" Enabled="True" AutoPostBack="True"/>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Factura">
|
||||
|
||||
@@ -48,6 +48,7 @@ Partial Class Bancos_DepositosCaja
|
||||
|
||||
UpGvFacturas.Update()
|
||||
GvFacturas.DataBind()
|
||||
divLabelTotal.Visible = True
|
||||
End Sub
|
||||
|
||||
Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click
|
||||
@@ -157,4 +158,20 @@ Partial Class Bancos_DepositosCaja
|
||||
ObjContabilidad.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub ObtenerTotalImporta()
|
||||
|
||||
Dim Total As Double = 0
|
||||
For Each Gvr As GridViewRow In GvFacturas.Rows
|
||||
If Gvr.FCCheckBox("ChkFactura").Checked Then
|
||||
Total += Gvr.DataKey("Importe").ToDouble
|
||||
End If
|
||||
Next
|
||||
lblValorTotal.Text = Total.ToString
|
||||
UpGvFacturas.Update()
|
||||
End Sub
|
||||
|
||||
Public Sub ChkFactura_Click(sender As Object, e As EventArgs)
|
||||
ObtenerTotalImporta()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -111,9 +111,16 @@ Partial Class Compras_eFacturas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property Serie() As String
|
||||
Private Property Serie() As String
|
||||
|
||||
Get
|
||||
Return m_Serie
|
||||
If m_Serie Is Nothing Then
|
||||
Return ""
|
||||
Else
|
||||
Return m_Serie
|
||||
End If
|
||||
|
||||
|
||||
End Get
|
||||
Set
|
||||
m_Serie = Value
|
||||
@@ -2535,15 +2542,80 @@ Partial Class Compras_eFacturas
|
||||
BtnOcultar.Visible = False
|
||||
BtnMostrar.Visible = True
|
||||
UpBitacora.Update()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
Property MSGComplemento As String
|
||||
Get
|
||||
If ViewState("MSGComplemento") Is Nothing Then
|
||||
Return ""
|
||||
Else
|
||||
Return ViewState("MSGComplemento").ToString
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("MSGComplemento") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property ViculacionConPUE As Boolean
|
||||
Get
|
||||
If ViewState("ViculacionConPUE") Is Nothing Then
|
||||
Return False
|
||||
Else
|
||||
Return Boolean.Parse(ViewState("ViculacionConPUE").ToString)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("ViculacionConPUE") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property ListaComprasPUE As List(Of Integer)
|
||||
Get
|
||||
If ViewState("ListaComprasPUE") Is Nothing Then
|
||||
Return New List(Of Integer)
|
||||
Else
|
||||
Return DirectCast(ViewState("ListaComprasPUE"), List(Of Integer))
|
||||
End If
|
||||
End Get
|
||||
Set(value As List(Of Integer))
|
||||
ViewState("ListaComprasPUE") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property ComplementoConPUE As String
|
||||
Get
|
||||
If ViewState("ComplementoConPUE") Is Nothing Then
|
||||
Return ""
|
||||
Else
|
||||
Return ViewState("ComplementoConPUE").ToString
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("ComplementoConPUE") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#Region "V I N C U L A R P A G O"
|
||||
|
||||
|
||||
Protected Sub LnkAgregarPago_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
MSGComplemento = ""
|
||||
ViculacionConPUE = False
|
||||
ListaComprasPUE.Clear()
|
||||
ComplementoConPUE = ""
|
||||
|
||||
|
||||
Dim ListaComprasPUEInterna As New List(Of Integer)
|
||||
|
||||
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
Dim CveComplementoPagoCompra As Integer = gvRow.DataKey("CveComplementoPagoCompra").ToString.ToEntero
|
||||
|
||||
@@ -2567,9 +2639,10 @@ Partial Class Compras_eFacturas
|
||||
Dim DiferenciaImportes As Double = 0
|
||||
Dim TextoDiferenciaImporte As String = ""
|
||||
Dim FechaPago As Date
|
||||
Dim PagosCantidad As Integer = 0
|
||||
Dim MSGComplemento As String = ""
|
||||
|
||||
Dim PagosCantidad As Integer = 0
|
||||
|
||||
|
||||
|
||||
Dim XMLDoc As New XmlDocument
|
||||
Dim Archivo As String = String.Format("{0}Empresas\{1}\Compras\{2}\{3}", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML"))
|
||||
If IO.File.Exists(Archivo) Then
|
||||
@@ -2724,9 +2797,12 @@ Partial Class Compras_eFacturas
|
||||
For Each dRow2 As DataRow In DTDocumentosRelacionados.Rows
|
||||
If dRow2("CveMetodoPago").ToString.ToEntero > 0 Then
|
||||
If dRow2("CveMetodoPago").ToString.ToEntero = 1 Then
|
||||
|
||||
MSGComplemento = MSGComplemento & $" Compra {dRow2("SerieFolioCompra").ToString } bloqueado Tipo ""PUE"". "
|
||||
|
||||
ListaComprasPUEInterna.Add(dRow2("CveCompra").ToString.ToEntero)
|
||||
|
||||
ComplementoConPUE = $"{SeriePago}-{FolioPago}"
|
||||
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
@@ -2776,8 +2852,10 @@ Partial Class Compras_eFacturas
|
||||
|
||||
Next
|
||||
|
||||
If MSGComplemento.Trim.Length > 0 Then
|
||||
BtnVincularPago.Visible = False
|
||||
If MSGComplemento.Trim.Length > 0 Then
|
||||
|
||||
' BtnVincularPago.Visible = False
|
||||
ViculacionConPUE = True
|
||||
End If
|
||||
|
||||
|
||||
@@ -2820,8 +2898,11 @@ Partial Class Compras_eFacturas
|
||||
|
||||
|
||||
GvVincularPago.DataBind()
|
||||
UpVincularPago.Update()
|
||||
|
||||
UpVincularPago.Update()
|
||||
|
||||
|
||||
ListaComprasPUE = ListaComprasPUEInterna
|
||||
|
||||
RegistraScript("$('#ModalVincularPago').modal('show')", "VincularPagoModalShow")
|
||||
End Sub
|
||||
|
||||
@@ -2858,14 +2939,30 @@ Partial Class Compras_eFacturas
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
|
||||
Dim objEventos As New ClsOIEventos(ObjCompra.IniciaTransacSQL)
|
||||
|
||||
If ViculacionConPUE Then
|
||||
|
||||
|
||||
|
||||
|
||||
For Each CveCompraVinculada In ListaComprasPUE
|
||||
|
||||
objEventos.AddEventoBitacora($"Complemento { ComplementoConPUE } vinculado manualmente (Compra PUE) ", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompraVinculada)
|
||||
Next
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
ObjCompra.Commit()
|
||||
|
||||
Alert("El pago fue vinculado correctamente", TipoMensaje.MsgInformacion)
|
||||
RegistraScript("$('#ModalVincularPago').modal('hide')", "VincularPagoModalHide")
|
||||
CargaDatos()
|
||||
RegistraScript("$('#ModalVincularPago').modal('hide')", "VincularPagoModalHide")
|
||||
CargaDatos()
|
||||
Else
|
||||
ObjCompra.RollBack()
|
||||
Alert("Ocurrió un error al vincular el pago. Por favor verifique y vuelva a intentar", TipoMensaje.MsgError)
|
||||
|
||||
@@ -15,11 +15,14 @@
|
||||
<Width>1.49458cm</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>7.13431cm</Width>
|
||||
<Width>4.81952cm</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>1.99729cm</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>2.3148cm</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>2.10313cm</Width>
|
||||
</TablixColumn>
|
||||
@@ -149,11 +152,12 @@
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<ColSpan>3</ColSpan>
|
||||
<ColSpan>4</ColSpan>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell />
|
||||
<TablixCell />
|
||||
<TablixCell />
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="Textbox22">
|
||||
@@ -387,6 +391,44 @@
|
||||
</Textbox>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="Textbox2">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Subproyecto</Value>
|
||||
<Style>
|
||||
<FontFamily>Verdana</FontFamily>
|
||||
<FontSize>8pt</FontSize>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox2</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<BottomBorder>
|
||||
<Color>Black</Color>
|
||||
<Style>Solid</Style>
|
||||
<Width>1pt</Width>
|
||||
</BottomBorder>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="Textbox17">
|
||||
@@ -605,10 +647,11 @@
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<ColSpan>2</ColSpan>
|
||||
<ColSpan>3</ColSpan>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell />
|
||||
<TablixCell />
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="Textbox21">
|
||||
@@ -844,6 +887,38 @@
|
||||
</Textbox>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="SubProyecto">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>=Fields!SubProyecto.Value</Value>
|
||||
<Style>
|
||||
<FontFamily>Verdana</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>SubProyecto</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="CargosMovto">
|
||||
@@ -1053,6 +1128,40 @@
|
||||
</TablixCell>
|
||||
<TablixCell />
|
||||
<TablixCell />
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="Textbox12">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value />
|
||||
<Style>
|
||||
<FontFamily>Verdana</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style>
|
||||
<TextAlign>Right</TextAlign>
|
||||
</Style>
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox12</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="Cargos">
|
||||
@@ -1172,6 +1281,7 @@
|
||||
<TablixMember />
|
||||
<TablixMember />
|
||||
<TablixMember />
|
||||
<TablixMember />
|
||||
</TablixMembers>
|
||||
</TablixColumnHierarchy>
|
||||
<TablixRowHierarchy>
|
||||
@@ -1208,9 +1318,9 @@
|
||||
</TablixRowHierarchy>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<DataSetName>DataSet1</DataSetName>
|
||||
<Top>0.06348cm</Top>
|
||||
<Top>0.06346cm</Top>
|
||||
<Height>3cm</Height>
|
||||
<Width>20.37043cm</Width>
|
||||
<Width>20.37044cm</Width>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
@@ -1221,7 +1331,7 @@
|
||||
<Height>1.2061in</Height>
|
||||
<Style />
|
||||
</Body>
|
||||
<Width>8.04763in</Width>
|
||||
<Width>8.01986in</Width>
|
||||
<Page>
|
||||
<PageHeader>
|
||||
<Height>0.81597in</Height>
|
||||
@@ -1360,7 +1470,7 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox3</rd:DefaultName>
|
||||
<Top>0.07025cm</Top>
|
||||
<Top>0.07023cm</Top>
|
||||
<Left>15.87314cm</Left>
|
||||
<Height>0.6cm</Height>
|
||||
<Width>4.4973cm</Width>
|
||||
@@ -1463,6 +1573,10 @@
|
||||
<DataField>Saldo</DataField>
|
||||
<rd:TypeName>System.String</rd:TypeName>
|
||||
</Field>
|
||||
<Field Name="SubProyecto">
|
||||
<DataField>SubProyecto</DataField>
|
||||
<rd:TypeName>System.String</rd:TypeName>
|
||||
</Field>
|
||||
</Fields>
|
||||
<rd:DataSetInfo>
|
||||
<rd:DataSetName>DataSet</rd:DataSetName>
|
||||
|
||||
Binary file not shown.
BIN
Empresas/80/Formatos/RH_FormatoVacaciones.docx
Normal file
BIN
Empresas/80/Formatos/RH_FormatoVacaciones.docx
Normal file
Binary file not shown.
@@ -15,11 +15,14 @@
|
||||
<Width>1.67447cm</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>6.57043cm</Width>
|
||||
<Width>2.82586cm</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>1.94532cm</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>2.89687cm</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>5.49064cm</Width>
|
||||
</TablixColumn>
|
||||
@@ -225,7 +228,7 @@
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="Textbox22">
|
||||
<Textbox Name="Textbox15">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
@@ -244,6 +247,42 @@
|
||||
</Style>
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox15</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
<Color>LightGrey</Color>
|
||||
<Style>Solid</Style>
|
||||
</Border>
|
||||
<BackgroundColor>Silver</BackgroundColor>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="Textbox22">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Código Producto/Servicio</Value>
|
||||
<Style>
|
||||
<FontSize>8pt</FontSize>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style>
|
||||
<TextAlign>Center</TextAlign>
|
||||
</Style>
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox22</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
@@ -578,7 +617,6 @@
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<rd:Selected>true</rd:Selected>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
@@ -616,6 +654,40 @@
|
||||
</Textbox>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="PS">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>=Fields!PS.Value</Value>
|
||||
<Style>
|
||||
<FontSize>8pt</FontSize>
|
||||
<FontWeight>=iif(Fields!CveVenta.Value = "", "Bold", "Normal")</FontWeight>
|
||||
<Color>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","White","#67809F"), "Black")</Color>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>PS</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<BackgroundColor>=iif(Fields!CveVenta.Value = "",IIf(Fields!Gpo.Value = "","#67809F","#cccccc"), "Transparent")</BackgroundColor>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="CodigoPS">
|
||||
@@ -851,6 +923,7 @@
|
||||
<TablixMember />
|
||||
<TablixMember />
|
||||
<TablixMember />
|
||||
<TablixMember />
|
||||
</TablixMembers>
|
||||
</TablixColumnHierarchy>
|
||||
<TablixRowHierarchy>
|
||||
@@ -866,7 +939,7 @@
|
||||
<DataSetName>DataSet1</DataSetName>
|
||||
<Left>0.06614cm</Left>
|
||||
<Height>0.90467cm</Height>
|
||||
<Width>28.36649cm</Width>
|
||||
<Width>27.51879cm</Width>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
@@ -877,7 +950,7 @@
|
||||
<Height>0.59228in</Height>
|
||||
<Style />
|
||||
</Body>
|
||||
<Width>11.21478in</Width>
|
||||
<Width>10.86021in</Width>
|
||||
<Page>
|
||||
<PageHeader>
|
||||
<Height>2.91154cm</Height>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,552 +0,0 @@
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports System.Xml
|
||||
'Imports msExcel = Microsoft.Office.Interop.Excel
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Partial Class General_SaldosIniciales
|
||||
Inherits ClsPaginas
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
|
||||
If TxtExcel.getfiles().Archivos.Count > 0 Then
|
||||
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
|
||||
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
|
||||
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
|
||||
CargarArchivo(Directorio, file.filename, Tipo)
|
||||
Else
|
||||
Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
|
||||
Dim dt As New DataTable
|
||||
Dim Conexion As Odbc.OdbcConnection = Nothing
|
||||
Dim ErrorArchivo = False
|
||||
Dim ErrorExcel = False
|
||||
Dim strConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + Ruta + FileName + ";Extended Properties=Excel 8.0;"
|
||||
Dim objDbFactory As Common.DbProviderFactory = Common.DbProviderFactories.GetFactory("System.Data.OleDb")
|
||||
Dim objDbAdapter As Common.DbDataAdapter = objDbFactory.CreateDataAdapter()
|
||||
Dim objDbConnection As Common.DbConnection = objDbFactory.CreateConnection()
|
||||
objDbConnection.ConnectionString = strConnString
|
||||
objDbConnection.Open()
|
||||
Dim objSheetNames As DataTable = objDbConnection.GetSchema("Tables")
|
||||
Dim HojaExcel As String = objSheetNames.FiltroPrimeroValor("TABLE_NAME")
|
||||
Try
|
||||
Select Case Tipo
|
||||
Case "CSV"
|
||||
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Access Text Driver (*.txt, *.csv)};Dbq=" + Ruta + ";Extensions=asc,csv,tab,txt;")
|
||||
Conexion.Open()
|
||||
Dim cmd = Conexion.CreateCommand()
|
||||
cmd.CommandType = CommandType.Text
|
||||
cmd.CommandText = $"SELECT * FROM [{FileName}]"
|
||||
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
DataAdapter.Fill(dt)
|
||||
Case "EXCEL"
|
||||
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
|
||||
Conexion.Open()
|
||||
Dim cmd = Conexion.CreateCommand()
|
||||
cmd.CommandType = CommandType.Text
|
||||
cmd.CommandText = $"SELECT * FROM [{HojaExcel}]"
|
||||
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
DataAdapter.Fill(dt)
|
||||
Case Else
|
||||
Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
ErrorArchivo = True
|
||||
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
|
||||
End Try
|
||||
Conexion.Close()
|
||||
If Not ErrorArchivo Then
|
||||
If RblFormato.SelectedValue = "1" Or RblFormato.SelectedValue = "2" Then
|
||||
If Not dt.Columns(0).ColumnName = "Codigo" Then
|
||||
Alert("El nombre de la primera columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(1).ColumnName = "RazonSocial" Then
|
||||
Alert("El nombre de la segunda columna debe ser 'Fecha'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(2).ColumnName = "RFC" Then
|
||||
Alert("El nombre de la tercera columna debe ser 'RFC'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(3).ColumnName = "Calle" Then
|
||||
Alert("El nombre de la cuarta columna debe ser 'Calle'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(4).ColumnName = "Número exterior" Then
|
||||
Alert("El nombre de la quinta columna debe ser 'Número exterior' .Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(5).ColumnName = "Colonia" Then
|
||||
Alert("El nombre de la sexta columna debe ser 'Colonia'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(6).ColumnName = "Código postal" Then
|
||||
Alert("El nombre de la séptima columna debe ser 'Código postal'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(7).ColumnName = "Población" Then
|
||||
Alert("El nombre de la octava columna debe ser 'Población'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(8).ColumnName = "Estado" Then
|
||||
Alert("El nombre de la novena columna debe ser 'Estado'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(9).ColumnName = "Teléfono" Then
|
||||
Alert("El nombre de la décima columna debe ser 'Teléfono'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(10).ColumnName = "Contacto" Then
|
||||
Alert("El nombre de la onceava columna debe ser 'Contacto'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(11).ColumnName = "Celular Contacto" Then
|
||||
Alert("El nombre de la doceava columna debe ser 'Celular Contacto'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
ElseIf RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "4" Then
|
||||
If Not dt.Columns(0).ColumnName = "Sucursal" Then
|
||||
Alert("El nombre de la primera columna debe ser 'Sucursal'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not dt.Columns(1).ColumnName = "RFC" Then
|
||||
Alert("El nombre de la segunda columna debe ser 'RFC'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not dt.Columns(2).ColumnName = "Serie" Then
|
||||
Alert("El nombre de la tercera columna debe ser 'Serie'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not dt.Columns(3).ColumnName = "Folio" Then
|
||||
Alert("El nombre de la cuarta columna debe ser 'Folio'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not dt.Columns(4).ColumnName = "Fecha" Then
|
||||
Alert("El nombre de la quinta columna debe ser 'Fecha'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(5).ColumnName = "SubTotal" Then
|
||||
Alert("El nombre de la sexta columna debe ser 'SubTotal'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(6).ColumnName = "IVA" Then
|
||||
Alert("El nombre de la séptima columna debe ser 'IVA'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(7).ColumnName = "Total" Then
|
||||
Alert("El nombre de la octava columna debe ser 'Total'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(8).ColumnName = "Saldo" Then
|
||||
Alert("El nombre de la novena columna debe ser 'Saldo'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(9).ColumnName = "Tipo Documento" Then
|
||||
Alert("El nombre de la décima columna debe ser 'Tipo Documento'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
ElseIf RblFormato.SelectedValue = "5" Then
|
||||
|
||||
If Not dt.Columns(0).ColumnName = "Codigo" Then
|
||||
Alert("El nombre de la primera columna debe ser 'Código'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not dt.Columns(1).ColumnName = "Descripción" Then
|
||||
Alert("El nombre de la segunda columna debe ser 'Descripcion'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not dt.Columns(2).ColumnName = "Marca" Then
|
||||
Alert("El nombre de la tercera columna debe ser 'Serie'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not dt.Columns(3).ColumnName = "Código de Barras" Then
|
||||
Alert("El nombre de la cuarta columna debe ser 'Código de Barras'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not dt.Columns(4).ColumnName = "Unidad de Medida" Then
|
||||
Alert("El nombre de la quinta columna debe ser 'Unidad de Medida'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(5).ColumnName = "Producto/Servicio" Then
|
||||
Alert("El nombre de la sexta columna debe ser 'Producto/Servicio'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(6).ColumnName = "Clasificación" Then
|
||||
Alert("El nombre de la séptima columna debe ser 'Clasificacion'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(7).ColumnName = "Precio" Then
|
||||
Alert("El nombre de la octava columna debe ser 'Precio'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
dt.TableName = "Datos"
|
||||
Dim NumRows As Integer = dt.Rows.Count
|
||||
|
||||
If Not ErrorArchivo Then
|
||||
'P R O V E E D O R E S
|
||||
If RblFormato.SelectedValue = "1" Then
|
||||
Dim ObjProv As New ClsCompProveedores
|
||||
Dim ErrorProv As Boolean = False
|
||||
Dim Contador As Integer = 0
|
||||
Dim ExisteProveedor As Boolean = False
|
||||
|
||||
ObjProv.IniciaTransacSQL()
|
||||
For Each Row As DataRow In dt.Rows
|
||||
Dim Codigo As String = Row("Codigo").ToString
|
||||
Dim RazonSocial As String = Row("RazonSocial").ToString
|
||||
Dim RFC As String = Row("RFC").ToString.Trim
|
||||
Dim Calle As String = Row("Calle").ToString
|
||||
Dim NumExt As Decimal = Row("Número exterior").ToString.ToDecimal
|
||||
Dim Colonia As String = Row("Colonia").ToString
|
||||
Dim CodigoPostal As Decimal = Row("Código Postal").ToString.ToDecimal
|
||||
Dim Poblacion As String = Row("Población").ToString
|
||||
Dim Estado As String = Row("Estado").ToString
|
||||
Dim Telefono As String = Row("Teléfono").ToString
|
||||
Dim Contacto As String = Row("Contacto").ToString
|
||||
Dim CelularContacto As String = Row("Celular Contacto").ToString
|
||||
Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString.ToEntero
|
||||
|
||||
If CveProveedor > 0 Then
|
||||
ExisteProveedor = True
|
||||
Contador = Contador + 1
|
||||
Else
|
||||
If Not ObjProv.AddProveedor(Codigo, RazonSocial, RazonSocial, RazonSocial, RFC, Calle, Telefono,
|
||||
Contacto, "", Telefono, -1, -1, "", 0, 0, 0, -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "",
|
||||
-1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", 1, -1, "", "", False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
ErrorProv = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not ErrorProv Then
|
||||
ObjProv.Commit()
|
||||
If ObjProv.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", 1, -1) Then Application("GlobalDTCompProveedores") = ObjProv.DtResultados
|
||||
If Contador > 0 Then
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Proveedores correctamente. <br>Se Omitieron: <b>{1}</b> Clientes ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Proveedores correctamente.", NumRows), TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
TxtExcel.Text = ""
|
||||
UpDatos.Update()
|
||||
Else
|
||||
ObjProv.RollBack()
|
||||
End If
|
||||
ObjProv.Dispose()
|
||||
|
||||
' C L I E N T E S
|
||||
ElseIf RblFormato.SelectedValue = "2" Then
|
||||
Dim ObjClientes As New ClsClientes
|
||||
Dim ErrorClientes As Boolean = False
|
||||
Dim ExisteCliente As Boolean = False
|
||||
Dim Contador As Integer = 0
|
||||
ObjClientes.IniciaTransacSQL()
|
||||
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
|
||||
Dim Codigo As String = Row("Codigo").ToString
|
||||
Dim RazonSocial As String = Row("RazonSocial").ToString
|
||||
Dim RFC As String = Row("RFC").ToString.Trim
|
||||
Dim Calle As String = Row("Calle").ToString
|
||||
Dim NumExt As Decimal = Row("Número exterior").ToString.ToDecimal
|
||||
Dim Colonia As String = Row("Colonia").ToString
|
||||
Dim CodigoPostal As Decimal = Row("Código Postal").ToString.ToDecimal
|
||||
Dim Poblacion As String = Row("Población").ToString
|
||||
Dim Estado As String = Row("Estado").ToString
|
||||
Dim Telefono As String = Row("Teléfono").ToString
|
||||
Dim Contacto As String = Row("Contacto").ToString
|
||||
Dim CelularContacto As String = Row("Celular Contacto").ToString
|
||||
Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
|
||||
|
||||
If CveCliente > 0 Then
|
||||
ExisteCliente = True
|
||||
Contador = Contador + 1
|
||||
Else
|
||||
If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 1, -1, -1, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, -1,
|
||||
"-1", "-1", "", 0, "", 0, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", "", 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False) Then
|
||||
ErrorClientes = True
|
||||
RFC.GuardaLog
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not ErrorClientes Then
|
||||
ObjClientes.Commit()
|
||||
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados
|
||||
If Contador > 0 Then
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Clientes correctamente. <br>Se Omitieron: <b>{1}</b> Clientes ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Clientes correctamente.", NumRows), TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
TxtExcel.Text = ""
|
||||
UpDatos.Update()
|
||||
Else
|
||||
ObjClientes.RollBack()
|
||||
End If
|
||||
ObjClientes.Dispose()
|
||||
|
||||
'P R O V E E D O R E S - F A C T U R A S
|
||||
ElseIf RblFormato.SelectedValue = "3" Then
|
||||
Dim ObjCompras As New ClsCompras
|
||||
Dim ErrorCompras As Boolean = False
|
||||
Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL())
|
||||
Dim CveCompra As Integer
|
||||
Dim Contador As Integer = 0
|
||||
Dim ExisteCompra As Boolean = False
|
||||
Dim DtProveedores = New DataTable
|
||||
DtProveedores = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
|
||||
For Each Row As DataRow In dt.Rows
|
||||
Dim Sucursal As String = Row("Sucursal").ToString
|
||||
Dim RFC As String = Row("RFC").ToString.Trim
|
||||
Dim Serie As String = Row("Serie").ToString
|
||||
Dim Folio As Integer = Row("Folio").ToString.ToEntero
|
||||
Dim Fecha As Date = Row("Fecha").ToString.ToDate
|
||||
Dim SubTotal As Double = Row("SubTotal").ToString.ToDouble
|
||||
Dim IVA As Double = Row("IVA").ToString.ToDouble
|
||||
Dim Total As Double = Row("Total").ToString.ToDouble
|
||||
Dim Saldo As Double = Row("Saldo").ToString.ToDouble
|
||||
Dim TipoDocto As String = Row("Tipo Documento").ToString
|
||||
Dim CveProveedor As Integer = DtProveedores.FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString.ToEntero
|
||||
Dim CvePS As Integer = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS").ToString.ToEntero
|
||||
Dim CveUnidadMedida As Integer = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida").ToString.ToEntero
|
||||
|
||||
If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorCompras = True
|
||||
If Not CveUnidadMedida > 0 Then Alert(String.Format("No se encontró la Unidad de Medida."), TipoMensaje.MsgError) : ErrorCompras = True
|
||||
If Not CveProveedor > 0 Then Alert(String.Format("No se encontró el Proveedor con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorCompras = True : Exit For
|
||||
TipoDocto = IIf(TipoDocto = "Ingresos", "Fac", "NC")
|
||||
|
||||
'PrePóliza
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Compras/SaldoInicial", 1, Total, Total, 1, Fecha, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If Not CvePrePoliza > 0 Then ErrorCompras = True : Exit For
|
||||
|
||||
'Compra
|
||||
If Not ObjCompras.AddCompra(TipoDocto, "", Serie, Folio, Folio, CveProveedor.ToEntero, SubTotal, 0, 0, IVA, 0, 0, 0, 0, 0, Total, Fecha, 1, 1, "-1".ToDate,
|
||||
True, "", 1, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
ErrorCompras = True
|
||||
Exit For
|
||||
End If
|
||||
CveCompra = ObjCompras.CveCompra
|
||||
|
||||
'Compra Detalle
|
||||
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, -1, -1, 0, 1, SubTotal, 0.16, SubTotal, 0, "Carga Inicial", -1) Then
|
||||
ErrorCompras = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'PrePólizaDetalle
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio, IIf(TipoDocto = "Fac", 5, 18), String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, SubTotal, Folio, 6, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Folio, 14, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For
|
||||
|
||||
'Saldo
|
||||
If Saldo < Total Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, Folio, 17, Folio, Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total - Saldo, Folio, 95, Folio, Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
If Not ErrorCompras Then
|
||||
If Contador > 0 Then
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Compras correctamente.<br>Se Omitieron: <b>{1}</b> Compras ya que ya se encuentran registradas.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Compras correctamente.", NumRows), TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Compras correctamente.", NumRows), TipoMensaje.MsgInformacion)
|
||||
ObjCompras.Commit()
|
||||
TxtExcel.Text = ""
|
||||
UpDatos.Update()
|
||||
Else
|
||||
ObjCompras.RollBack()
|
||||
End If
|
||||
ObjCompras.Dispose()
|
||||
|
||||
'C L I E N T E S - F A C T U R A S
|
||||
ElseIf RblFormato.SelectedValue = "4" Then
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||
Dim ErrorVentas As Boolean = False
|
||||
Dim CveVenta As Integer
|
||||
Dim DtClientes = New DataTable
|
||||
' Dim ExisteVenta As Boolean = False
|
||||
'Dim Contador As Integer = 0
|
||||
DtClientes = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim CveSucursal As Integer = GlobalDTSucursales(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSucursal").ToString.ToEntero
|
||||
Dim CvePS As Integer = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS").ToString.ToEntero
|
||||
Dim CveUnidadMedida As Integer = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida").ToString.ToEntero
|
||||
|
||||
If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorVentas = True
|
||||
If Not CveSucursal > 0 Then Alert("No se encontró la sucursal.", TipoMensaje.MsgError) : ErrorVentas = True
|
||||
If Not CveUnidadMedida > 0 Then Alert(String.Format("No se encontró la Unidad de Medida."), TipoMensaje.MsgError) : ErrorVentas = True
|
||||
|
||||
For Each Row As DataRow In dt.Rows
|
||||
Dim Sucursal As String = Row("Sucursal").ToString
|
||||
Dim TipoDocto As String = Row("Tipo Documento").ToString
|
||||
Dim RFC As String = Row("RFC").ToString.Trim
|
||||
Dim Serie As String = Row("Serie").ToString
|
||||
Dim Folio As Integer = Row("Folio").ToString.ToEntero
|
||||
Dim Fecha As Date = Row("Fecha").ToString.ToDate
|
||||
Dim SubTotal As Double = Row("SubTotal").ToString.ToDouble
|
||||
Dim IVA As Double = Row("IVA").ToString.ToDouble
|
||||
Dim Total As Double = Row("Total").ToString.ToDouble
|
||||
Dim Saldo As Double = Row("Saldo").ToString.ToDouble
|
||||
Dim CveCliente As Integer = DtClientes.FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
|
||||
|
||||
If Not CveCliente > 0 Then Alert(String.Format("No se encontró el cliente con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorVentas = True : RFC.GuardaLog : Exit For
|
||||
TipoDocto = IIf(TipoDocto = "Ingresos", "Ing", "Egs")
|
||||
'PrePóliza
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Venta/SaldoIncial", 1, Total, Total, 1, Fecha, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If Not CvePrePoliza > 0 Then ErrorVentas = True : Exit For
|
||||
|
||||
'Venta
|
||||
If Not ObjVentas.AddVenta(TipoDocto, Folio, CveCliente.ToEntero, -1, SubTotal, 0, 0, IVA, 0, 0, Total, 1, 1,
|
||||
0, 0, 0, Fecha, Fecha, "", "", Fecha, 0, CveSucursal, CveSucursal, "", "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza,
|
||||
UsuarioActual.CveUsuario, CveSucursal, UsuarioActual.CveEmpresa, Serie:=Serie) Then
|
||||
ErrorVentas = True
|
||||
Exit For
|
||||
End If
|
||||
CveVenta = ObjVentas.CveVenta
|
||||
|
||||
If Not ObjVentas.AddVentaDetalle(CveVenta, CvePS, 1, CveUnidadMedida, SubTotal, 0.16, SubTotal, "Saldo Inicial", 0, 0, -1, 0) Then
|
||||
ErrorVentas = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
|
||||
'PrePólizaDetalle
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio, 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=1) Then ErrorVentas = True : Exit For
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio, 1, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente) Then ErrorVentas = True : Exit For
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, Folio, 13, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente) Then ErrorVentas = True : Exit For
|
||||
|
||||
'Saldo
|
||||
If Saldo < Total Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total - Saldo, Folio, 2, Folio, Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente) Then ErrorVentas = True : Exit For
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, Folio, 95, Folio, Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente) Then ErrorVentas = True : Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
If Not ErrorVentas Then
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Ventas correctamente.", NumRows), TipoMensaje.MsgInformacion)
|
||||
ObjVentas.Commit()
|
||||
TxtExcel.Text = ""
|
||||
UpDatos.Update()
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
|
||||
'P R O D U C T O S / S E R V I C I O S
|
||||
ElseIf RblFormato.SelectedValue = "5" Then
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
Dim ErrorPS As Boolean = False
|
||||
Dim ExistePS As Boolean = False
|
||||
Dim Contador As Integer = 0
|
||||
' ObjPS.IniciaTransacSQL()
|
||||
|
||||
For Each Row As DataRow In dt.Rows
|
||||
Dim Codigo As String = Row("Codigo").ToString
|
||||
Dim Descripcion As String = Row("Descripcion").ToString
|
||||
Dim TipoPS As String = Row("Tipo").ToString.Trim
|
||||
Dim CodigoBarras As String = Row("Código Barras").ToString
|
||||
Dim UnidadMedida As String = Row("Unidad Medida").ToString
|
||||
Dim Clasificacion As String = Row("Clasificacion").ToString
|
||||
Dim Marca As Decimal = Row("Marca").ToString.ToDecimal
|
||||
Dim AplicaSerie As String = Row("AplicaSerie").ToString
|
||||
Dim Precio As String = Row("Precio").ToString
|
||||
Dim IEPS As String = Row("IEPS").ToString
|
||||
Dim CvePS As Integer = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", $"Codigo = '{Codigo}'").ToString.ToEntero
|
||||
|
||||
If CvePS > 0 Then
|
||||
ExistePS = True
|
||||
Contador = Contador + 1
|
||||
Else
|
||||
If Not ObjPS.AddPS(1, 1, 1, Codigo, "", "", Descripcion, Precio, 0, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1) Then
|
||||
ErrorPS = True
|
||||
Codigo.GuardaLog
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not ErrorPS Then
|
||||
'ObjPS.Commit()
|
||||
If ObjPS.GetPS(-1, -1, -1) Then Application("GlobalDTProductosServicios") = ObjPS.DtResultados.AsEnumerable()
|
||||
If Contador > 0 Then
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Productos/Servicios correctamente. <br>Se Omitieron: <b>{1}</b> Productos/Servicios ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert(String.Format("Se agregaron: <b>{0}</b> Productos/Servicios correctamente.", NumRows), TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
TxtExcel.Text = ""
|
||||
UpDatos.Update()
|
||||
Else
|
||||
'ObjPS.RollBack()
|
||||
End If
|
||||
ObjPS.Dispose()
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
|
||||
Dim Directorio As String = ""
|
||||
If RblFormato.SelectedValue = "1" Then
|
||||
Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoProveedores.xlsx"
|
||||
ElseIf RblFormato.SelectedValue = "2" Then
|
||||
Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoClientes.xlsx"
|
||||
ElseIf RblFormato.SelectedValue = "3" Then
|
||||
Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoProveedores-Facturas.xlsx"
|
||||
ElseIf RblFormato.SelectedValue = "4" Then
|
||||
Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoClientes-Facturas.xlsx"
|
||||
End If
|
||||
|
||||
Dim Archivo As New IO.FileInfo(Directorio)
|
||||
If Archivo.Exists Then
|
||||
Response.Clear()
|
||||
Response.ClearHeaders()
|
||||
Response.ClearContent()
|
||||
Response.AddHeader("Content-Disposition", "attachment; filename=" + Archivo.Name)
|
||||
Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||
Response.ContentType = "text/plain"
|
||||
Response.Flush()
|
||||
Response.TransmitFile(Archivo.FullName)
|
||||
Response.End()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
@@ -585,7 +585,35 @@ Partial Class General_SaldosIniciales
|
||||
If Not dt.Columns(11).ColumnName = "Clave Unidad" Then
|
||||
Alert("El nombre de la diescisieteava columna debe ser 'Clave Unidad'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
ElseIf RblFormato.SelectedValue = "9" Then
|
||||
|
||||
If Not dt.Columns(0).ColumnName = "Cuenta" Then
|
||||
Alert("El nombre de la primera columna debe ser 'Cuenta'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not dt.Columns(1).ColumnName = "NombreCuenta" Then
|
||||
Alert("El nombre de la segunda columna debe ser 'NombreCuenta'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not dt.Columns(2).ColumnName = "TipoCuenta" Then
|
||||
Alert("El nombre de la tercera columna debe ser 'TipoCuenta'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not dt.Columns(3).ColumnName = "CuentaPadre" Then
|
||||
Alert("El nombre de la cuarta columna debe ser 'CuentaPadre'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not dt.Columns(5).ColumnName = "AgrupadorSAT" Then
|
||||
Alert("El nombre de la quinta columna debe ser 'AgrupadorSAT'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
ElseIf RblFormato.SelectedValue = "12" Then
|
||||
If Not dt.Columns(0).ColumnName = "CodigoPS" Then
|
||||
Alert("El nombre de la primera columna debe ser 'CodigoPS'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
@@ -816,19 +844,24 @@ Partial Class General_SaldosIniciales
|
||||
End If
|
||||
|
||||
Else
|
||||
If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
|
||||
CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
|
||||
CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2) <= 0 Then
|
||||
'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
|
||||
' CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) <= 0 Then
|
||||
ErrorPS = True
|
||||
Codigo.GuardaLog
|
||||
Exit For
|
||||
Else
|
||||
If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then
|
||||
DTPS = ObjPS.DtResultados
|
||||
End If
|
||||
End If
|
||||
|
||||
If Codigo.Length > 0 Then
|
||||
|
||||
If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
|
||||
CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
|
||||
CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2) <= 0 Then
|
||||
'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
|
||||
' CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) <= 0 Then
|
||||
ErrorPS = True
|
||||
Codigo.GuardaLog
|
||||
Exit For
|
||||
Else
|
||||
If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then
|
||||
DTPS = ObjPS.DtResultados
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -1772,7 +1805,7 @@ Partial Class General_SaldosIniciales
|
||||
Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString
|
||||
Dim CveCuentaPadre As Integer = -1
|
||||
|
||||
If Not CuentaPadre = "NULL" Then
|
||||
If Not CuentaPadre = "" Then
|
||||
If ObjConta.GetCuentas(-1, CuentaPadre.Replace("-", ""), -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
CveCuentaPadre = ObjConta.DtResultados().FiltroPrimeroValor("Id").ToEntero
|
||||
@@ -1788,7 +1821,7 @@ Partial Class General_SaldosIniciales
|
||||
CveCuentaPadre = -2
|
||||
End If
|
||||
|
||||
Dim IdNew = ObjConta.AddCuenta(CveCuentaPadre, Cuenta.Replace("-", ""), NombreCuenta, TipoCuenta, 1, 1)
|
||||
Dim IdNew = ObjConta.AddCuenta(CveCuentaPadre, Cuenta.Replace("-", ""), NombreCuenta, TipoCuenta, 1, 1, CveEmpresaParam:=UsuarioActual.CveEmpresa)
|
||||
If IdNew > 0 Then
|
||||
ContadorUpdate = ContadorUpdate + 1
|
||||
Else
|
||||
|
||||
@@ -3270,6 +3270,9 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Dim ValorInventario As Decimal = 0
|
||||
Dim ValorInventarioME As Decimal = 0
|
||||
|
||||
Dim CvePrePolizaRegistrada As Integer = -1
|
||||
|
||||
|
||||
ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa)
|
||||
Dim CveVenta As Integer = ObjInventario.CveVenta
|
||||
Dim MovAlmacen As Boolean = True
|
||||
@@ -3287,6 +3290,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
If tmpCostos.Rows.Count > 0 Then
|
||||
Dim Concepto As String = If(TxtObservaciones.Text = "", ConceptoPoliza, $" {TxtObservaciones.Text}")
|
||||
Dim CvePrePoliza = ObjConta.AddPrePolizas("Inv_EntradaSalida", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
CvePrePolizaRegistrada = CvePrePoliza
|
||||
|
||||
If HdnCveOrdenCompra.Value.ToEntero > 0 Then
|
||||
MovAlmacen = False
|
||||
@@ -3362,11 +3366,24 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End If
|
||||
|
||||
If ErrorMovInv = False Then
|
||||
ObjInventario.Commit()
|
||||
ObjInventario.Commit()
|
||||
ObjInventario.Dispose()
|
||||
ObjConta.Dispose()
|
||||
|
||||
If CvePrePolizaRegistrada > 0 Then
|
||||
Response.Redirect($"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={CvePrePolizaRegistrada}", True)
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
|
||||
|
||||
ObjInventario.Dispose()
|
||||
ObjConta.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
ObjInventario.Dispose()
|
||||
ObjConta.Dispose()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -89,21 +89,30 @@
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="btnFin" runat="server" Text="Finalizar" data-toggle="confirmation" data-popout="true" data-original-title="Finalizar el inventario" data-btn-ok-label="si" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LBAvance" OnClick="LBAvance_Click" runat="server" Text="Ver Avance" Visible="false" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPDF" runat="server"><i class="fa fa-ad-pdf"></i> Imprimir PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPDFResumido" runat="server"><i class="fa fa-ad-pdf"></i> Imprimir PDF Resumido</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" runat="server"><i class="fa fa-ad-excel"></i> Imprimir EXCEL</asp:LinkButton>
|
||||
</li>
|
||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="btnFin" runat="server" Text="Finalizar" data-toggle="confirmation" data-popout="true" data-original-title="Finalizar el inventario" data-btn-ok-label="si" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LBAvance" OnClick="LBAvance_Click" runat="server" Text="Ver Avance" Visible="false" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPDF" runat="server"><i class="fa fa-ad-pdf"></i> Imprimir PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPDFResumido" runat="server"><i class="fa fa-ad-pdf"></i> Imprimir PDF Resumido</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" runat="server"><i class="fa fa-ad-excel"></i> Imprimir EXCEL</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkPDF" />
|
||||
<asp:PostBackTrigger ControlID="LnkPDFResumido" />
|
||||
<asp:PostBackTrigger ControlID="LnkExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
|
||||
@@ -432,8 +432,8 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Protected Sub Impimir(Optional Formato As String = "PDF", Optional Agrupar As Boolean = False)
|
||||
Dim DtDatos As New DataTable
|
||||
Dim ObjInventario As New ClsInventarios()
|
||||
If ObjInventario.GetInventarioFisicoDetalle(CveInventarioFisico, UsuarioActual.CveUsuario, Agrupar:=Agrupar) Then
|
||||
DtDatos = ObjInventario.DtResultados
|
||||
If ObjInventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue, Agrupar:=Agrupar) Then
|
||||
DtDatos = ObjInventario.DtResultados.Copy
|
||||
End If
|
||||
ObjInventario.Dispose()
|
||||
|
||||
|
||||
@@ -343,11 +343,16 @@ Partial Class Inventarios_Kardex
|
||||
EntradaSalida = " Solo Salidas"
|
||||
End If
|
||||
|
||||
Dim CveTiposAlmacen = ""
|
||||
For Each item As ListItem In CBLTiposAlmacen.Items
|
||||
CveTiposAlmacen += If(item.Selected, $"{item.Value},", "")
|
||||
Next
|
||||
|
||||
Dim Serie As String = If(TxtSerie.Text <> "", TxtSerie.Text, "-1")
|
||||
|
||||
Dim SerieAgrupado As String = If(TxtSerie.Text = "", "", $"<b>Existencia y costos calculada por numero de serie:</b> {TxtSerie.Text} ")
|
||||
|
||||
If Movimientos.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, "1", DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked, Serie) Then
|
||||
If Movimientos.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked, Serie) Then
|
||||
|
||||
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)
|
||||
|
||||
@@ -40,7 +40,7 @@ Partial Class Inventarios_RepAlmacen
|
||||
DdlTipoAlmacen.DataBind()
|
||||
DdlTipoAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1)
|
||||
DdlAlmacen.DataBind()
|
||||
DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="row">
|
||||
<label class="col-md-1" style="width: 60px !important;">Ejercicio: </label>
|
||||
<div class="col-md-2" style="width: 140px !important;">
|
||||
<asp:DropDownList ID="DdlEjercicios" DataTextField="Ejercicio" DataValueField="Ejercicio" runat="server" width="100%" CssClass="select2me"></asp:DropDownList>
|
||||
<asp:DropDownList ID="DdlEjercicios" DataTextField="Ejercicio" DataValueField="Ejercicio" runat="server" Width="100%" CssClass="select2me"></asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1" style="width: 120px !important;">Tipo Período: </label>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</asp:DropDownList>
|
||||
|
||||
</div>
|
||||
<label class="col-md-1" style="width: 60px !important;"> </label>
|
||||
<label class="col-md-1" style="width: 60px !important;"></label>
|
||||
<div class="col-md-2">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
@@ -55,18 +55,33 @@
|
||||
<div class="dashboard-stat blue">
|
||||
<div class="visual"><i class="fa fa-sort-numeric-desc"></i></div>
|
||||
<div class="details">
|
||||
<div class="number"> <asp:Literal ID="LtlTotal" runat="server"></asp:Literal> </div>
|
||||
<div class="number">
|
||||
<asp:Literal ID="LtlTotal" runat="server"></asp:Literal>
|
||||
</div>
|
||||
<div class="desc">
|
||||
Total Aguinaldo
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-md-offset-2">
|
||||
<div class="col-md-3 col-md-offset-1">
|
||||
<div class="dashboard-stat green">
|
||||
<div class="visual"><i class="fa fa-line-chart"></i></div>
|
||||
<div class="details">
|
||||
<div class="number"> <asp:Literal ID="LtldiasEjercicio" runat="server"></asp:Literal></div>
|
||||
<div class="number">
|
||||
<asp:Literal ID="LtlAutorizado" runat="server"></asp:Literal></div>
|
||||
<div class="desc">
|
||||
Autorizado
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-md-offset-1">
|
||||
<div class="dashboard-stat green">
|
||||
<div class="visual"><i class="fa fa-line-chart"></i></div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<asp:Literal ID="LtldiasEjercicio" runat="server"></asp:Literal></div>
|
||||
<div class="desc">
|
||||
Días ejercicio
|
||||
</div>
|
||||
@@ -75,7 +90,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GVCalcularAguinaldo" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVCalcularUtilidades" AutoGenerateColumns="False"
|
||||
DataKeyNames="Nombre,CvePersonal">
|
||||
DataKeyNames="Nombre,CvePersonal" OnRowDataBound="GVCalcularAguinaldo_RowDataBound">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Nombre ">
|
||||
<ItemTemplate>
|
||||
@@ -86,43 +101,43 @@
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbldiasLaborados" runat="server" Text='<%# Eval("DiasLaborados")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Días Aguinaldo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbldiasAguinaldo" runat="server" Text='<%# Eval("NumDiasAguinaldo")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Salario Diario">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblsueldoDiario" runat="server" Text='<%# Eval("SalarioDiario", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aguinaldo Completo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblsueldoAguinaldoCompleto" runat="server" Text='<%# Eval("AguinaldoCompleto", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aguinaldo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAguinaldo" runat="server" Text='<%# Eval("Aguinaldo", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aguinaldo Gravado">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAguinaldoGravado" runat="server" Text='<%# Eval("AguinaldoGravado", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Impuesto">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAguinaldo" runat="server" Text='<%# Eval("ISR", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign ="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
@@ -148,6 +163,47 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<div id="ModalAutorizar" class="modal ADS fade" role="dialog">
|
||||
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAutorizar" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Autorizar</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<label class="col-md-4 ">Tipo Período:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlTipoPeriodoB" runat="server" CssClass="select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoPeriodoB_SelectedIndexChanged"
|
||||
DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Style="width: 100% !important;">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-4 ">Período:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlPeriodo" runat="server" CssClass="select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo" Style="width: 100% !important;" >
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="LnkAutorizar" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpUpDatosFiel" OnClick="LnkAutorizar_Click"> <i class='material-icons'>done_all</i> Actualizar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -34,7 +34,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
|
||||
}
|
||||
DdlEjercicios.DataBind();
|
||||
|
||||
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'");
|
||||
DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo' AND CveTipoPeriodo <>-1");
|
||||
DdlTipoPeriodo.DataBind();
|
||||
DdlTipoPeriodo.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
if (DdlTipoPeriodo.Items.Count > 0)
|
||||
@@ -58,16 +58,204 @@ public partial class Nomina_Aguinaldo : ClsPaginas
|
||||
DTAguinaldos = objnom.DtResultados;
|
||||
GVCalcularAguinaldo.DataSource = DTAguinaldos;
|
||||
LtlTotal.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo"));
|
||||
LtlAutorizado.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo","CveNomina>0"));
|
||||
|
||||
LtldiasEjercicio.Text = string.Format("{0}/12/31", ejercicio).ToDate().DayOfYear.ToString();
|
||||
}
|
||||
|
||||
GVCalcularAguinaldo.DataBind();
|
||||
GVCalcularAguinaldo.DataBind();
|
||||
LnkAutorizarModal.Visible = true;
|
||||
upDatosPA_N.Update();
|
||||
}
|
||||
private void CargaPeriodos()
|
||||
{
|
||||
DataTable dtPeriodos = null;
|
||||
using (ClsNominas ObjPeriodos = new ClsNominas())
|
||||
{
|
||||
if (ObjPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, DdlEjercicios.SelectedValue.ToEntero(), -1, -1))
|
||||
{
|
||||
dtPeriodos = ObjPeriodos.DtResultados.FiltraParametros("Estatus IN (0,1)");
|
||||
}
|
||||
ObjPeriodos.Dispose();
|
||||
}
|
||||
|
||||
if (dtPeriodos != null && dtPeriodos.Rows.Count > 0)
|
||||
{
|
||||
DdlPeriodo.DataSource = dtPeriodos.FiltraParametros(string.Format(" CveTipoPeriodo={0}", DdlTipoPeriodoB.SelectedValue));
|
||||
}
|
||||
DdlPeriodo.DataBind();
|
||||
DdlPeriodo.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
UpModalAutorizar.Update();
|
||||
}
|
||||
protected void LnkAutorizarModal_Click(object sender, EventArgs e)
|
||||
{
|
||||
DdlTipoPeriodoB.ClearSelection();
|
||||
DdlTipoPeriodoB.Items.Clear();
|
||||
DdlTipoPeriodoB.DataSource = GlobalDTTipoPeriodo.FiltraParametros(string.Format("CveTipoPeriodo=6 OR CveTipoPeriodo={0}", DdlTipoPeriodo.SelectedValue));
|
||||
DdlTipoPeriodoB.DataBind();
|
||||
|
||||
CargaPeriodos();
|
||||
RegistraScript("$('#ModalAutorizar').modal();");
|
||||
}
|
||||
|
||||
protected void LnkAutorizar_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool continuar = true;
|
||||
string mensaje = "";
|
||||
//int DiasLaborados;
|
||||
decimal Importe;
|
||||
int CveMoneda = 1;
|
||||
var CvePeriodoSeleccionado = DdlPeriodo.SelectedValue.ToEntero();
|
||||
int ejercicio = DdlEjercicios.SelectedValue.ToEntero();
|
||||
int CvePersonal;
|
||||
int CvePeriodo;
|
||||
decimal ImporteGravado = 0;
|
||||
decimal ImporteExento = 0;
|
||||
//string NombrePersonal = "";
|
||||
int CveMetodoPago = 0;
|
||||
int CveNomina = 0;
|
||||
int CveConcepto = 0;
|
||||
if (continuar)
|
||||
{
|
||||
using (ClsNominas objNomina = new ClsNominas())
|
||||
{
|
||||
objNomina.IniciaTransacSQL();
|
||||
if (continuar)
|
||||
{
|
||||
//continuar = objNomina.UpADDdUtilidadesEjercicio(UsuarioActual.CveEmpresa, ejercicio, utilimporte, utilimporteAnt, false);
|
||||
//if (continuar)
|
||||
//{
|
||||
// if (objNomina.DtResultados.Rows.Count < 0 || objNomina.DtResultados.Rows[0]["CONTimbrado"].ToString() == "1")
|
||||
// continuar = false;
|
||||
//}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
continuar = objNomina.GetConceptos(UsuarioActual.CveEmpresa);
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
DataRow rowc = objNomina.DtResultados.FiltroPrimero("CveSistema=5");
|
||||
if ((rowc != null))
|
||||
{
|
||||
CveConcepto = rowc["CveConcepto"].ToString().ToEntero();
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// CveConcepto = objNomina.AddConcepto("PTU", "Utilidades", "P", "", true, true, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, false, -1, -1, -1, 0, -1, 0, 0, 0, 0, 0);
|
||||
//}
|
||||
if (CveConcepto < 1)
|
||||
{
|
||||
continuar = false;
|
||||
Alert("debe agregar un concepto para el calculo del aguinaldo", ModExtensiones.TipoMensaje.ToastAdventencia);
|
||||
}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
foreach (DataRow row in DTAguinaldos.Rows)
|
||||
{
|
||||
//DiasLaborados = row["DiasLaborados"].ToString().ToEntero();
|
||||
CvePeriodo = CvePeriodoSeleccionado;
|
||||
/*
|
||||
if (continuar)
|
||||
{CveNomina
|
||||
continuar = objNomina.AddUtilidad(CvePersonal, Importe, CvePeriodo, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ejercicio, DiasLaborados, SueldoTotal);
|
||||
}*/
|
||||
CveNomina = 0;
|
||||
CvePersonal = row["CvePersonal"].ToString().ToEntero();
|
||||
CveMetodoPago = row["CveMetodoPago"].ToString().ToEntero();
|
||||
Importe = row["Aguinaldo"].ToString().ToDecimal();
|
||||
ImporteGravado = row["AguinaldoGravado"].ToString().ToDecimal();
|
||||
ImporteExento = Importe - ImporteGravado;
|
||||
|
||||
if (CvePersonal > 0 && Importe>0 && row["CveNomina"].ToString().ToEntero()==0)
|
||||
{
|
||||
if (objNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodoSeleccionado, -1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
if (objNomina.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
CveNomina = objNomina.CveNomina;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (objNomina.AddNom_Nominas(-1, 1, CvePersonal, CvePeriodoSeleccionado, Importe.ToString().ToDouble(), 0, 0, Importe.ToString().ToDouble(), CveMoneda, 1, CveMetodoPago, DateTime.Now, "Deducciones nómina",
|
||||
"", "", "", "", 0, 0, 0, new DateTime(), new DateTime(), new DateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
CveNomina = objNomina.CveNomina;
|
||||
}
|
||||
else
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
if (CveNomina > 0)
|
||||
{
|
||||
|
||||
if (!objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, UsuarioActual.CveUsuario))
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!continuar)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//if (continuar & CvePeriodoSeleccionado > 0)
|
||||
//{
|
||||
// continuar = objNomina.CambiaEstatusPeriodo(CvePeriodoSeleccionado, (int)enumNominasEstatus.Activa, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
|
||||
//}
|
||||
if (continuar)
|
||||
{
|
||||
objNomina.Commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
objNomina.RollBack();
|
||||
}
|
||||
objNomina.Dispose();
|
||||
}
|
||||
}
|
||||
if (mensaje.Length > 0)
|
||||
{
|
||||
Alert(mensaje, ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
continuar = false;
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
RegistraScript("$('#ModalAutorizar').modal('hide');");
|
||||
Alert("Se ha generado el aguinaldo");
|
||||
BtnCalcular_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
protected void DdlTipoPeriodoB_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
CargaPeriodos();
|
||||
}
|
||||
|
||||
protected void GVCalcularAguinaldo_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
int CveNomina = e.Row.DBCampo("CveNomina").ToString().ToEntero();
|
||||
if (CveNomina > 0)
|
||||
{
|
||||
e.Row.CssClass = "success";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,9 +283,15 @@ Partial Class Nomina_Finiquito
|
||||
pnlupValoresFiniquito.Visible = True
|
||||
End If
|
||||
Using ObjNom As New ClsNominas()
|
||||
If ObjNom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
DTConceptosPersonal = ObjNom.DtResultados
|
||||
End If
|
||||
'If ObjNom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
' DTConceptosPersonal = ObjNom.DtResultados
|
||||
'Autoriza nomina
|
||||
'Finiquita Liquidación
|
||||
'Rep Nomina
|
||||
'RepInversion de nomina
|
||||
'Alertas Altas /Bajas
|
||||
'
|
||||
'End If
|
||||
End Using
|
||||
GvConceptos.DataSource = ConceptsPersonas
|
||||
GvConceptos.DataBind()
|
||||
|
||||
@@ -71,6 +71,9 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkVerTablas" OnClick="LnkVerTablas_Click" runat="server">Tablas</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkAutorizar" OnClick="LnkAutorizar_Click" runat="server"><i class="fa fa-thumbs-up" aria-hidden="true"></i>Autorizar</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
@@ -551,7 +551,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
GvNominas.DataBind();
|
||||
}
|
||||
|
||||
try
|
||||
if (dtPeriodo != null && dtPeriodo.Rows.Count > 0)
|
||||
{
|
||||
|
||||
DateTime FechaInicio = (DateTime)dtPeriodo.Rows[0]["FechaInicio"];
|
||||
@@ -596,11 +596,6 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
gvasistencia.Append("</table>");
|
||||
ltlGvAsistencia.Text = gvasistencia.ToString();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
#endregion
|
||||
UpDatos.Update();
|
||||
@@ -845,7 +840,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
{
|
||||
if (!dontsaveconcepto)//el usuario definira si desea actualizar o no el concepto en el periodo
|
||||
{
|
||||
if (!objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, UsuarioActual.CveUsuario))
|
||||
if (!objNomina.AddUPNom_NominasDetalles(objNomina.CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, Importe, ImporteGravado, ImporteExento, UsuarioActual.CveUsuario,true))
|
||||
{
|
||||
rollback = true;
|
||||
}
|
||||
@@ -1052,7 +1047,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
|
||||
|
||||
|
||||
frow = objper.DtResultados.FiltroPrimero("CveSistema =4");
|
||||
frow = objper.DtResultados.FiltroPrimero("CveSistema =4");
|
||||
TxtFonValor.Text = "";
|
||||
DdlFonTipoAplicacion.SelectedValueExist("-1");
|
||||
TxtFonDescripcion.Text = "";
|
||||
@@ -2957,7 +2952,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
double valor = TxtValor.Text.ToDouble();
|
||||
int vecesAplicar = TxtVecesAplicar.Text.ToEntero();
|
||||
decimal montoLimite = TxtMontoLimite.Text.ToDecimal();
|
||||
string fechaInicioAplicacion = TxtFechaAplicacion.Text.ToDate().ToString("yyyy/MM/dd");
|
||||
string fechaInicioAplicacion = TxtFechaAplicacion.Text.ToDate().ToString("yyyy/MM/dd");
|
||||
bool estatus = ChkEstatus.Checked;
|
||||
bool Continuar;
|
||||
using (ClsNominas ObjMovt = new ClsNominas())
|
||||
@@ -2983,7 +2978,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
double valor = TxtValor.Text.ToDouble();
|
||||
int vecesAplicar = TxtVecesAplicar.Text.ToEntero();
|
||||
decimal montoLimite = TxtMontoLimite.Text.ToDecimal();
|
||||
string fechaInicioAplicacion = TxtFechaAplicacion.Text.ToDate().ToString("yyyy/MM/dd");
|
||||
string fechaInicioAplicacion = TxtFechaAplicacion.Text.ToDate().ToString("yyyy/MM/dd");
|
||||
bool estatus = ChkEstatus.Checked;
|
||||
bool Continuar;
|
||||
using (ClsNominas ObjMovt = new ClsNominas())
|
||||
@@ -3078,4 +3073,111 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void LnkAutorizar_Click(object sender, EventArgs e)
|
||||
{
|
||||
autorizarNomina(-1);
|
||||
}
|
||||
|
||||
private void autorizarNomina(int FiltroCvePersonal)
|
||||
{
|
||||
|
||||
bool continuar = true;
|
||||
DataTable dtr = dtempleados.FiltraParametros(string.Format("CvePersonal={0} OR {0}=-1", FiltroCvePersonal));
|
||||
DataTable dtconp = null;
|
||||
int CvePeriodoSeleccionado = DdlPeriodo.SelectedValue.ToEntero();//cambiar reparar
|
||||
#region PropNomina
|
||||
int CvePersonal = 0;
|
||||
int CveNomina = 0;
|
||||
int CveMetodoPago = 0;
|
||||
double Total = 0;
|
||||
int CveMoneda = 1;
|
||||
#endregion
|
||||
#region PropNominaDetalle
|
||||
int CveConcepto=0;
|
||||
decimal ImporteConcepto=0, ImporteGravadoConcepto=0, ImporteExentoConcepto = 0;
|
||||
#endregion
|
||||
|
||||
|
||||
using (ClsNominas objNomina = new ClsNominas())
|
||||
{
|
||||
objNomina.IniciaTransacSQL();
|
||||
foreach (DataRow rtemp in dtr.Rows)
|
||||
{
|
||||
CveNomina = 0;
|
||||
CvePersonal = rtemp["CvePersonal"].ToString().ToEntero();
|
||||
CveMetodoPago = rtemp["CveMetodoPago"].ToString().ToEntero();
|
||||
Total = 0;//cambiar reparar
|
||||
|
||||
if (continuar)
|
||||
{
|
||||
if (objNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodoSeleccionado, -1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
if (objNomina.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
CveNomina = objNomina.CveNomina;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (objNomina.AddNom_Nominas(-1, 1, CvePersonal, CvePeriodoSeleccionado, Total, 0, 0, Total, CveMoneda, 1, CveMetodoPago, DateTime.Now, "Deducciones nómina",
|
||||
"", "", "", "", 0, 0, 0, new DateTime(), new DateTime(), new DateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
CveNomina = objNomina.CveNomina;
|
||||
}
|
||||
else
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CveNomina == 0)
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (continuar)
|
||||
{
|
||||
dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0}", CvePersonal));
|
||||
foreach (DataRow rcon in dtconp.Rows)
|
||||
{
|
||||
|
||||
CveConcepto =rcon["CveConcepto"].ToString().ToEntero();
|
||||
ImporteConcepto =rcon["ImporteConcepto"].ToString().ToDecimal();
|
||||
ImporteGravadoConcepto =rcon["ImporteGravadoConcepto"].ToString().ToDecimal();
|
||||
ImporteExentoConcepto = ImporteConcepto -ImporteGravadoConcepto ;
|
||||
if (continuar)
|
||||
{
|
||||
|
||||
if (!objNomina.AddUPNom_NominasDetalles(CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, ImporteConcepto, ImporteGravadoConcepto, ImporteExentoConcepto, UsuarioActual.CveUsuario))
|
||||
{
|
||||
continuar = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
objNomina.Commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
objNomina.RollBack();
|
||||
|
||||
}
|
||||
}
|
||||
dtr.Dispose();
|
||||
dtconp.Dispose();
|
||||
Alert("Termine");
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ Partial Class Nomina_ReportePTU
|
||||
|
||||
Private Sub CargaPeriodos()
|
||||
Dim ObjPeriodos As New ClsNominas()
|
||||
If ObjPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, DdlEjercicios.SelectedValue.ToEntero, -1, -1) Then
|
||||
If ObjPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, DdlEjercicios.SelectedValue.ToEntero(), -1, -1) Then
|
||||
dtPeriodos = ObjPeriodos.DtResultados.FiltraParametros("Estatus IN (0,1)")
|
||||
End If
|
||||
ObjPeriodos.Dispose()
|
||||
@@ -86,7 +86,7 @@ Partial Class Nomina_ReportePTU
|
||||
GVTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros($"Estatus = 'Activo' AND CveTipoPeriodo IN({listaCveTipoPeriodo.ToString()})")
|
||||
GVTipoPeriodo.DataBind()
|
||||
|
||||
If (Not IsNothing(dtPeriodos) AndAlso dtPeriodos.Rows.Count()) Then
|
||||
If (Not IsNothing(dtPeriodos) AndAlso dtPeriodos.Rows.Count() > 0) Then
|
||||
DdlPeriodo.DataSource = dtPeriodos.FiltraParametros("CveTipoPeriodo=6")
|
||||
|
||||
End If
|
||||
@@ -97,6 +97,7 @@ Partial Class Nomina_ReportePTU
|
||||
|
||||
Protected Sub DdlPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
PnlTipoPeriodos.Visible = (DdlPeriodo.SelectedValue.ToEntero() <= 0)
|
||||
UpModalAutorizar.Update()
|
||||
End Sub
|
||||
'Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
' CargaPeriodos()
|
||||
|
||||
@@ -531,7 +531,7 @@
|
||||
<asp:UpdatePanel ID="UpGvVacaciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvVacaciones" Width="100%" runat="server" GridLines="None" BorderWidth="0" data-heighterror="330" data-freezecols="0" data-freezerows="1"
|
||||
DataKeyNames="CvePersonalVacaciones,Periodo,FechaIng,Estatus,CveAutoriza,Autoriza,Dias,Usuario,SEstatus,Folio,FechaInicio,FechaFin,Documento"
|
||||
DataKeyNames="CvePersonalVacaciones,Periodo,FechaIng,Estatus,CveAutoriza,Autoriza,Dias,Usuario,SEstatus,Folio,FechaInicio,FechaFin,Documento,Motivo"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD GvVacaciones" data-sort="true" data-height="300" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
@@ -590,7 +590,7 @@
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpGvPermisos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvPermisos" Width="100%" runat="server" GridLines="None" DataKeyNames="CvePermiso,CvePersonal,Descripcion,FechaInicio,FechaFin,HoraEntrada,HoraSalida, GoceSueldo, Estatus" BorderWidth="0" data-heighterror="330" data-freezecols="0" data-freezerows="1"
|
||||
<asp:GridView ID="GvPermisos" Width="100%" runat="server" GridLines="None" DataKeyNames="CvePermiso,CvePersonal,Descripcion,Motivo,FechaInicio,FechaFin,HoraEntrada,HoraSalida,GoceSueldo,Estatus" BorderWidth="0" data-heighterror="330" data-freezecols="0" data-freezerows="1"
|
||||
CssClass=" table table-striped table-advance table-hover Widthall" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
|
||||
@@ -450,13 +450,22 @@ Partial Class RH_MiPerfil
|
||||
|
||||
Dim jefeCve As Integer = If(ObjPersonal.CvePersonalPadre = ObjPersonal.CvePersonal, "0", If(ObjPersonal.CvePersonalPadre.ToString = "0", "-1", ObjPersonal.CvePersonalPadre.ToString))
|
||||
Dim expressionJefe As String = String.Format("CvePersonal = {0}", jefeCve)
|
||||
Dim resultad As DataRow() = DTOrganigrama.Select(expressionJefe)
|
||||
JefeInmediato = resultad(0).Item("NombreCompleto")
|
||||
Dim resultad As DataRow = DTOrganigrama.FiltroPrimero(expressionJefe)
|
||||
If (Not IsNothing(resultad)) Then
|
||||
JefeInmediato = resultad.Item("NombreCompleto").ToString()
|
||||
Else
|
||||
JefeInmediato = ""
|
||||
End If
|
||||
|
||||
Dim puestosAux As DataTable = GlobalDTRHPuestos(UsuarioActual.CveEmpresa)
|
||||
Dim expressionPuesto As String = String.Format("CvePuesto = {0}", ObjPersonal.CvePuesto.ToString)
|
||||
Dim resultadoPuesto As DataRow() = puestosAux.Select(expressionPuesto)
|
||||
puestoProp = resultad(0).Item("Puesto")
|
||||
Dim resultadoPuesto As DataRow = puestosAux.FiltroPrimero(expressionPuesto)
|
||||
|
||||
If (Not IsNothing(resultad)) Then
|
||||
puestoProp = resultadoPuesto.Item("Puesto")
|
||||
Else
|
||||
puestoProp = ""
|
||||
End If
|
||||
|
||||
If File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then
|
||||
ImgPersonal.ImageUrl = $"/Empresas/{UsuarioActual.CveEmpresa}/RH/Personal/{ObjPersonal.URL}"
|
||||
@@ -975,7 +984,7 @@ Partial Class RH_MiPerfil
|
||||
'Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero
|
||||
|
||||
'DescarSolicitudVacaciones(Folio)
|
||||
Dim RutaFormato As String = String.Format("{0}Formatos\RH_FormatoVacaciones.docx", UsuarioActual.Empresa.Ruta)
|
||||
Dim RutaFormato As String = String.Format("{0}Formatos\PermisoSolicitud.docx", UsuarioActual.Empresa.Ruta)
|
||||
|
||||
Dim NombreEmpleado As String = String.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text)
|
||||
Dim Codigo As String = TxtCodigo.Text
|
||||
@@ -983,8 +992,9 @@ Partial Class RH_MiPerfil
|
||||
Dim JefeInmediatoAux As String = JefeInmediato
|
||||
Dim FechaInicio As String = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy")
|
||||
Dim FechaFin As String = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy")
|
||||
Dim diasPermiso As String = $"{(GvRow.DataKey("FechaInicio").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}"
|
||||
Dim MotivoPermiso As String = GvRow.DataKey("Descripcion")
|
||||
Dim diasPermiso As String = $"{(GvRow.DataKey("FechaFin").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}"
|
||||
Dim HorasPermiso As String = "" 'String.Format("{0}", ((GvRow.DataKey("FechaInicio").ToDateTime() - GvRow.DataKey("FechaFin").ToDateTime()).Hours))
|
||||
Dim MotivoPermiso As String = String.Format("{0},{1}", GvRow.DataKey("Descripcion"), GvRow.DataKey("Motivo"))
|
||||
If File.Exists(RutaFormato) Then
|
||||
|
||||
Dim objGemDocument As New clsGemBoxDocument(RutaFormato)
|
||||
@@ -999,6 +1009,7 @@ Partial Class RH_MiPerfil
|
||||
ListaTags.Add(New TagsDocumentos("{FechaInicio}", FechaInicio))
|
||||
ListaTags.Add(New TagsDocumentos("{FechaFin}", FechaFin))
|
||||
ListaTags.Add(New TagsDocumentos("{diasPermiso}", diasPermiso))
|
||||
ListaTags.Add(New TagsDocumentos("{HorasPermiso}", HorasPermiso))
|
||||
ListaTags.Add(New TagsDocumentos("{MotivoPermiso}", MotivoPermiso))
|
||||
|
||||
objGemDocument.SustituirTags(ListaTags)
|
||||
@@ -1014,7 +1025,8 @@ Partial Class RH_MiPerfil
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicituddepermiso_" & Now.ToString("yyyyMMddhhmmss") & ".pdf")
|
||||
Response.BinaryWrite(bytesInStream)
|
||||
Response.End()
|
||||
|
||||
Else
|
||||
Alert("No se encontro el formato de Permisos", TipoMensaje.ToastAdventencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -2330,7 +2330,7 @@
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpGvPermisos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvPermisos" Width="100%" runat="server" GridLines="None" DataKeyNames="CvePermiso,CvePersonal,Descripcion,FechaInicio,FechaFin,HoraEntrada,HoraSalida, GoceSueldo, Estatus" BorderWidth="0" data-heighterror="330" data-freezecols="0" data-freezerows="1"
|
||||
<asp:GridView ID="GvPermisos" Width="100%" runat="server" GridLines="None" DataKeyNames="CvePermiso,CvePersonal,Descripcion,Motivo,FechaInicio,FechaFin,HoraEntrada,HoraSalida,GoceSueldo,Estatus" BorderWidth="0" data-heighterror="330" data-freezecols="0" data-freezerows="1"
|
||||
CssClass=" table table-striped table-advance table-hover Widthall" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
|
||||
@@ -4542,53 +4542,52 @@ Partial Class RH_Personal
|
||||
End Sub
|
||||
|
||||
Public Sub DownLoad_ClickSolicitudPermiso(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
'Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero
|
||||
|
||||
'DescarSolicitudVacaciones(Folio)
|
||||
Dim RutaFormato As String = String.Format("{0}Formatos\RH_FormatoVacaciones.docx", UsuarioActual.Empresa.Ruta)
|
||||
|
||||
Dim NombreEmpleado As String = String.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text)
|
||||
Dim Codigo As String = TxtCodigo.Text
|
||||
Dim Departamento As String = DdlDepartamento.SelectedItem.Text
|
||||
Dim JefeInmediato As String = DdlSupervisorOrganigrama.SelectedItem.Text
|
||||
Dim FechaInicio As String = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy")
|
||||
Dim FechaFin As String = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy")
|
||||
Dim diasPermiso As String = $"{(GvRow.DataKey("FechaInicio").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}"
|
||||
Dim MotivoPermiso As String = GvRow.DataKey("Descripcion")
|
||||
If File.Exists(RutaFormato) Then
|
||||
|
||||
Dim objGemDocument As New clsGemBoxDocument(RutaFormato)
|
||||
Dim ListaTags As New List(Of TagsDocumentos)
|
||||
|
||||
ListaTags = GetDatosTagsDocumentos()
|
||||
|
||||
ListaTags.Add(New TagsDocumentos("{NombreEmpleado}", NombreEmpleado))
|
||||
ListaTags.Add(New TagsDocumentos("{Codigo}", Codigo))
|
||||
ListaTags.Add(New TagsDocumentos("{Departamento}", Departamento))
|
||||
ListaTags.Add(New TagsDocumentos("{JefeInmediato}", JefeInmediato))
|
||||
ListaTags.Add(New TagsDocumentos("{FechaInicio}", FechaInicio))
|
||||
ListaTags.Add(New TagsDocumentos("{FechaFin}", FechaFin))
|
||||
ListaTags.Add(New TagsDocumentos("{diasPermiso}", diasPermiso))
|
||||
ListaTags.Add(New TagsDocumentos("{MotivoPermiso}", MotivoPermiso))
|
||||
|
||||
objGemDocument.SustituirTags(ListaTags)
|
||||
|
||||
'objGemDocument.GuardarStream()
|
||||
objGemDocument.GuardarStreamPDF()
|
||||
Dim bytesInStream As Byte() = objGemDocument.GetBytesDocumento()
|
||||
'Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray
|
||||
objGemDocument.Dispose()
|
||||
|
||||
Response.Clear()
|
||||
Response.ContentType = "application/force-download"
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicituddepermiso_" & Now.ToString("yyyyMMddhhmmss") & ".pdf")
|
||||
Response.BinaryWrite(bytesInStream)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
'Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero
|
||||
'DescarSolicitudVacaciones(Folio)
|
||||
Dim RutaFormato As String = String.Format("{0}Formatos\PermisoSolicitud.docx", UsuarioActual.Empresa.Ruta)
|
||||
|
||||
Dim NombreEmpleado As String = String.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text)
|
||||
Dim Codigo As String = TxtCodigo.Text
|
||||
Dim Departamento As String = DdlDepartamento.SelectedItem.Text
|
||||
Dim JefeInmediato As String = DdlSupervisorOrganigrama.SelectedItem.Text
|
||||
Dim FechaInicio As String = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy")
|
||||
Dim FechaFin As String = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy")
|
||||
Dim diasPermiso As String = $"{(GvRow.DataKey("FechaFin").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}"
|
||||
Dim HorasPermiso As String = "" 'String.Format("{0}", ((GvRow.DataKey("FechaInicio").ToDateTime() - GvRow.DataKey("FechaFin").ToDateTime()).Hours))
|
||||
Dim MotivoPermiso As String = String.Format("{0},{1}", GvRow.DataKey("Descripcion"), GvRow.DataKey("Motivo"))
|
||||
If File.Exists(RutaFormato) Then
|
||||
|
||||
Dim objGemDocument As New clsGemBoxDocument(RutaFormato)
|
||||
Dim ListaTags As New List(Of TagsDocumentos)
|
||||
|
||||
ListaTags = GetDatosTagsDocumentos()
|
||||
|
||||
ListaTags.Add(New TagsDocumentos("{NombreEmpleado}", NombreEmpleado))
|
||||
ListaTags.Add(New TagsDocumentos("{Codigo}", Codigo))
|
||||
ListaTags.Add(New TagsDocumentos("{Departamento}", Departamento))
|
||||
ListaTags.Add(New TagsDocumentos("{JefeInmediato}", JefeInmediato))
|
||||
ListaTags.Add(New TagsDocumentos("{FechaInicio}", FechaInicio))
|
||||
ListaTags.Add(New TagsDocumentos("{FechaFin}", FechaFin))
|
||||
ListaTags.Add(New TagsDocumentos("{diasPermiso}", diasPermiso))
|
||||
ListaTags.Add(New TagsDocumentos("{HorasPermiso}", HorasPermiso))
|
||||
ListaTags.Add(New TagsDocumentos("{MotivoPermiso}", MotivoPermiso))
|
||||
|
||||
objGemDocument.SustituirTags(ListaTags)
|
||||
|
||||
'objGemDocument.GuardarStream()
|
||||
objGemDocument.GuardarStreamPDF()
|
||||
Dim bytesInStream As Byte() = objGemDocument.GetBytesDocumento()
|
||||
'Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray
|
||||
objGemDocument.Dispose()
|
||||
|
||||
Response.Clear()
|
||||
Response.ContentType = "application/force-download"
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicituddepermiso_" & Now.ToString("yyyyMMddhhmmss") & ".pdf")
|
||||
Response.BinaryWrite(bytesInStream)
|
||||
Response.End()
|
||||
Else
|
||||
Alert("No se encontro el Formato, favor de revisarlo con soporte tecnico.", TipoMensaje.MsgAdvertencia)
|
||||
Alert("No se encontro el formato de Permisos", TipoMensaje.ToastAdventencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -31,6 +31,16 @@
|
||||
Reporte Indice Rotación de Personal
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnImprimir" OnClick="BtnImprimir_Click" data-toggle="tooltip" data-placement="left" title="Agregar un Defecto" Text="<i class='fa fa-file-pdf-o'></i>Imprimir"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnImprimir" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -3,10 +3,24 @@ Option Explicit On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Ventas_RepIndiceRotacionPersonal
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DTGvDatos As DataTable
|
||||
Get
|
||||
If ViewState("DTGvDatos") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTGvDatos"), DataTable)
|
||||
End If
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTGvDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub Ventas_RepIndiceRotacionPersonal_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
txtInicio.Text = Date.Now.AddDays(-30).ToString("dd/MM/yyyy")
|
||||
@@ -84,7 +98,7 @@ Partial Class Ventas_RepIndiceRotacionPersonal
|
||||
If rh.GetReporteRotacionPersonal(FechaInicio, FechaFin, CveTurno, CveProyecto, CveSubproyecto, UsuarioActual.Empresa.CveEmpresa) Then
|
||||
dTable = rh.DtResultados
|
||||
End If
|
||||
|
||||
DTGvDatos = dTable
|
||||
GVRegDatos.DataSource = dTable
|
||||
GVRegDatos.DataBind()
|
||||
|
||||
@@ -138,4 +152,29 @@ Partial Class Ventas_RepIndiceRotacionPersonal
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs)
|
||||
'"Empresas/Grales/Formatos/ClienteHistorial.rdlc"
|
||||
If GVRegDatos.Rows.Count > 0 Then
|
||||
|
||||
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 params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("FechaInicial", txtInicio.Text))
|
||||
params.Add(New ReportParameter("FechaFinal", txtFin.Text))
|
||||
params.Add(New ReportParameter("FechaRealizado", Date.Now().ToString()))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepIndiceRotacionPersonal.rdlc", DTGvDatos, params, "Reporte de Historial", "PDF")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -124,7 +124,8 @@
|
||||
<asp:BoundField runat="server" DataField="Cantidad" HeaderText="Cantidad" DataFormatString="{0:###,###}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField runat="server" DataField="Departamento" HeaderText="Departamento" />
|
||||
<asp:BoundField runat="server" DataField="SubProyecto" HeaderText="Sucursal" />
|
||||
|
||||
<asp:BoundField runat="server" DataField="Precio" DataFormatString="${0:N2}" HeaderText="Total" />
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
198
Ventas/CatCobranzaEstatus.aspx
Normal file
198
Ventas/CatCobranzaEstatus.aspx
Normal file
@@ -0,0 +1,198 @@
|
||||
<%@ Page Title="RH - Catálogo de Documentos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatCobranzaEstatus.aspx.vb" Inherits="Vta_CatCobranzaEstatus" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo Cobranza Estatus
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UPAcciones" runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="BtnAgregarEstatus" runat="server" data-toggle="tooltip" data-placement="left" title="Agregar Estado de Cobranza" Text="<i class='fa fa-plus'></i> Agregar Estatus"></asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="BtnAgregarEstatusTurno" runat="server" data-toggle="tooltip" data-placement="left" title="Agregar Estado de Cobranza" Text="<i class='fa fa-plus'></i> Agregar Turno"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<ajax:TabContainer runat="server" ActiveTabIndex="0" Width="100%" CssClass="tabBodyOverride">
|
||||
<ajax:TabPanel runat="server" ID="TabCatalogo" HeaderText="Estatus">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCobranzaEstatus,CobranzaEstatus,Estatus,FechaIng" EmptyDataText="No se encontraron estatus de cobranza" ToolTip="Listado de Motivo de Baja" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="CobranzaEstatus" HeaderText="Estatus cobranza" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Estatus" HeaderText="Estado" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="Edit_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel runat="server" ID="TabPanel1" HeaderText="Estatus Turno">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpDatosTurno" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatosTurno" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCobranzaEstatusTurno,CobranzaEstatusTurno,Estatus,FechaIng" EmptyDataText="No se encontraron estatus de cobranza" ToolTip="Listado de Motivo de Baja" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="CobranzaEstatusTurno" HeaderText="Estatus cobranza turno" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Estatus" HeaderText="Estado" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgETurno" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="EditTurno_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgDTurno" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
</ajax:TabContainer>
|
||||
|
||||
<div id="divAddEstatusCobranza" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddEstatus" class="modal-content" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Estados de Cobranza</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEstatusCobranza" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVEstatusCobranza" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEstatusCobranza" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtEstatusCobranza.ClientID.ToString()%>">Estatus de Cobranza:</label>
|
||||
</div>
|
||||
<br />
|
||||
<div id="CheckActiveSection" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label for="ChkEstatus">Estado:</label>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="make-switchsd" data-size="small" Text=" " Checked="true" />
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnAgregarEstatusCobranza" runat="server" class="btn btn-success" Text="Agregar" />
|
||||
<%--<asp:LinkButton ID="BtnAgregarEstatusOS" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>--%>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="divAddEstatusCobranzaTurno" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddEstatusTurno" class="modal-content" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabelTurno">Estados de turno de cobranza</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEstatusCobranzaTurno" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVEstatusCobranzaTurno" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEstatusCobranzaTurno" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtEstatusCobranzaTurno.ClientID.ToString()%>">Estatus de Cobranza:</label>
|
||||
</div>
|
||||
<br/>
|
||||
<div id="Div1" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label for="ChkEstatusTurno">Estado:</label>
|
||||
<asp:CheckBox ID="ChkEstatusTurno" runat="server" CssClass="make-switchsd" data-size="small" Text=" " Checked="true" />
|
||||
<i></i>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooterTurno" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnAgregarEstatusCobranzaTurno" runat="server" class="btn btn-success" Text="Agregar" />
|
||||
<%--<asp:LinkButton ID="BtnAgregarEstatusOS" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>--%>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
|
||||
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
function ShowDivRegistro() {
|
||||
$('#divAddImpuestoLocal').modal();
|
||||
}
|
||||
|
||||
function OrdenarGV() {
|
||||
var Tam = TamañoVentana();
|
||||
var Alto = Tam.height - 270;
|
||||
if (Alto < 100) {
|
||||
Alto = 100;
|
||||
}
|
||||
$('#C_GvDatos').DataTable({
|
||||
scrollY: Alto + 'px',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
searching: false,
|
||||
info: false
|
||||
});
|
||||
$('#C_GvDatos').parent().parent().children().first().css("position", "static");
|
||||
}
|
||||
|
||||
|
||||
function SetObjects(Clasificacion) {
|
||||
debugger;
|
||||
document.getElementById(TxtEstatusOS).value = Clasificacion;
|
||||
}
|
||||
|
||||
function SetValue(Hidden, Value) {
|
||||
document.getElementById(Hidden).value = Value;
|
||||
}
|
||||
|
||||
function LimpiaModal() {
|
||||
<%--$('#<%= TxtEstatusOS.ClientID %>').val('');
|
||||
$('#<%= ChkEstatus.ClientID %>').prop("checked", false);--%>
|
||||
|
||||
var $example = $(".js-Impuesto-programmatic").select2();
|
||||
$example.val('1').trigger("change");
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
162
Ventas/CatCobranzaEstatus.aspx.vb
Normal file
162
Ventas/CatCobranzaEstatus.aspx.vb
Normal file
@@ -0,0 +1,162 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Vta_CatCobranzaEstatus
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property CveCobranzaEstatus As Integer
|
||||
Get
|
||||
Return ViewState("CveCobranzaEstatus").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCobranzaEstatus") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveCobranzaEstatusTurno As Integer
|
||||
Get
|
||||
Return ViewState("CveCobranzaEstatusTurno").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCobranzaEstatusTurno") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Sub page_load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDatos()
|
||||
CargaDatosTurno()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetCobranzaEstatus(UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Public Sub BtnAgregarEstatus_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatus.Click
|
||||
TxtEstatusCobranza.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
BtnAgregarEstatusCobranza.Text = "Agregar"
|
||||
UpAddEstatus.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAddEstatusCobranza"))
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
CveCobranzaEstatus = GvRow.DataKey("CveCobranzaEstatus").ToEntero
|
||||
TxtEstatusCobranza.Text = GvRow.DataKey("CobranzaEstatus").ToString
|
||||
ChkEstatus.Checked = GvRow.DataKey("Estatus")
|
||||
BtnAgregarEstatusCobranza.Text = "Actualizar"
|
||||
UpAddEstatus.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAddEstatusCobranza"))
|
||||
End Sub
|
||||
|
||||
Public Sub BtnAgregarEstatusCobranza_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatusCobranza.Click
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If BtnAgregarEstatusCobranza.Text = "Agregar" Then
|
||||
If ObjVentas.AddCobranzaEstatus(TxtEstatusCobranza.Text, UsuarioActual.CveEmpresa, ChkEstatus.Checked, UsuarioActual.CveUsuario) Then
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddEstatusCobranza"))
|
||||
Alert("Estatus agregado con exito")
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
Else
|
||||
Alert("Error al agregar")
|
||||
End If
|
||||
Else
|
||||
If ObjVentas.UpdateCobranzaEstatus(CveCobranzaEstatus, TxtEstatusCobranza.Text, ChkEstatus.Checked) Then
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddEstatusCobranza"))
|
||||
Alert("Estatus agregado con exito")
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
Else
|
||||
Alert("Error al actualizar")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim CveEstatusOrdenServicio As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveCobranzaEstatus").ToEntero
|
||||
|
||||
If ObjVentas.RemoveCobranzaEstatus(CveEstatusOrdenServicio) Then
|
||||
GvDatos.EditIndex = -1
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
Alert("Estatus de cobranza eliminado")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatosTurno()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetCobranzaTurnoEstatus(-1, UsuarioActual.CveEmpresa) Then
|
||||
GvDatosTurno.DataSource = ObjVentas.DtResultados
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
GvDatosTurno.DataBind()
|
||||
End Sub
|
||||
|
||||
Public Sub BtnAgregarEstatusTurno_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatusTurno.Click
|
||||
TxtEstatusCobranzaTurno.Text = ""
|
||||
ChkEstatusTurno.Checked = True
|
||||
BtnAgregarEstatusCobranzaTurno.Text = "Agregar"
|
||||
UpAddEstatusTurno.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAddEstatusCobranzaTurno"))
|
||||
End Sub
|
||||
|
||||
Public Sub EditTurno_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
CveCobranzaEstatusTurno = GvRow.DataKey("CveCobranzaEstatusTurno").ToEntero
|
||||
TxtEstatusCobranzaTurno.Text = GvRow.DataKey("CobranzaEstatusTurno").ToString
|
||||
ChkEstatusTurno.Checked = GvRow.DataKey("Estatus")
|
||||
BtnAgregarEstatusCobranzaTurno.Text = "Actualizar"
|
||||
UpAddEstatusTurno.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAddEstatusCobranzaTurno"))
|
||||
End Sub
|
||||
|
||||
Public Sub BtnAgregarEstatusCobranzaTurno_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatusCobranzaTurno.Click
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If BtnAgregarEstatusCobranzaTurno.Text = "Agregar" Then
|
||||
If ObjVentas.AddCobranzaEstatusTurno(TxtEstatusCobranzaTurno.Text, UsuarioActual.CveEmpresa, ChkEstatusTurno.Checked, UsuarioActual.CveUsuario) Then
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddEstatusCobranzaTurno"))
|
||||
Alert("Estatus agregado con exito")
|
||||
CargaDatosTurno()
|
||||
UpDatosTurno.Update()
|
||||
Else
|
||||
Alert("Error al agregar")
|
||||
End If
|
||||
Else
|
||||
If ObjVentas.UpdateCobranzaEstatusTurno(CveCobranzaEstatusTurno, TxtEstatusCobranzaTurno.Text, ChkEstatusTurno.Checked) Then
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddEstatusCobranzaTurno"))
|
||||
Alert("Estatus agregado con exito")
|
||||
CargaDatosTurno()
|
||||
UpDatosTurno.Update()
|
||||
Else
|
||||
Alert("Error al actualizar")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosTurno_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosTurno.RowDeleting
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim CveEstatusOrdenServicio As Integer = GvDatosTurno.Rows(e.RowIndex).DataKey("CveCobranzaEstatusTurno").ToEntero
|
||||
|
||||
If ObjVentas.RemoveCobranzaEstatusTurno(CveEstatusOrdenServicio) Then
|
||||
GvDatosTurno.EditIndex = -1
|
||||
CargaDatosTurno()
|
||||
UpDatosTurno.Update()
|
||||
Alert("Turno de estatus de cobranza eliminado")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -3902,7 +3902,7 @@ Partial Class Clientes
|
||||
End If
|
||||
|
||||
Try
|
||||
Dim Cuerpo As String = String.Format("Estimado cliente {0}, al presente se correo se anexa su estado actual de cartera en {1}.<br />
|
||||
Dim Cuerpo As String = String.Format("Estimado cliente {0}, al presente del correo se anexa su estado actual de cartera en {1}.<br />
|
||||
<br />
|
||||
Quedamos a sus ordenes para cualquier duda o aclaración con su agente de Ventas.<br />
|
||||
<br />
|
||||
@@ -3910,7 +3910,7 @@ Partial Class Clientes
|
||||
Gracias por la atención brindada al presente.<br /> Reciba un cordial saludo.<br />
|
||||
<br />
|
||||
<b>ESTE CORREO SE GENERO EN FORMA AUTOMATICA.</b>", TxtNombreComercial.Text, UsuarioActual.Empresa.Empresa)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaCorreo2(File, TxtCobranzaCorreo.Text, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo))
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaCorreoEstadoCuenta(File, TxtCobranzaCorreo.Text, $"Estado Actual de Cartera {UsuarioActual.Empresa.Empresa}", Cuerpo, GuardarBitacora:=True))
|
||||
Hilo.Start()
|
||||
Alert("El correo se envió con éxito", TipoMensaje.MsgInformacion)
|
||||
Catch ex As Exception
|
||||
@@ -3977,7 +3977,7 @@ Partial Class Clientes
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub MandaCorreo2(File As Byte(), Para As String, Asunto As String, Body As String)
|
||||
Private Sub MandaCorreoEstadoCuenta(File As Byte(), Para As String, Asunto As String, Body As String, Optional GuardarBitacora As Boolean = False)
|
||||
|
||||
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
|
||||
'a.GuardaLog()
|
||||
@@ -3986,11 +3986,17 @@ Partial Class Clientes
|
||||
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
||||
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"})
|
||||
|
||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
|
||||
Dim Envio As Boolean = Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
|
||||
|
||||
If Envio AndAlso GuardarBitacora Then
|
||||
Using ObjBitacora As New ClsOIEventos
|
||||
ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=Me.CveCliente)
|
||||
End Using
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "E N V I O C O R R E O"
|
||||
Private Sub EnviaCorreo(Liga As String, LigaActivar As String)
|
||||
|
||||
@@ -5731,7 +5737,8 @@ Partial Class Clientes
|
||||
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
|
||||
a.GuardaLog()
|
||||
Dim Mail As New ClsSisMail()
|
||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
|
||||
Dim Envio As Boolean = Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
|
||||
|
||||
End Sub
|
||||
Protected Sub BtnCobranzaSMS_Click(sender As Object, e As EventArgs)
|
||||
Dim Telefono = CobranzaTelefono
|
||||
|
||||
@@ -2840,7 +2840,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlFolioGarantia" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="FolioGarantia" DataValueField="CveFolioGarantia" Width="100%">
|
||||
<asp:DropDownList ID="DdlFolioGarantia" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="FolioGarantia" DataValueField="CveFolioGarantia" Width="100%" AutoPostBack="true">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVFolioGarantia" runat="server" ControlToValidate="DdlFolioGarantia" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFolioGarantia" runat="server" HighlightCssClass="vco" TargetControlID="RFVFolioGarantia"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
@@ -5427,6 +5427,16 @@ Partial Class PV
|
||||
RegistraScript("Recalcula();", "Recalcula")
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlFolioGarantia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFolioGarantia.SelectedIndexChanged
|
||||
Dim ObjAcumuladores As New ClsAcumuladores
|
||||
If ObjAcumuladores.GetNuevoConsecutivoFolio(DdlFolioGarantia.SelectedValue.ToEntero) Then
|
||||
Dim resultado As String = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo")
|
||||
TxtConsecutivoAjuste.Text = resultado
|
||||
UpAjuste.Update()
|
||||
End If
|
||||
ObjAcumuladores.Dispose()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "U S A D O S"
|
||||
|
||||
@@ -9,6 +9,7 @@ Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Security.Cryptography.X509Certificates
|
||||
Imports System.Globalization
|
||||
Imports System.Net.Http
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Partial Class Ventas
|
||||
Inherits ClsPaginas
|
||||
@@ -5330,6 +5331,11 @@ Partial Class Ventas
|
||||
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString)
|
||||
End If
|
||||
|
||||
'SI LA VENTA YA ESTA REGISTRADA NO DEBE HABILITAR ACCIONES
|
||||
If CveVenta <= 0 Then
|
||||
LnkRemisiones.Visible = If(UsuarioActual.TienePermisoProceso(199), True, False) : LnkOCs.Visible = True : LnkCotizaciones.Visible = True : LnkPedido2SinFacturar.Visible = True : InicializaAplicarNCMasiva()
|
||||
End If
|
||||
|
||||
UPPVentas.Update()
|
||||
UpEstatus.Update()
|
||||
UPCondicionesPago.Update()
|
||||
@@ -5733,7 +5739,6 @@ Partial Class Ventas
|
||||
|
||||
If Not UsuarioActual.TienePermisoProceso(169) Then ' NO VALIDA EXISTENCIAS NI COSTO - PERMISO PARA NO VALIDAR
|
||||
Dim CvePS As Integer = DatarowPS("CvePS").ToString.ToEntero
|
||||
Dim CveTipoPS As Integer = DatarowPS("CveTipoPS").ToString.ToEntero
|
||||
|
||||
CantidadInventario = GvPS.Rows(e.RowIndex).DataKey("CantidadInventario").ToString.ToDecimal
|
||||
|
||||
@@ -5743,7 +5748,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'SOLO VALIDA EXISTENCIAS Y COSTO: SI USA INVENTARIOS, SOLO PRODUCTOS TIPO PRODUCTO, SOLO REMISIONES E INGRESOS
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso CveTipoPS = 2 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") Or (DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119))) Then
|
||||
If UsuarioActual.Empresa.UsaInventarios AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") Or (DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119))) Then
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim Existencia As Decimal
|
||||
If ValidaExistencia Then
|
||||
@@ -10646,7 +10651,7 @@ Partial Class Ventas
|
||||
If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
|
||||
|
||||
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero
|
||||
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E8")
|
||||
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E")
|
||||
|
||||
If CveMovimientoInventario <= 0 Then
|
||||
OcurrioError = True
|
||||
@@ -12655,8 +12660,8 @@ Partial Class Ventas
|
||||
Dim Fecha As Date = Now
|
||||
|
||||
'Creamos el movimiento de entrada y el movimiento de salida
|
||||
Dim CveMovimientoInventarioEntrada As Integer = ObjInventario.AddMovimiento(CveAlmacen, 18, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveDevolucion, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E1")
|
||||
Dim CveMovimientoInventarioSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaNueva, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E2")
|
||||
Dim CveMovimientoInventarioEntrada As Integer = ObjInventario.AddMovimiento(CveAlmacen, 18, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveDevolucion, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E")
|
||||
Dim CveMovimientoInventarioSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, CveMoneda, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaNueva, -1, -1, MovimientoFijo:=True, Modulo:="Vta/E")
|
||||
|
||||
If CveMovimientoInventarioEntrada > 0 AndAlso CveMovimientoInventarioSalida > 0 Then
|
||||
|
||||
@@ -15308,7 +15313,6 @@ Partial Class Ventas
|
||||
If UsuarioActual.Empresa.Funcionalidad(575) = "1" Then
|
||||
'Le damos salida normal
|
||||
If ConSalida Then
|
||||
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 40, CveMoneda, CveRemision, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
@@ -15318,14 +15322,9 @@ Partial Class Ventas
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacenVirtual(ObjInventario, ObjFactura) > 0
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
'Le damos salida de apartado por traspaso
|
||||
@@ -15350,12 +15349,7 @@ Partial Class Ventas
|
||||
If ConSalida AndAlso Not OcurrioError Then
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacenVirtual(ObjInventario, ObjFactura) > 0
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
|
||||
End If
|
||||
|
||||
If Not OcurrioError Then
|
||||
@@ -15487,7 +15481,7 @@ Partial Class Ventas
|
||||
|
||||
'Creamos el movimiento
|
||||
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, ConceptoEntrada, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
|
||||
CveMovimientoRelacionado:=CveMovimientoRelacionado, Modulo:="Vta/E3")
|
||||
CveMovimientoRelacionado:=CveMovimientoRelacionado, Modulo:="Vta/E")
|
||||
|
||||
If CveMovimientoInventario > 0 Then
|
||||
|
||||
@@ -15611,119 +15605,61 @@ Partial Class Ventas
|
||||
'Return Not OcurrioError
|
||||
|
||||
End Function
|
||||
Private Function GenerarMovimientoAlmacenVirtual(ByRef ObjInventario As ClsInventarios, ObjFactura As Modelos.Factura) As Integer
|
||||
Private Function GenerarMovimientoAlmacenVirtual(CveRemision As Integer, ByRef ObjInventario As ClsInventarios, ObjFactura As Modelos.Factura) As Boolean
|
||||
Dim OcurrioError As Boolean = False
|
||||
Dim CveMovimientoVirtual As Integer = -1
|
||||
|
||||
Dim DtPSVirtual As New DataTable("DtTamanios")
|
||||
DtPSVirtual.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
|
||||
DtPSVirtual.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
|
||||
DtPSVirtual.Columns.Add(New DataColumn("PU", GetType(Decimal)))
|
||||
DtPSVirtual.Columns.Add(New DataColumn("CveUM", GetType(Integer)))
|
||||
Try
|
||||
Dim CveMovimientoVirtual As Integer = -1
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
Dim CveConceptoMovimientoVirtual As Integer = 3
|
||||
Dim DtPSVirtual As DataTable = Nothing
|
||||
Dim DtTamanios As DataTable = Nothing
|
||||
Dim CveMovimientoEntradaDev As Integer = -1
|
||||
|
||||
Dim DtTamanios As DataTable = Nothing
|
||||
Dim ObjAcumuladores As New ClsAcumuladores
|
||||
If ObjAcumuladores.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
|
||||
DtTamanios = ObjAcumuladores.DtResultados.Copy()
|
||||
End If
|
||||
ObjAcumuladores.Dispose()
|
||||
If ObjInventario.GetInv_Mov(CveRemision, UsuarioActual.CveEmpresa) Then
|
||||
Dim RowMovimiento As DataRow = ObjInventario.DtResultados.FiltroPrimero("CvePS IS NULL AND CveTipoAlmacen = 24 AND CveConcepto = 2 AND CveVenta > 0")
|
||||
|
||||
Dim CveConceptoMovimientoVirtual As Integer = 3
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
|
||||
For Each GvRow As DataRow In ObjFactura.DtDetalle.Rows
|
||||
For Each Tam As DataRow In DtTamanios.Rows
|
||||
If Tam("CveTamaño").ToString() = GvRow("CveTamaño").ToString() Then
|
||||
Dim CvePSCargo = Tam("CvePSCargo").ToString().ToEntero()
|
||||
Dim Row As DataRow = DtPSVirtual.NewRow()
|
||||
|
||||
Row("CvePS") = CvePSCargo
|
||||
Row("Cantidad") = GvRow("Cantidad").ToString().ToDecimal()
|
||||
Row("PU") = 0
|
||||
Row("CveUM") = GvRow("CveUM").ToString().ToEntero()
|
||||
|
||||
DtPSVirtual.Rows.Add(Row)
|
||||
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
CveAlmacenVirtual = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={ObjFactura.CveSubProyecto}").ToEntero()
|
||||
|
||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 Then
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/E4")
|
||||
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
CveMovimientoEntradaDev = RowMovimiento("CveMovimiento").ToString().ToEntero()
|
||||
CveAlmacenVirtual = RowMovimiento("CveAlmacen").ToString().ToEntero()
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
Else
|
||||
'CARGA CONCEPTOS DEVUELTOS EN LA VENTA
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntradaDev, UsuarioActual.CveEmpresa) Then
|
||||
DtPSVirtual = ObjInventario.DtResultados.Copy()
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
If Not OcurrioError AndAlso DtPSVirtual.Rows.Count > 0 Then
|
||||
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/V")
|
||||
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar el almacen virtual.", ex)
|
||||
OcurrioError = True
|
||||
End If
|
||||
End Try
|
||||
|
||||
If DtPSVirtual.Rows.Count = 0 Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
'Dim ContadorMovtosDetalles = 0
|
||||
|
||||
'Dim DtMovDetalle As DataTable = Nothing
|
||||
'If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
' DtMovDetalle = ObjInventario.DtResultados.Copy()
|
||||
'End If
|
||||
|
||||
''Creamos el movimiento
|
||||
'Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, 2, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||
|
||||
'If CveMovimientoInventario > 0 Then
|
||||
|
||||
' 'Agregamos los detalles
|
||||
' For Each MovDet As DataRow In DtMovDetalle.Rows
|
||||
' Dim Cantidad = MovDet("Cantidad").ToString.ToDecimal
|
||||
' Dim CveUnidad As Integer = MovDet("CveUM").ToString.ToEntero
|
||||
' Dim PU As Decimal = MovDet("PU").ToString.ToDecimal
|
||||
' Dim CveProducto As Integer = MovDet("CvePS").ToString.ToEntero
|
||||
' Dim SerieLote As String = MovDet("SerieLote").ToString
|
||||
|
||||
' If Cantidad < 0 Then
|
||||
' Alert("Ocurrió un Error al generar los movimientos de almacén. Por favor comuniquese con atención SIG.", TipoMensaje.MsgError)
|
||||
' OcurrioError = True
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=SerieLote) Then
|
||||
' ContadorMovtosDetalles += 1
|
||||
' Else
|
||||
' OcurrioError = True
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' 'VALIDA QUE SE HALLAN AGREGADO DETALLES AL MOVIMIENTO
|
||||
' If ContadorMovtosDetalles = 0 Then
|
||||
' OcurrioError = True
|
||||
' End If
|
||||
|
||||
'Else
|
||||
' OcurrioError = True
|
||||
'End If
|
||||
|
||||
If OcurrioError Then
|
||||
Return -1
|
||||
Else
|
||||
Return CveMovimientoVirtual
|
||||
End If
|
||||
Return Not OcurrioError
|
||||
|
||||
End Function
|
||||
Private Function SalidaAlmacenMateriales(ByRef ObjInventario As ClsInventarios, CveOS As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean
|
||||
@@ -19470,7 +19406,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
'MOVIMIENTO DE SALIDA POR TRASPASO DEL ALMACEN DE CONSIGNACION
|
||||
CveMovimientoSalidaConsignacion = ObjInventario.AddMovimiento(CveAlmacenExistenciasContrato, 8, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E5")
|
||||
CveMovimientoSalidaConsignacion = ObjInventario.AddMovimiento(CveAlmacenExistenciasContrato, 8, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E")
|
||||
If CveMovimientoSalidaConsignacion > 0 Then
|
||||
Dim CveProducto As Integer
|
||||
Dim CveUnidad As Integer
|
||||
@@ -19513,7 +19449,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
'ENTRADA POR TRASPASO A GENERAL
|
||||
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 9, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalidaConsignacion, Modulo:="Vta/E6")
|
||||
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 9, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalidaConsignacion, Modulo:="Vta/E")
|
||||
If CveMovimientoEntradaGeneral > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
@@ -19527,7 +19463,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'SALIDA GENERAL
|
||||
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E7")
|
||||
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E")
|
||||
If CveMovimientoEntradaGeneral > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
@@ -23809,49 +23745,65 @@ Partial Class Ventas
|
||||
CargaRNC()
|
||||
RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });")
|
||||
End Sub
|
||||
Protected Function GeneraPolizaVentaWS(ObjFactura As Modelos.Factura) As Boolean
|
||||
Dim obj As New Modelos.MPolizaVentaWS
|
||||
'DATOS DEL CLIENTE
|
||||
obj.customer_name = ObjFactura.Cliente.Nombre
|
||||
obj.customer_last_name1 = ""
|
||||
obj.customer_last_name2 = ""
|
||||
obj.customer_birthday = Nothing
|
||||
obj.customer_phone = ObjFactura.Cliente.Telefono
|
||||
obj.customer_email = ObjFactura.Cliente.Mail
|
||||
obj.customer_gender = "03" 'OTRO GENERO
|
||||
obj.customer_advertising = False
|
||||
obj.customer_car_brand = "00"
|
||||
obj.customer_car_model = "00"
|
||||
obj.customer_car_year = ObjFactura.Fecha.Year
|
||||
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
|
||||
Dim DtUsados As DataTable = Nothing
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.GetGarantiasDetalle(ObjFactura.CveVenta) Then
|
||||
DtUsados = ObjAcum.DtResultados.Copy()
|
||||
End If
|
||||
ObjAcum.Dispose()
|
||||
Try
|
||||
For Each Row As DataRow In DtUsados.Rows
|
||||
Dim obj As New Modelos.MPolizaVentaWS
|
||||
'DATOS DEL CLIENTE
|
||||
obj.customer_name = ObjFactura.Cliente.Nombre
|
||||
obj.customer_last_name1 = ""
|
||||
obj.customer_last_name2 = ""
|
||||
obj.customer_birthday = Nothing
|
||||
obj.customer_phone = ObjFactura.Cliente.Telefono
|
||||
obj.customer_email = ObjFactura.Cliente.Mail
|
||||
obj.customer_gender = "03" 'OTRO GENERO
|
||||
obj.customer_advertising = False
|
||||
obj.customer_car_brand = "00"
|
||||
obj.customer_car_model = "00"
|
||||
obj.customer_car_year = ObjFactura.Fecha.Year
|
||||
|
||||
'DATOS DE VENTA
|
||||
obj.sale_date = Now
|
||||
obj.sale_paidby = "01"
|
||||
obj.sale_type = "01" 'PISO
|
||||
obj.sale_type_service = "01" 'PARTICULAR
|
||||
obj.sale_total = ObjFactura.Total
|
||||
obj.sale_discount = ObjFactura.SubTotal
|
||||
obj.sale_id = ObjFactura.CveVenta.ToString()
|
||||
'DATOS DE VENTA
|
||||
obj.sale_date = ObjFactura.Fecha
|
||||
obj.sale_paidby = "01"
|
||||
obj.sale_type = "01" 'PISO
|
||||
obj.sale_type_service = "02" 'COMERCIAL
|
||||
obj.sale_total = ObjFactura.Total
|
||||
obj.sale_discount = ObjFactura.Descuento
|
||||
obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
|
||||
|
||||
'DATOS DEL PRODUCTO
|
||||
obj.product_code = "174925"
|
||||
obj.product_unique_code = "65047187"
|
||||
obj.product_sale_type = "02" 'AJUSTE
|
||||
'DATOS DEL PRODUCTO
|
||||
obj.product_code = Row("Code17").ToString()
|
||||
obj.product_unique_code = "" 'se indique el código único de la batería.
|
||||
obj.product_sale_type = "01 " 'VENTA
|
||||
|
||||
'DATOS DE USADO
|
||||
obj.used_product = True
|
||||
obj.used_brand = "01"
|
||||
obj.used_bci = "25"
|
||||
obj.used_month = 1
|
||||
obj.used_year = 2015
|
||||
obj.used_sale_date = ObjFactura.Fecha
|
||||
Dim FechaUsado As DateTime = Row("FechaAjuste").ToString().ToDateTime()
|
||||
|
||||
Return False
|
||||
'EnviarPolizaVentaWS(obj)
|
||||
End Function
|
||||
'DATOS DE USADO
|
||||
obj.used_product = True
|
||||
obj.used_brand = Row("IdModelo").ToString() 'MARCAR DEL USADO
|
||||
obj.used_bci = Row("CveBCIUsado").ToString() 'VALOR DEL BCI
|
||||
obj.used_month = FechaUsado.Month
|
||||
obj.used_year = FechaUsado.Year
|
||||
obj.used_sale_date = FechaUsado
|
||||
|
||||
Protected Sub EnviarPolizaVentaWS(obj As Modelos.MPolizaVentaWS)
|
||||
Dim Retorno As String = "[]"
|
||||
EnviarPolizaVentaWS(obj)
|
||||
Next
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al generar la poliza virtual", ex)
|
||||
End Try
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Function EnviarPolizaVentaWS(obj As Modelos.MPolizaVentaWS) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim Respuesta As String = "[]"
|
||||
|
||||
Dim User As String = "cslth.2809@jcilink.com"
|
||||
Dim Password As String = "ff31580a95f36b51ad27f970428b77a5a9245076"
|
||||
@@ -23895,14 +23847,30 @@ Partial Class Ventas
|
||||
Dim content As New FormUrlEncodedContent(Parametros)
|
||||
Dim response = wc.PostAsync(Url, content).Result
|
||||
|
||||
Retorno = response.Content.ReadAsStringAsync().Result
|
||||
Respuesta = response.Content.ReadAsStringAsync().Result
|
||||
|
||||
Dim resp = JArray.Parse(Respuesta)
|
||||
|
||||
If resp.Count > 0 Then
|
||||
Dim Msg = resp(0)("Descripcion").ToString()
|
||||
|
||||
If resp(0)("Codigo").ToString().Contiene("500", "501", "502", "503", "504", "505", "506", "507", "508") Then
|
||||
Alert(Msg, TipoMensaje.MsgInformacion)
|
||||
Retorno = True
|
||||
Else
|
||||
Alert(Msg, TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Else
|
||||
Alert("No se envió la poliza virtual", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Using
|
||||
|
||||
Catch ex As Exception
|
||||
ex.GuardaLog(ex.Message)
|
||||
End Try
|
||||
|
||||
|
||||
End Sub
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user