From 71159a162b76981cd2daa68be7d090ab4a6a3a0b Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 6 Nov 2019 09:22:45 -0700 Subject: [PATCH 01/24] Pagos para FyE,IVA al generar OC,poliza virtual,etc --- Ashx/SIGPolizaVirtual.ashx | 544 +++++++++++++++++++----- Bancos/RepEgresosSinComprobante.aspx | 18 +- Bancos/RepEgresosSinComprobante.aspx.vb | 198 +++++++-- CxC/RepCxCDetalle.aspx.vb | 7 +- OC/OC.aspx.vb | 23 +- Ventas/PV.aspx.vb | 9 +- Ventas/RepComisionesJAM.aspx | 2 +- 7 files changed, 642 insertions(+), 159 deletions(-) diff --git a/Ashx/SIGPolizaVirtual.ashx b/Ashx/SIGPolizaVirtual.ashx index e7f2621e1..6ba9db938 100644 --- a/Ashx/SIGPolizaVirtual.ashx +++ b/Ashx/SIGPolizaVirtual.ashx @@ -1,5 +1,6 @@ <%@ WebHandler Language="VB" Class="SIGPolizaVirtual" %> +Imports Fluent Imports System Imports System.Web Imports System.Net.Http @@ -9,61 +10,187 @@ Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq Imports Extensiones Imports System.IO +Imports System.Runtime.CompilerServices Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState Protected ReadOnly Property User As String = "cslth.2809@jcilink.com" Protected ReadOnly Property Password As String = "ff31580a95f36b51ad27f970428b77a5a9245076" +#Region "U S U A R I O - T O K E N" + + Private Function ValidaUsuarioSistema(CveEmpresa As Integer, Optional CveUsuario As Integer = 100) As Usuario + + Dim UsuarioToken As Usuario = Nothing + Dim ObjUsuarios As New ClsSisUsuarios + If ObjUsuarios.GetUsuarios(CveUsuario) 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() + UsuarioToken = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, IMEI, CveEmpresa) + UsuarioToken.CveEmpresa = CveEmpresa + CreaObjetoEmpresa(UsuarioToken) + End If + End If + ObjUsuarios.Dispose() + Return UsuarioToken + End Function + Private Sub CreaObjetoEmpresa(ByRef UsuarioToken As Usuario) + + Dim ObjEmpresa As New ClsSisEmpresas() + If ObjEmpresa.GetEmpresas(UsuarioToken.CveEmpresa, "-1", "-1", "-1", "-1") Then + If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioToken.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 + + UsuarioToken.Empresa = ObjEmpresa.Empresa + End If + ObjEmpresa.Dispose() + End Sub +#End Region + Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest context.Response.ContentType = "application/json" - EnviarPolizaVentaWS(context) - EnviarPolizaVentaLTHWSD(context) - EnviarPolizaIndicadores(context) + Dim usuario = ValidaUsuarioSistema(140, 100) + Dim ObjFactura As New Modelos.Factura(usuario, 898028, 140) + + GeneraPolizaVentaWS(context, ObjFactura) + 'GeneraPolizaVentaLTHWSD(context) + 'GeneraIndicadores(context) End Sub + Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return False End Get End Property - Private Sub EnviarPolizaVentaLTHWSD(ByVal context As HttpContext) + Protected Sub GeneraPolizaVentaWS(ByVal context As HttpContext, ObjFactura As Modelos.Factura) + Dim obj As New 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 = GuidGenerator.GenerateTimeBasedGuid().ToString() + + 'Dim PS = ObjFactura.DtDetalle.Rows(0) + 'DATOS DEL PRODUCTO + obj.product_code = "174925" + obj.product_unique_code = "65047187" + obj.product_sale_type = "02" 'AJUSTE + + '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 + + EnviarPolizaVentaWS(context, obj) + End Sub + + Protected Sub GeneraPolizaVentaLTHWSD(ByVal context As HttpContext, ObjFactura As Modelos.Factura) + Dim obj As New MPolizaVentaLTHWSD + 'DATOS DEL CLIENTE + obj.customer_name = "JOSE ENRIQUE" + obj.customer_last_name1 = "VIZCARA" + obj.customer_last_name2 = "RENDON" + obj.customer_birthday = Now + obj.customer_phone = "8186545256" + obj.customer_email = "mail@mail.com" + obj.customer_gender = "02" + obj.customer_advertising = False + obj.customer_car_brand = "02" + obj.customer_car_model = "741" + obj.customer_car_year = 2015 + + 'DATOS DE VENTA + obj.sale_date = Now + obj.sale_paidby = "01" + obj.sale_type = "01" + obj.sale_type_service = "01" + obj.sale_discount = 0 + obj.sale_id = GuidGenerator.GenerateTimeBasedGuid().ToString() + + 'DATOS DEL PRODUCTO + obj.product_code = "174925" + obj.product_unique_code = "65047187" + obj.product_sale_type = "01" + + '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 = Now + + EnviarPolizaVentaLTHWSD(context, obj) + End Sub + Protected Sub GeneraIndicadores(ByVal context As HttpContext) + Dim obj As New MIndicador(True) + EnviarPolizaIndicadores(context, obj) + End Sub + + Protected Sub EnviarPolizaVentaLTHWSD(ByVal context As HttpContext, obj As MPolizaVentaLTHWSD) Dim Retorno As String = "[]" Try Using wc As New HttpClient() Dim Url = New Uri("http://polizavirtual.com.mx/lthwsd/api/Venta") - Dim Parametros = New List(Of KeyValuePair(Of String, String)) Parametros.Add(New KeyValuePair(Of String, String)("User", User)) Parametros.Add(New KeyValuePair(Of String, String)("password", Password)) - Parametros.Add(New KeyValuePair(Of String, String)("customer_name", "JOSE ENRIQUE VIZCARA RENDON")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name1", "Prueba")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name2", "Prueba")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_birthday", "1900-01-01 00:00:00")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_phone", "5417543010")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_email", "elunap@gmail.com")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_gender", "02")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_advertising", "False")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_date", "2018-07-24 00:00:00")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_paidby", "01")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_type", "01")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_type_service", "01")) - Parametros.Add(New KeyValuePair(Of String, String)("product_code", "174200")) - Parametros.Add(New KeyValuePair(Of String, String)("product_unique_code", "65047187")) - Parametros.Add(New KeyValuePair(Of String, String)("product_sale_type", "01")) - Parametros.Add(New KeyValuePair(Of String, String)("used_product", "True")) - Parametros.Add(New KeyValuePair(Of String, String)("used_brand", "01")) - Parametros.Add(New KeyValuePair(Of String, String)("used_bci", "25")) - Parametros.Add(New KeyValuePair(Of String, String)("used_month", "1")) - Parametros.Add(New KeyValuePair(Of String, String)("used_year", "2015")) - Parametros.Add(New KeyValuePair(Of String, String)("used_sale_date", "2018-07-24 00:00:00")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_car_brand", "36")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_car_model", "741")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_car_year", "2015")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_discount", "0")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_id", "32860")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_name", obj.customer_name)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name1", obj.customer_last_name1)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name2", obj.customer_last_name1)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_birthday", obj.customer_birthday.ToString("yyyy-MM-dd HH:mm:ss"))) + Parametros.Add(New KeyValuePair(Of String, String)("customer_phone", obj.customer_phone)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_email", obj.customer_email)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_gender", obj.customer_gender)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_advertising", obj.customer_advertising.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("sale_date", obj.sale_date.ToString("yyyy-MM-dd HH:mm:ss"))) + Parametros.Add(New KeyValuePair(Of String, String)("sale_paidby", obj.sale_paidby)) + Parametros.Add(New KeyValuePair(Of String, String)("sale_type", obj.sale_type)) + Parametros.Add(New KeyValuePair(Of String, String)("sale_type_service", obj.sale_type_service)) + Parametros.Add(New KeyValuePair(Of String, String)("product_code", obj.product_code)) + Parametros.Add(New KeyValuePair(Of String, String)("product_unique_code", obj.product_unique_code)) + Parametros.Add(New KeyValuePair(Of String, String)("product_sale_type", obj.product_sale_type)) + Parametros.Add(New KeyValuePair(Of String, String)("used_product", obj.used_product.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("used_brand", obj.used_brand)) + Parametros.Add(New KeyValuePair(Of String, String)("used_bci", obj.used_bci)) + Parametros.Add(New KeyValuePair(Of String, String)("used_month", obj.used_month.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("used_year", obj.used_year.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("used_sale_date", obj.used_sale_date.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("customer_car_brand", obj.customer_car_brand.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("customer_car_model", obj.customer_car_model.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("customer_car_year", obj.customer_car_year.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("sale_discount", obj.sale_discount.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("sale_id", obj.sale_id.ToString())) Dim content As New FormUrlEncodedContent(Parametros) Dim response = wc.PostAsync(Url, content).Result @@ -78,7 +205,7 @@ Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState context.Response.Write(Retorno) End Sub - Private Sub EnviarPolizaVentaWS(ByVal context As HttpContext) + Protected Sub EnviarPolizaVentaWS(ByVal context As HttpContext, obj As MPolizaVentaWS) Dim Retorno As String = "[]" Try Using wc As New HttpClient() @@ -88,33 +215,33 @@ Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState Parametros.Add(New KeyValuePair(Of String, String)("User", User)) Parametros.Add(New KeyValuePair(Of String, String)("password", Password)) - Parametros.Add(New KeyValuePair(Of String, String)("customer_name", "JOSE ENRIQUE ")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name1", "VIZCARA")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name2", "RENDON")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_birthday", "1900-01-01 00:00:00")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_phone", "8186545256")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_email", "mail@mail.com")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_gender", "02")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_advertising", "False")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_date", "2018-07-24 00:00:00")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_paidby", "01")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_type", "01")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_type_service", "01")) - Parametros.Add(New KeyValuePair(Of String, String)("product_code", "174925")) - Parametros.Add(New KeyValuePair(Of String, String)("product_unique_code", "65047187")) - Parametros.Add(New KeyValuePair(Of String, String)("product_sale_type", "01")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_total", "0")) - Parametros.Add(New KeyValuePair(Of String, String)("used_product", "True")) - Parametros.Add(New KeyValuePair(Of String, String)("used_brand", "01")) - Parametros.Add(New KeyValuePair(Of String, String)("used_bci", "25")) - Parametros.Add(New KeyValuePair(Of String, String)("used_month", "1")) - Parametros.Add(New KeyValuePair(Of String, String)("used_year", "2015")) - Parametros.Add(New KeyValuePair(Of String, String)("used_sale_date", "2018-07-24 00:00:00")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_car_brand", "36")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_car_model", "741")) - Parametros.Add(New KeyValuePair(Of String, String)("customer_car_year", "2015")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_discount", "0")) - Parametros.Add(New KeyValuePair(Of String, String)("sale_id", "32860")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_name", obj.customer_name)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name1", obj.customer_last_name1)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name2", obj.customer_last_name1)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_birthday", obj.customer_birthday.ToString("yyyy-MM-dd HH:mm:ss"))) + Parametros.Add(New KeyValuePair(Of String, String)("customer_phone", obj.customer_phone)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_email", obj.customer_email)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_gender", obj.customer_gender)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_advertising", obj.customer_advertising.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("sale_date", obj.sale_date.ToString("yyyy-MM-dd HH:mm:ss"))) + Parametros.Add(New KeyValuePair(Of String, String)("sale_paidby", obj.sale_paidby)) + Parametros.Add(New KeyValuePair(Of String, String)("sale_type", obj.sale_type)) + Parametros.Add(New KeyValuePair(Of String, String)("sale_type_service", obj.sale_type_service)) + Parametros.Add(New KeyValuePair(Of String, String)("product_code", obj.product_code)) + Parametros.Add(New KeyValuePair(Of String, String)("product_unique_code", obj.product_unique_code)) + Parametros.Add(New KeyValuePair(Of String, String)("product_sale_type", obj.product_sale_type)) + Parametros.Add(New KeyValuePair(Of String, String)("sale_total", obj.sale_total.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("used_product", obj.used_product.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("used_brand", obj.used_brand)) + Parametros.Add(New KeyValuePair(Of String, String)("used_bci", obj.used_bci)) + Parametros.Add(New KeyValuePair(Of String, String)("used_month", obj.used_month.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("used_year", obj.used_year.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("used_sale_date", obj.used_sale_date.ToString("yyyy-MM-dd HH:mm:ss"))) + Parametros.Add(New KeyValuePair(Of String, String)("customer_car_brand", obj.customer_car_brand.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("customer_car_model", obj.customer_car_model.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("customer_car_year", obj.customer_car_year.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("sale_discount", obj.sale_discount.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("sale_id", obj.sale_id.ToString())) Dim content As New FormUrlEncodedContent(Parametros) Dim response = wc.PostAsync(Url, content).Result @@ -129,7 +256,7 @@ Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState context.Response.Write(Retorno) End Sub - Private Sub EnviarPolizaIndicadores(ByVal context As HttpContext) + Protected Sub EnviarPolizaIndicadores(ByVal context As HttpContext, obj As MIndicador) Dim Retorno As String = "[]" Try Using wc As New HttpClient() @@ -139,47 +266,47 @@ Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState Parametros.Add(New KeyValuePair(Of String, String)("User", User)) Parametros.Add(New KeyValuePair(Of String, String)("password", Password)) - Parametros.Add(New KeyValuePair(Of String, String)("v_b_optima", "1")) - Parametros.Add(New KeyValuePair(Of String, String)("v_b_fullpower", "2")) - Parametros.Add(New KeyValuePair(Of String, String)("v_b_hitec", "3")) - Parametros.Add(New KeyValuePair(Of String, String)("v_b_agm", "4")) - Parametros.Add(New KeyValuePair(Of String, String)("v_b_suv", "5")) - Parametros.Add(New KeyValuePair(Of String, String)("v_b_taxi", "6")) - Parametros.Add(New KeyValuePair(Of String, String)("v_b_america", "7")) - Parametros.Add(New KeyValuePair(Of String, String)("v_b_lth", "8")) - Parametros.Add(New KeyValuePair(Of String, String)("v_b_cronos", "9")) - Parametros.Add(New KeyValuePair(Of String, String)("v_b_diener", "10")) - Parametros.Add(New KeyValuePair(Of String, String)("v_b_heavyduty", "11")) - Parametros.Add(New KeyValuePair(Of String, String)("v_m_lth", "12")) - Parametros.Add(New KeyValuePair(Of String, String)("v_o_filtros", "13")) - Parametros.Add(New KeyValuePair(Of String, String)("v_o_lub1", "14")) - Parametros.Add(New KeyValuePair(Of String, String)("v_o_lubgalon", "15")) - Parametros.Add(New KeyValuePair(Of String, String)("v_o_lub5", "16")) - Parametros.Add(New KeyValuePair(Of String, String)("v_o_aa", "17")) - Parametros.Add(New KeyValuePair(Of String, String)("v_o_aaa", "18")) - Parametros.Add(New KeyValuePair(Of String, String)("g_b_optima", "19")) - Parametros.Add(New KeyValuePair(Of String, String)("g_b_fullpower", "20")) - Parametros.Add(New KeyValuePair(Of String, String)("g_b_hitec", "21")) - Parametros.Add(New KeyValuePair(Of String, String)("g_b_agm", "22")) - Parametros.Add(New KeyValuePair(Of String, String)("g_b_suv", "23")) - Parametros.Add(New KeyValuePair(Of String, String)("g_b_taxi", "24")) - Parametros.Add(New KeyValuePair(Of String, String)("g_b_america", "25")) - Parametros.Add(New KeyValuePair(Of String, String)("g_b_lth", "26")) - Parametros.Add(New KeyValuePair(Of String, String)("g_b_cronos", "27")) - Parametros.Add(New KeyValuePair(Of String, String)("g_b_diener", "28")) - Parametros.Add(New KeyValuePair(Of String, String)("g_b_heavyduty", "29")) - Parametros.Add(New KeyValuePair(Of String, String)("g_m_lth", "30")) - Parametros.Add(New KeyValuePair(Of String, String)("a_b_optima", "31")) - Parametros.Add(New KeyValuePair(Of String, String)("a_b_fullpower", "32")) - Parametros.Add(New KeyValuePair(Of String, String)("a_b_hitec", "33")) - Parametros.Add(New KeyValuePair(Of String, String)("a_b_agm", "34")) - Parametros.Add(New KeyValuePair(Of String, String)("a_b_suv", "35")) - Parametros.Add(New KeyValuePair(Of String, String)("a_b_taxi", "36")) - Parametros.Add(New KeyValuePair(Of String, String)("a_b_america", "37")) - Parametros.Add(New KeyValuePair(Of String, String)("a_b_lth", "38")) - Parametros.Add(New KeyValuePair(Of String, String)("a_b_cronos", "39")) - Parametros.Add(New KeyValuePair(Of String, String)("a_b_diener", "40")) - Parametros.Add(New KeyValuePair(Of String, String)("a_b_heavyduty", "41")) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_optima", obj.v_b_optima.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_fullpower", obj.v_b_fullpower.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_hitec", obj.v_b_hitec.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_agm", obj.v_b_agm.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_suv", obj.v_b_suv.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_taxi", obj.v_b_taxi.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_america", obj.v_b_america.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_lth", obj.v_b_lth.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_cronos", obj.v_b_cronos.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_diener", obj.v_b_diener.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_heavyduty", obj.v_b_heavyduty.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_m_lth", obj.v_m_lth.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_o_filtros", obj.v_o_filtros.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_o_lub1", obj.v_o_lub1.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_o_lubgalon", obj.v_o_lubgalon.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_o_lub5", obj.v_o_lub5.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_o_aa", obj.v_o_aa.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("v_o_aaa", obj.v_o_aaa.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_optima", obj.g_b_optima.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_fullpower", obj.g_b_fullpower.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_hitec", obj.g_b_hitec.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_agm", obj.g_b_agm.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_suv", obj.g_b_suv.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_taxi", obj.g_b_taxi.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_america", obj.g_b_america.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_lth", obj.g_b_lth.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_cronos", obj.g_b_cronos.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_diener", obj.g_b_diener.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_heavyduty", obj.g_b_heavyduty.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("g_m_lth", obj.g_m_lth.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_optima", obj.a_b_optima.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_fullpower", obj.a_b_fullpower.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_hitec", obj.a_b_hitec.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_agm", obj.a_b_agm.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_suv", obj.a_b_suv.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_taxi", obj.a_b_taxi.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_america", obj.a_b_america.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_lth", obj.a_b_lth.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_cronos", obj.a_b_cronos.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_diener", obj.a_b_diener.ToString())) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_heavyduty", obj.a_b_heavyduty.ToString())) Dim content As New FormUrlEncodedContent(Parametros) Dim response = wc.PostAsync(Url, content).Result @@ -194,4 +321,217 @@ Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState context.Response.Write(Retorno) End Sub -End Class \ No newline at end of file +End Class + +Public Class MPolizaVentaLTHWSD + Public Property customer_name As String + Public Property customer_last_name1 As String + Public Property customer_last_name2 As String + Public Property customer_birthday As DateTime + Public Property customer_phone As String + Public Property customer_email As String + Public Property customer_gender As String + Public Property customer_advertising As Boolean + Public Property sale_date As DateTime + Public Property sale_paidby As String + Public Property sale_type As String + Public Property sale_type_service As String + Public Property product_code As String + Public Property product_unique_code As String + Public Property product_sale_type As String + Public Property used_product As Boolean + Public Property used_brand As String + Public Property used_bci As String + Public Property used_month As Integer + Public Property used_year As Integer + Public Property used_sale_date As DateTime + Public Property customer_car_brand As String + Public Property customer_car_model As String + Public Property customer_car_year As Integer + Public Property sale_discount As Decimal + Public Property sale_id As String +End Class + +Public Class MPolizaVentaWS + Public Property customer_name As String + Public Property customer_last_name1 As String + Public Property customer_last_name2 As String + Public Property customer_birthday As DateTime + Public Property customer_phone As String + Public Property customer_email As String + Public Property customer_gender As String + Public Property customer_advertising As Boolean + Public Property sale_date As DateTime + Public Property sale_paidby As String + Public Property sale_type As String + Public Property sale_type_service As String + Public Property sale_total As Decimal + Public Property product_code As String + Public Property product_unique_code As String + Public Property product_sale_type As String + Public Property used_product As Boolean + Public Property used_brand As String + Public Property used_bci As String + Public Property used_month As Integer + Public Property used_year As Integer + Public Property used_sale_date As DateTime + Public Property customer_car_brand As String + Public Property customer_car_model As String + Public Property customer_car_year As Integer + Public Property sale_discount As Decimal + Public Property sale_id As String +End Class + +Public Class MIndicador + + Sub New(Optional UsaValoresPrueba As Boolean = False) + If UsaValoresPrueba Then + Dim Index As Integer = 0 + For Each p As Reflection.PropertyInfo In Me.GetType().GetProperties() + Index = Index + 1 + p.SetValue(Me, Convert.ChangeType(Index, p.PropertyType), Nothing) + Next + End If + End Sub + + Public Property v_b_optima As Integer + Public Property v_b_fullpower As Integer + Public Property v_b_hitec As Integer + Public Property v_b_agm As Integer + Public Property v_b_suv As Integer + Public Property v_b_taxi As Integer + Public Property v_b_america As Integer + Public Property v_b_lth As Integer + Public Property v_b_cronos As Integer + Public Property v_b_diener As Integer + Public Property v_b_heavyduty As Integer + Public Property v_m_lth As Integer + Public Property v_o_filtros As Integer + Public Property v_o_lub1 As Integer + Public Property v_o_lubgalon As Integer + Public Property v_o_lub5 As Integer + Public Property v_o_aa As Integer + Public Property v_o_aaa As Integer + Public Property g_b_optima As Integer + Public Property g_b_fullpower As Integer + Public Property g_b_hitec As Integer + Public Property g_b_agm As Integer + Public Property g_b_suv As Integer + Public Property g_b_taxi As Integer + Public Property g_b_america As Integer + Public Property g_b_lth As Integer + Public Property g_b_cronos As Integer + Public Property g_b_diener As Integer + Public Property g_b_heavyduty As Integer + Public Property g_m_lth As Integer + Public Property a_b_optima As Integer + Public Property a_b_fullpower As Integer + Public Property a_b_hitec As Integer + Public Property a_b_agm As Integer + Public Property a_b_suv As Integer + Public Property a_b_taxi As Integer + Public Property a_b_america As Integer + Public Property a_b_lth As Integer + Public Property a_b_cronos As Integer + Public Property a_b_diener As Integer + Public Property a_b_heavyduty As Integer +End Class + + + +Namespace Fluent + Public Enum GuidVersion + TimeBased = &H1 + Reserved = &H2 + NameBased = &H3 + Random = &H4 + End Enum + + Partial Public Module GuidGenerator + Public Const ByteArraySize = 16 + Public Const VariantByte = 8 + Public Const VariantByteMask = &H3F + Public Const VariantByteShift = &H80 + Public Const VersionByte = 7 + Public Const VersionByteMask = &HF + Public Const VersionByteShift = 4 + Private Const TimestampByte As Byte = 0 + Private Const GuidClockSequenceByte As Byte = 8 + Private Const NodeByte As Byte = 10 + Private ReadOnly GregorianCalendarStart As DateTimeOffset = New DateTimeOffset(1582, 10, 15, 0, 0, 0, TimeSpan.Zero) + Public Property DefaultClockSequence As Byte() + Public Property DefaultNode As Byte() + + Sub New() + DefaultClockSequence = New Byte(1) {} + DefaultNode = New Byte(5) {} + Dim random = New Random + random.NextBytes(DefaultClockSequence) + random.NextBytes(DefaultNode) + End Sub + + + Function GetVersion(ByVal guid As Guid) As GuidVersion + Dim bytes = guid.ToByteArray + Return ((bytes(VersionByte) And &HFF) >> VersionByteShift) + End Function + + Function GetDateTimeOffset(ByVal guid As Guid) As DateTimeOffset + Dim bytes As Byte() = guid.ToByteArray + bytes(VersionByte) = bytes(VersionByte) And CByte(VersionByteMask) + bytes(VersionByte) = bytes(VersionByte) Or (CByte(GuidVersion.TimeBased) >> VersionByteShift) + Dim timestampBytes = New Byte(7) {} + Array.Copy(bytes, TimestampByte, timestampBytes, 0, 8) + Dim timestamp As Long = BitConverter.ToInt64(timestampBytes, 0) + Dim ticks As Long = timestamp + GregorianCalendarStart.Ticks + + Return New DateTimeOffset(ticks, TimeSpan.Zero) + End Function + + Function GetDateTime(ByVal guid As Guid) As Date + Return GetDateTimeOffset(guid).DateTime + End Function + + Function GetLocalDateTime(ByVal guid As Guid) As Date + Return GetDateTimeOffset(guid).LocalDateTime + End Function + + Function GetUtcDateTime(ByVal guid As Guid) As Date + Return GetDateTimeOffset(guid).UtcDateTime + End Function + + Function GenerateTimeBasedGuid() As Guid + Return GenerateTimeBasedGuid(DateTimeOffset.UtcNow, DefaultClockSequence, DefaultNode) + End Function + + Function GenerateTimeBasedGuid(ByVal dateTime As Date) As Guid + Return GenerateTimeBasedGuid(dateTime, DefaultClockSequence, DefaultNode) + End Function + + Function GenerateTimeBasedGuid(ByVal dateTime As DateTimeOffset) As Guid + Return GenerateTimeBasedGuid(dateTime, DefaultClockSequence, DefaultNode) + End Function + + Function GenerateTimeBasedGuid(ByVal dateTime As Date, ByVal clockSequence As Byte(), ByVal node As Byte()) As Guid + Return GenerateTimeBasedGuid(New DateTimeOffset(dateTime), clockSequence, node) + End Function + + Function GenerateTimeBasedGuid(ByVal dateTime As DateTimeOffset, ByVal clockSequence As Byte(), ByVal node As Byte()) As Guid + If clockSequence Is Nothing Then Throw New ArgumentNullException("clockSequence") + If node Is Nothing Then Throw New ArgumentNullException("node") + If clockSequence.Length <> 2 Then Throw New ArgumentOutOfRangeException("clockSequence", "The clockSequence must be 2 bytes.") + If node.Length <> 6 Then Throw New ArgumentOutOfRangeException("node", "The node must be 6 bytes.") + Dim ticks = (dateTime - GregorianCalendarStart).Ticks + Dim guid = New Byte(15) {} + Dim timestamp = BitConverter.GetBytes(ticks) + Array.Copy(node, 0, guid, NodeByte, Math.Min(6, node.Length)) + Array.Copy(clockSequence, 0, guid, GuidClockSequenceByte, Math.Min(2, clockSequence.Length)) + Array.Copy(timestamp, 0, guid, TimestampByte, Math.Min(8, timestamp.Length)) + guid(VariantByte) = guid(VariantByte) And CByte(VariantByteMask) + guid(VariantByte) = guid(VariantByte) Or CByte(VariantByteShift) + guid(VersionByte) = guid(VersionByte) And CByte(VersionByteMask) + guid(VersionByte) = guid(VersionByte) Or (CByte(GuidVersion.TimeBased) << VersionByteShift) + Return New Guid(guid) + End Function + End Module +End Namespace diff --git a/Bancos/RepEgresosSinComprobante.aspx b/Bancos/RepEgresosSinComprobante.aspx index 3b425d2d0..957f1555a 100644 --- a/Bancos/RepEgresosSinComprobante.aspx +++ b/Bancos/RepEgresosSinComprobante.aspx @@ -16,7 +16,13 @@ Otros Egresos
  • - Saldar + Viaticos-Personal +
  • +
  • + Saldar Proveedores +
  • +
  • + Saldar FyE
  • @@ -153,7 +159,7 @@ - + @@ -212,8 +218,14 @@ - + + + + + + diff --git a/Bancos/RepEgresosSinComprobante.aspx.vb b/Bancos/RepEgresosSinComprobante.aspx.vb index e68307aa3..33322b9bd 100644 --- a/Bancos/RepEgresosSinComprobante.aspx.vb +++ b/Bancos/RepEgresosSinComprobante.aspx.vb @@ -180,53 +180,88 @@ Partial Class Bancos_RepEgresosSinComprobante gr.FCCheckBox("Chk").Visible = True LnkSaldar.Visible = True LnkHabilitarSaldar.Visible = False - 'portletBody.Attributes.Remove("style") - 'portletBody.Attributes.Add("style", "display: block;") - - 'HExtensorFiltro.Attributes.Remove("class") - 'HExtensorFiltro.Attributes.Add("class", "collapse") - - 'UPFiltros.Update() UPDatos.Update() End If Next + End Sub + Private Sub LnkHabilitarSaldoFyE_Click(sender As Object, e As EventArgs) Handles LnkHabilitarSaldarFyE.Click + For Each gr As GridViewRow In GvPersonal.Rows + If gr.DataKey("CvePersonal") <> "" Then + gr.FCCheckBox("Chk").Visible = True + LnkSaldarFyE.Visible = True + LnkHabilitarSaldarFyE.Visible = False + upDatosPersonal.Update() + End If + Next End Sub Protected Sub LnkSaldar_Click(sender As Object, e As EventArgs) Dim ObjConta As New ClsContabilidad - ObjConta.IniciaTransacSQL() + Dim ObjProveedor As New ClsCompProveedores(ObjConta.IniciaTransacSQL()) + Dim CvePrePoliza As Integer = 0 Dim MsgError As String = "" + Try + For Each gr As GridViewRow In GvESC.Rows + If gr.FCCheckBox("Chk").Checked Then + Dim CveCuenta As Integer = 0 + Dim IdCtaContable As Integer = 0 + Dim CveConceptoContable As Integer + + Select Case gr.DataKey("CveConceptoContable").ToEntero + Case 10 + CveConceptoContable = 21 + Case 28 + CveConceptoContable = 29 + Case 37 + CveConceptoContable = 43 + Case 42 + CveConceptoContable = 41 + Case 43 + CveConceptoContable = 37 + End Select + + If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, gr.DataKey("CveProveedor").ToEntero, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then + If ObjProveedor.DtResultados.Rows.Count > 0 Then + IdCtaContable = ObjProveedor.IdCtaContProveedores + End If + End If + + If ObjConta.GetCuentaDobleConta(IdCtaContable, UsuarioActual.CveEmpresa) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + CveCuenta = ObjConta.DtResultados.Rows(0)("CveCuenta").ToString.ToEntero + End If + End If + + CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepEgresosSinComprobante", 6, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now, + "Saldo de ExC por Sistema", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, gr.DataKey("Saldo").ToDecimal, "", CveConceptoContable, "Saldo de ExC por Sistema", Now, -1, -1, + gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, + ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveCuenta:=CveCuenta) Then + MsgError = "Ocurrio un error al saldar el movimiento" + Exit For + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, gr.DataKey("Saldo").ToDecimal, "", 78, "Saldo de ExC por Sistema", Now, -1, -1, gr.DataKey("CveIE").ToEntero, + ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveCuenta:=CveCuenta) Then + MsgError = "Ocurrio un error al saldar el movimiento" + Exit For + End If + + If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) + End If + End If + + End If + Next + Catch ex As Exception + MsgError = "Ocurrió un error al generar la prepoliza" + OnError(MsgError, ex) + End Try - For Each gr As GridViewRow In GvESC.Rows - If gr.FCCheckBox("Chk").Checked Then - Dim CveCuenta As Integer = 0 - Dim CveConceptoContable As Integer - - Select Case gr.DataKey("CveConceptoContable").ToEntero - Case 10 - CveConceptoContable = 21 - Case 28 - CveConceptoContable = 29 - Case 37 - CveConceptoContable = 43 - Case 42 - CveConceptoContable = 41 - Case 43 - CveConceptoContable = 37 - End Select - - CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepEgresosSinComprobante", 6, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now, "Saldo de ExC por Sistema", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, gr.DataKey("Saldo").ToDecimal, "", CveConceptoContable, "Saldo de ExC por Sistema", Now, -1, -1, gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveCuenta:=CveCuenta) Then - MsgError = "Ocurrio un error al saldar el movimiento" - End If - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, gr.DataKey("Saldo").ToDecimal, "", 78, "Saldo de ExC por Sistema", Now, -1, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveCuenta:=-1) Then - MsgError = "Ocurrio un error al saldar el movimiento" - End If - End If - Next If MsgError = "" Then ObjConta.Commit() @@ -239,11 +274,96 @@ Partial Class Bancos_RepEgresosSinComprobante LnkSaldar.Visible = False LnkHabilitarSaldar.Visible = True + ObjConta.Dispose() - End Sub + ObjProveedor.Dispose() + End Sub + Protected Sub LnkSaldarFyE_Click(sender As Object, e As EventArgs) + Dim ObjConta As New ClsContabilidad + ObjConta.IniciaTransacSQL() + Dim CvePrePoliza As Integer = 0 + Dim MsgError As String = "" + + Try + For Each gr As GridViewRow In GvPersonal.Rows + If gr.FCCheckBox("Chk").Checked Then + Dim CveCuenta As Integer = 0 + Dim IdCtaContPersonal As Integer = 0 + Dim CveConceptoContable As Integer + + Select Case gr.DataKey("CveConceptoContable").ToEntero + Case 10 + CveConceptoContable = 21 + Case 28 + CveConceptoContable = 29 + Case 37 + CveConceptoContable = 43 + Case 42 + CveConceptoContable = 41 + Case 43 + CveConceptoContable = 37 + End Select + + If ObjConta.GetRetCuenta(CveConceptoContable, gr.DataKey("CvePersonal").ToEntero) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCtaContPersonal = ObjConta.DtResultados.Rows(0)("IdCtaContPersonal").ToString.ToEntero + End If + End If + + If ObjConta.GetCuentaDobleConta(IdCtaContPersonal, UsuarioActual.CveEmpresa) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + CveCuenta = ObjConta.DtResultados.Rows(0)("CveCuenta").ToString.ToEntero + End If + End If + + CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepEgresosSinComprobante", 6, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now, + "Saldo de ExC por Sistema", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, gr.DataKey("Saldo").ToDecimal, "", CveConceptoContable, "Saldo de ExC por Sistema", Now, -1, -1, + gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero, + ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveCuenta:=CveCuenta) Then + MsgError = "Ocurrio un error al saldar el movimiento" + Exit For + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, gr.DataKey("Saldo").ToDecimal, "", 78, "Saldo de ExC por Sistema", Now, -1, -1, gr.DataKey("CveIE").ToEntero, + ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveCuenta:=CveCuenta) Then + MsgError = "Ocurrio un error al saldar el movimiento" + Exit For + End If + + If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) + End If + End If + + End If + Next + Catch ex As Exception + MsgError = "Ocurrió un error al generar la prepoliza" + OnError(MsgError, ex) + End Try + + + If MsgError = "" Then + ObjConta.Commit() + CargaDatos() + Alert("Los movimientos se saldaron correctamente.") + Else + ObjConta.RollBack() + Alert(MsgError, TipoMensaje.MsgError) + End If + + LnkSaldarFyE.Visible = False + LnkHabilitarSaldarFyE.Visible = True + ObjConta.Dispose() + End Sub + + #Region "IMPRESIONES" - + Private Sub ImprimirReportePdf(Archivo As String, DtDatos As DataTable, Optional Formato As String = "PDF") If DtDatos.Rows.Count > 0 Then Dim StrFiltro As New StringBuilder diff --git a/CxC/RepCxCDetalle.aspx.vb b/CxC/RepCxCDetalle.aspx.vb index eac5cf330..9795b367f 100644 --- a/CxC/RepCxCDetalle.aspx.vb +++ b/CxC/RepCxCDetalle.aspx.vb @@ -795,8 +795,11 @@ Partial Class RepCxCDetalle For index = 0 To GvDatos.Columns.Count - 1 If GvDatos.Columns(index).Visible Then - - If TypeOf GvDatos.Columns(index) Is HyperLinkField Then + If TypeOf GvDatos.Columns(index) Is TemplateField Then + If GvDatos.Columns(index).HeaderText = "Folio" Then + dr(GvDatos.Columns(index).HeaderText) = fila.FCHyperLink("HlFolio").Text.Replace(" ", "") + End If + ElseIf TypeOf GvDatos.Columns(index) Is HyperLinkField Then dr(GvDatos.Columns(index).HeaderText) = DirectCast(fila.Cells(index).Controls(0), HyperLink).Text.Replace(" ", "") Else dr(GvDatos.Columns(index).HeaderText) = fila.Cells(index).Text.Replace(" ", "") diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 58e6b919a..d8d27c13c 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -2889,7 +2889,7 @@ Partial Class OC If ChkCotizacion.Checked AndAlso NoProveedoresCot > 0 AndAlso (NumCotizacionesGanadoras > 0 OrElse Not (NumCotizacionesGanadoras <= 0 AndAlso CveConfianzaProveedor = 1)) Then Dim CveProveedor = -1 - Dim TotalCot = 0.0, IVACot = 0D, RetIVA = 0.0, RetISR = 0.0, PorIVA = 0.0, Porcentaje = 0.0 + Dim TotalCot = 0.0, IVACot = 0D, RetIVA = 0.0, RetISR = 0.0, PorIVA = 0.0 Dim IdPoliza = -1 @@ -2900,11 +2900,10 @@ Partial Class OC CveProveedor = dr("CveProveedor").ToString.ToEntero - Porcentaje = DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)) / DtDetalle.SUM("Total") - PorIVA = GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)).Rows(0)("IVA").ToString.ToDouble - IVACot = (DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)) * PorIVA).ToString.ToDecimal - RetIVA = TxtRetIVA.Text.ToDecimal * Porcentaje - RetISR = TxtRetISR.Text.ToDecimal * Porcentaje + PorIVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2) 'GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)).Rows(0)("IVA").ToString.ToDouble + IVACot = IVA '(DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)) * PorIVA).ToString.ToDecimal + RetIVA = TxtRetIVA.Text.ToDecimal + RetISR = TxtRetISR.Text.ToDecimal If objOrdenCompra.AddOrdenCompra("OC", -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusInicialOC, TxtFechaEstimadaEntrega.Text, LugarEntrega, CveUsuario, CveEmpresaActual, 0, pCveProveedor:=CveProveedor, CveCliente:=Ddlcliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, @@ -2945,7 +2944,15 @@ Partial Class OC End If 'AGREGA DETALLES - If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) Then + If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, + dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), + dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra, + CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble, + IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, + RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, + CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, + RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, + IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) Then HuboError = True Exit For End If @@ -2968,7 +2975,7 @@ Partial Class OC If objOrdenCompra.AddOrdenCompra("OC", -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusInicialOC, TxtFechaEstimadaEntrega.Text, LugarEntrega, CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveCliente:=Ddlcliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, - EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=LtImporteIEAnticipo.Text.ToDouble, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, + EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=LtImporteIEAnticipo.Text.ToDouble, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion) Then diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 01b9213d0..d64903e48 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -5076,14 +5076,15 @@ Partial Class PV Dim FechaI = TxtFechaAjuste.Text.ToDate Dim FechaF = Now 'Dim NumDiasAlMes As Double = (365 / 12) - 'Dim DiasTranscurridos = DateDiff(DateInterval.Day, FechaI, FechaF) - - 'Dim MesesTranscurridos As Double = DiasTranscurridos / NumDiasAlMes + 'Dim MesesTranscurridos As Double = (DiasTranscurridos / NumDiasAlMes) + 'Dim Diff = Math.Round(MesesTranscurridos - Math.Truncate(MesesTranscurridos), 2) 'Dim NoMesesTrascurridos = Math.Ceiling(MesesTranscurridos) + Dim NoMesesTrascurridos2 = DateDiff(DateInterval.Month, FechaI, FechaF) - TxtMesesUso.Text = (DateDiff(DateInterval.Month, FechaI, FechaF) + 1).ToString() + 'TxtMesesUso.Text = If(Diff > 0.5, NoMesesTrascurridos, NoMesesTrascurridos2).ToString() + TxtMesesUso.Text = NoMesesTrascurridos2 CalculaPorcentajeAjuste() End Sub diff --git a/Ventas/RepComisionesJAM.aspx b/Ventas/RepComisionesJAM.aspx index 17dc09bc9..4bbf10fc2 100644 --- a/Ventas/RepComisionesJAM.aspx +++ b/Ventas/RepComisionesJAM.aspx @@ -131,7 +131,7 @@ <%-- 14 --%> <%-- 15 --%> - + <%-- 16 --%> <%-- 17 --%> From 41fc269dc964add2d144d03b0cde10b4c2f9b2a4 Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Wed, 6 Nov 2019 12:01:19 -0700 Subject: [PATCH 02/24] Cambios de BDH --- Ventas/PV.aspx.vb | 8 +++++++- Ventas/Ventas.aspx.vb | 29 +++++++++++++++++------------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index e9d5dff51..744d270c0 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -2828,6 +2828,7 @@ Partial Class PV End If If PrecioSugerido > 0 Then TxtPrecio.Text = PrecioSugerido.FormatoNumero() + RegistraScript("$get('LblPrecio1').innerText = formato_numero(" + PrecioSugerido.ToString + ", 2, '.', ',');") End If @@ -4294,7 +4295,7 @@ Partial Class PV Private Sub CargaCuentas() - DdlCuentaEfectivo.Items.Clear() + 'DdlCuentaEfectivo.Items.Clear() DdlCuentaTarjetaCredito.Items.Clear() DdlCuentaTarjetaDebito.Items.Clear() DdlCuentaCheque.Items.Clear() @@ -4351,6 +4352,11 @@ Partial Class PV If total <= 0 Then Alert("No se ha ingresado importe", TipoMensaje.MsgAdvertencia) : Exit Sub + If TxtCambio.Text.ToDecimal > 0 And TxtImporteEfectivo.Text.ToDecimal < TxtCambio.Text.ToDecimal Then + Alert("Debe haber un pago en efectivo y ser mayor que el cambio. Si no, ser pago exacto.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + If (DtPagos.SUM("Importe").ToString.ToDecimal + total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia) Exit Sub diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 7b9a65473..cb789b33b 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -10304,9 +10304,9 @@ Partial Class Ventas Exit For End If - If DrPago("CveTipoMovimiento").ToString.ToEntero = 8 Then '13 - DrPago("Importe") = DrPago("Importe").ToString.ToDecimal - TxtCambio.Text.ToDecimal - End If + 'If DrPago("CveTipoMovimiento").ToString.ToEntero = 8 Then '13 + ' DrPago("Importe") = DrPago("Importe").ToString.ToDecimal - TxtCambio.Text.ToDecimal + 'End If CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString.ToEntero, DrPago("CveTipoMovimiento").ToString.ToEntero, Fecha, FolioIE.ToString, String.Format("PAGO: {0}", TxtFolio.Text), DrPago("Importe").ToString.ToDouble, DdlMoneda.SelectedValue.ToEntero, tipoCambio, DrPago("Observaciones").ToString, "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte, MesesSinIntereses:=DrPago("MesesSinIntereses").ToString.ToEntero) @@ -16464,10 +16464,15 @@ Partial Class Ventas If total <= 0 Then Alert("No se ha ingresado importe", TipoMensaje.MsgAdvertencia) : Exit Sub - 'If DtPagos.SUM("Importe").ToString.ToDecimal + total > TxtTotal.Text.ToDecimal Then - ' Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia) - ' Exit Sub - 'End If + If TxtCambio.Text.ToDecimal > 0 And TxtImporteEfectivo.Text.ToDecimal < TxtCambio.Text.ToDecimal Then + Alert("Debe haber un pago en efectivo y ser mayor que el cambio. Si no, ser pago exacto.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If (DtPagos.SUM("Importe").ToString.ToDecimal + total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then + Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If 'Pago en Efectivo If TxtImporteEfectivo.Text.ToDecimal > 0 Then @@ -16477,7 +16482,7 @@ Partial Class Ventas DrEfectivo("TipoMovimiento") = "Pago en Efectivo" DrEfectivo("CveCuenta") = DdlCuentaEfectivo.SelectedValue DrEfectivo("Cuenta") = DdlCuentaEfectivo.SelectedItem.Text - DrEfectivo("Importe") = TxtImporteEfectivo.Text + DrEfectivo("Importe") = TxtImporteEfectivo.Text.ToDecimal - TxtCambio.Text.ToDecimal DrEfectivo("Folio") = CargaFolioContado(DdlCuentaEfectivo.SelectedValue.ToEntero, 6) DrEfectivo("Observaciones") = "" DrEfectivo("Tipo") = "Caja Chica" @@ -16679,10 +16684,10 @@ Partial Class Ventas Retorno = True End If - 'If DtPagos.SUM("Importe").ToString.ToDecimal > TxtTotal.Text.ToDecimal Then - ' Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia) - ' Retorno = True - 'End If + If (DtPagos.SUM("Importe").ToString.ToDecimal + Total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then + Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia) + Retorno = True + End If Return Retorno End Function From 42d117e8d5a36ad22b2311aff0d8ffbcdeb15e59 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 6 Nov 2019 12:53:31 -0700 Subject: [PATCH 03/24] cambios en los materiales de ordenes de servicio --- OS/OrdenesServicios.aspx.vb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 5797aae3b..eaa4cc8f1 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -1300,8 +1300,8 @@ Partial Class OS_OrdenesServicios Row.FCLinkButton("imgEstatus").CssClass = "btn btn-circle btn-sm green" Else Row.FCLinkButton("imgEstatus").Enabled = False - 'TmpDT.Rows(Row.RowIndex)("Estatus") = "False" - 'Row.FCLinkButton("imgEstatus").CssClass = "btn btn-circle btn-sm red" + TmpDT.Rows(Row.RowIndex)("Estatus") = "False" + Row.FCLinkButton("imgEstatus").CssClass = "btn btn-circle btn-sm red" End If End Sub Private Sub BtnAddGvDetalle_Click(sender As Object, e As EventArgs) Handles BtnAddGvDetalle.Click @@ -2265,9 +2265,16 @@ Partial Class OS_OrdenesServicios TieneError = True End If + 'SI OCURRIO UN ERROR EN LA EXISTENCIA RECARGAMOS EL GRID PARA COLOREAR LOS DETALLES CON ERROR + If ErrorExistencia Then + Alert("Ocurrió un error en la existencia", TipoMensaje.MsgError) + TieneError = True + End If + If Not TieneError Then Dim ObjOS As New ClsOS - For Each Row As DataRow In TmpDTMaterialesDetalle.Rows + Dim MaterialesDetalleNuevos As DataTable = TmpDTMaterialesDetalle.FiltraParametros("CveMaterial = -1") + For Each Row As DataRow In MaterialesDetalleNuevos.Rows Dim CveUM As Integer = Row("CveUM").ToString.ToEntero Dim CvePS As Integer = Row("CvePS").ToString.ToEntero Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero @@ -2287,13 +2294,6 @@ Partial Class OS_OrdenesServicios ObjOS.Dispose() End If - - 'SI OCURRIO UN ERROR EN LA EXISTENCIA RECARGAMOS EL GRID PARA COLOREAR LOS DETALLES CON ERROR - If ErrorExistencia Then - Alert("Ocurrió un error en la existencia", TipoMensaje.MsgError) - TieneError = True - End If - If Not TieneError Then ObjInventario.Commit() Alert($"El Traspaso se guardó correctamente con el folio #: {Folio}.", TipoMensaje.MsgInformacion, $"document.location.href=""/Inventarios/TrasladoSolicitud.aspx?CveTraspasoSolicitud={CveTraspasoSolicitud}""") From c3fdfad4927c400cfcde3d70e99f20da87466853 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 6 Nov 2019 13:12:01 -0700 Subject: [PATCH 04/24] - --- Bancos/IE.aspx.vb | 2 ++ Bancos/PagoDeudor.aspx.cs | 2 +- Ventas/PV.aspx.vb | 2 +- Ventas/Ventas.aspx.vb | 30 +++++++++++++++--------------- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 1eeb43303..6e73cd85f 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -2457,6 +2457,8 @@ Partial Class Bancos_IE If CveIE > 0 Then If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = ObjIE.Folio.ToEntero 'cheque + If UsuarioActual.CveEmpresa = 119 Then FolioFijo = 0 + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)) 'valida prepoliza diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index e837bbdfa..e2d5b27ef 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -844,7 +844,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas } } bool AutoConta = UsuarioActual.Empresa.Funcionalidad(200).Equals("1"); - if (UsuarioActual.CveEmpresa == 119) AutoConta = false; + //if (UsuarioActual.CveEmpresa == 119) AutoConta = false; if (AutoConta && MsgError.Equals("")) { diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index e9d5dff51..1140a2b57 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -5095,7 +5095,7 @@ Partial Class PV 'Dim NoMesesTrascurridos = Math.Ceiling(MesesTranscurridos) - TxtMesesUso.Text = (DateDiff(DateInterval.Month, FechaI, FechaF) + 1).ToString() + TxtMesesUso.Text = (DateDiff(DateInterval.Month, FechaI, FechaF)).ToString() CalculaPorcentajeAjuste() End Sub diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 587fc5346..028985042 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -9572,24 +9572,24 @@ Partial Class Ventas TCFluctuacion = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal End If - If DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Not Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then - ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion - ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then - ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion - ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then - Importe251 = Dr("Importe").ToString.ToDecimal / TCFluctuacion - ImporteMN251 = Dr("Importe").ToString.ToDecimal - Else - ImporteMN251 = Dr("Importe").ToString.ToDecimal - End If + If DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Not Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then + ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion + ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then + ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion + ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then + Importe251 = Dr("Importe").ToString.ToDecimal / TCFluctuacion + ImporteMN251 = Dr("Importe").ToString.ToDecimal + Else + ImporteMN251 = Dr("Importe").ToString.ToDecimal + End If - Importe251 = (Importe251 * Multiplicador).RoundSQL + Importe251 = Importe251.RoundSQL - Importe91 = (Importe91 * ValorMultiplicador).RoundSQL - ImporteMN91 = (ImporteMN91 * Multiplicador).RoundSQL - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${Importe91.FormatoNumero(2)}" + Importe91 = (Importe91).RoundSQL + ImporteMN91 = (ImporteMN91 * Multiplicador).RoundSQL + If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${Importe91.FormatoNumero(2)}" - CveUltimaVenta = Dr("CveVenta").ToString.ToEntero + CveUltimaVenta = Dr("CveVenta").ToString.ToEntero Dim ImporteComplementarioIngreso As Decimal = 0 If UsaComplementariaClientes = True AndAlso tipoCambio > 1 Then From b6da35bb6fd7ee2fff2d5792cbdede48f50df24e Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 6 Nov 2019 13:34:01 -0700 Subject: [PATCH 05/24] el campo "se facturara" esta hardcodeado en true al generar una OrdenServicioDetalle --- OS/OrdenesServicios.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index eaa4cc8f1..4b128eac3 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -1037,7 +1037,7 @@ Partial Class OS_OrdenesServicios Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero Dim Archivo As New System.IO.FileInfo(String.Format("{0}OS\Temp\{1}", UsuarioActual.Empresa.Ruta, Row("Archivo").ToString)) - CveOsDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(ObjOrdenServicio.CveOS, CvePS, Cantidad, -1, -1, Observaciones, False, SeFacturara, False, CveCuentaEquipo, "-1", "-1", "-1", ComentarioTecnico, UsuarioActual.CveUsuario, Archivo:=Archivo.Name) + CveOsDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(ObjOrdenServicio.CveOS, CvePS, Cantidad, -1, -1, Observaciones, False, True, False, CveCuentaEquipo, "-1", "-1", "-1", ComentarioTecnico, UsuarioActual.CveUsuario, Archivo:=Archivo.Name) If CveOsDetalle > 0 Then If Archivo.Name <> "-1" AndAlso Archivo.Exists Then From 6dd75ae10328d3d905c77e9fac347f3593670974 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Wed, 6 Nov 2019 14:01:44 -0700 Subject: [PATCH 06/24] =?UTF-8?q?Pago=20electronico=20tama=C3=B1o=20usuari?= =?UTF-8?q?o=20cabecera,=20=20ddltipotransaccion=20error=20al=20selecciona?= =?UTF-8?q?r=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bancos/PagoElectronico.aspx.vb | 11 ++++++++--- Bancos/ProveedoresAbonar.aspx.vb | 7 ++++++- LogTimbrado.txt | 4 ++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Bancos/PagoElectronico.aspx.vb b/Bancos/PagoElectronico.aspx.vb index 38b908b3c..4a70aa2a1 100644 --- a/Bancos/PagoElectronico.aspx.vb +++ b/Bancos/PagoElectronico.aspx.vb @@ -798,9 +798,14 @@ Partial Class Bancos_PagoElectronico '''''' LLENADO HEADER Dim convenio As String = DTPendienteActual(0)("ConvenioPagoElectronico").ToString 'Campos #1-4 del Header - HeaderTexto = String.Format("H{0}{1}GRUPO01 ", convenio.PadLeft(9, PadCeros), DateTime.Now().ToString("yyyy-MM-dd")) - 'Campo #5 del Header - HeaderTexto &= String.Format("{0}{1}", UsuarioActual.Usuario, DateTime.Now().ToString("yyyyMMdd")).PadRight(20) + HeaderTexto = String.Format("H{0}{1}GRUPO01 ", convenio.PadLeft(9, PadCeros), DateTime.Now().ToString("yyyy-MM-dd")) + 'Campo #5 del Header + + Dim IdentificadoUsuario As String = UsuarioActual.Usuario.Replace(" ", "").Replace(".", "").Replace("@", "").Replace("/", "").ToUpper.Trim + IdentificadoUsuario = If(IdentificadoUsuario.Length > 12, IdentificadoUsuario.Substring(0, 12), IdentificadoUsuario) + ' Dim Identificado As String = String.Format("{0}{1}", UsuarioActual.Usuario, DateTime.Now().ToString("yyyyMMdd"))) + + HeaderTexto &= String.Format("{0}{1}", IdentificadoUsuario, DateTime.Now().ToString("yyyyMMdd")).PadRight(20) 'Campos #6-8 del Header HeaderTexto &= String.Format("00").PadRight(586) Dim HeaderLength = HeaderTexto.Length diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 37b1b3a67..6f7796a67 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -2298,7 +2298,12 @@ Partial Class Bancos_ProveedoresAbonar End If DdlCuentaDeposito.DataBind() - DdlCuentaDeposito.SelectedIndex = 1 + + + If DdlCuentaDeposito.Items.Count > 1 Then + DdlCuentaDeposito.SelectedIndex = 1 + End If + End If End If diff --git a/LogTimbrado.txt b/LogTimbrado.txt index 4d2db01dc..b329362bb 100644 --- a/LogTimbrado.txt +++ b/LogTimbrado.txt @@ -16,3 +16,7 @@ .. PAC: 4 - Verificado : (6) 6 Certificado : (384) 390 Armado: (27) 417 Genera: (390) 807 Timbrado: (2271) 3078 Guardado: (219) 3297 Actualizado: (902) 4199 ..01/10/2019:12:27 a. m. .. PAC: 4 - Verificado : (0) 0 Certificado : (204) 204 Armado: (1) 205 Genera: (249) 454 Timbrado: (431) 885 ..01/10/2019:12:27 a. m. + + .. PAC: 2 - Verificado : (32764) 32764 Armado: (660) 33424 Guardado: (445) 33869 Timbrado: (156762) 190631 ..06/11/2019:09:39 a. m. + + .. PAC: 2 - Verificado : (2018) 2018 Armado: (96902) 98920 Guardado: (312) 99232 Timbrado: (1201) 100433 ..06/11/2019:09:41 a. m. From c583836e907772b968a3abc00a4462ddea2c7d34 Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Wed, 6 Nov 2019 14:09:10 -0700 Subject: [PATCH 07/24] Cambios de BDH --- Ventas/PV.aspx | 37 +++++++++++++++++++++++++++++-------- Ventas/PV.aspx.vb | 7 +++++-- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index 266060f25..9fd8b00cc 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -2729,7 +2729,16 @@ -
    +
    +
    + + + + + +
    +
    +
    @@ -3115,15 +3124,27 @@ var Descuento = parseFloat($get("TxtPorDescP").value); $get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ','); - $get("TxtPrecio").value = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); + $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); - $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); + $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); + $get("TxtDescuento").value = formato_numero(Total, 2, '.', ','); + $get("TxtDescP").value = formato_numero(0, 2, '.', ','); $get("HdnDescuento").value = Total; if (TipoDescuento == 2) { $get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ','); } } - else if ($get("TxtDescP").value != "0" && $get("TxtDescP").value) { + else { + $get("LblPrecioFinal").innerText = "0.00"; + $get("LblDescuento").innerText = "0.00"; + $get("HdnDescuento").value = "0.00"; + } + + } + + function CalculaDescuentoMonto() { + + if ($get("TxtDescP").value != "0" && $get("TxtDescP").value) { var Monto = 0; var TipoDescuento = $get("HdnTipoDescuento").value; @@ -3141,11 +3162,12 @@ } var Descuento = parseFloat($get("TxtDescP").value); - $get("TxtPorDescP").value = Descuento * 100 / Monto * 10 + $get("TxtPorDescP").value = formato_numero((Descuento * 100 / Monto), 2, '.', ','); $get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ','); - $get("TxtPrecio").value = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); + $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); - $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); + $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); + $get("TxtDescuento").value = formato_numero(Total, 2, '.', ','); $get("HdnDescuento").value = Total; if (TipoDescuento == 2) { Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); @@ -3156,7 +3178,6 @@ $get("LblDescuento").innerText = "0.00"; $get("HdnDescuento").value = "0.00"; } - } function BorraDescuentos() { diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 326d6100a..a76ce216c 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -1062,7 +1062,7 @@ Partial Class PV 'ImgCerrarIE.Attributes.Add("OnClick", "$('#DivIngresoEgreso').hide();") 'ImgCerrarEstadoCaja.Attributes.Add("OnClick", "$('#DivEstadoCaja').hide();") TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();") - TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuento();") + TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMonto();") TxtFechaAjuste.Attributes.Add("onchange", "CalculaMesesUso();") CreaDTmpC() @@ -2771,6 +2771,9 @@ Partial Class PV Exit Sub End If + TxtDescuento.Text = FormatoNumero(0, 2) + TxtPrecio.Text = "" + If CvePSParametro > 0 Then Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("") @@ -5102,7 +5105,7 @@ Partial Class PV Dim NoMesesTrascurridos2 = DateDiff(DateInterval.Month, FechaI, FechaF) 'TxtMesesUso.Text = If(Diff > 0.5, NoMesesTrascurridos, NoMesesTrascurridos2).ToString() - TxtMesesUso.Text = NoMesesTrascurridos2 + TxtMesesUso.Text = NoMesesTrascurridos2.ToString CalculaPorcentajeAjuste() End Sub From 365dc9210e1b34fab58224ae344c1e33519552f0 Mon Sep 17 00:00:00 2001 From: Raul Pimienta Date: Thu, 7 Nov 2019 00:07:26 -0700 Subject: [PATCH 08/24] En el reporte de utilidades cuando una factura no tiene un pago pondra de color la celda de rentabilidad En reembolsos comprobaciones se habilito la opcion otros ingresos para cuando se seleccione algun cheque --- Compras/ReembolsosComprobaciones.aspx | 13 ++++++--- Compras/ReembolsosComprobaciones.aspx.vb | 34 +++++++++++++++++++++--- Ventas/RepVentasUtilidad.aspx.vb | 4 ++- 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/Compras/ReembolsosComprobaciones.aspx b/Compras/ReembolsosComprobaciones.aspx index 4df62e5a9..b8d1aeefe 100644 --- a/Compras/ReembolsosComprobaciones.aspx +++ b/Compras/ReembolsosComprobaciones.aspx @@ -117,6 +117,8 @@ + +
    @@ -420,7 +422,7 @@ Cheque - + @@ -511,7 +513,12 @@ } } - } + } + if (textBoxes[i].id.indexOf('C_GvCxP_TxtComision') >= 0) { + if (textBoxes[i].value != '') { + Comision = parseFloat(Comision) + parseFloat(textBoxes[i].value.split(',').join('')); + } + } } } @@ -544,7 +551,7 @@ } - $get('TxtImporteVinculado').value = FormatoNumero(Importe, 2); + $get('TxtImporteVinculado').value = FormatoNumero(Importe + Comision, 2); } else { $get('TxtImporte').value = FormatoNumero(Importe, 2); diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index bee517f36..59620eeb6 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -263,6 +263,26 @@ Partial Class Compras_ReembolsosComprobaciones UPCompras.Update() End Sub + Protected Sub ChkOtrosIngresosCheque_CheckedChanged(sender As Object, e As EventArgs) + + If ChkOtrosIngresosCheque.Checked Then + TxtOtrosImportes.Visible = True + TxtTotal.Visible = True + GvCxP.Columns(15).Visible = True + Else + TxtOtrosImportes.Visible = False + TxtTotal.Visible = False + GvCxP.Columns(15).Visible = False + TxtOtrosImportes.Text = "" + TxtTotal.Text = "" + RegistraScript("$get('TxtImporte').value = FormatoNumero(SumaValores(), 2);") + End If + + UpDatos.Update() + UPCompras.Update() + + End Sub + #End Region #Region " SELECTED INDEX CHANGED " @@ -301,6 +321,8 @@ Partial Class Compras_ReembolsosComprobaciones PnlChequeInfo.Visible = True + ChkOtrosIngresosCheque.Visible = True + If UsuarioActual.TienePermisoProceso(113) Then TrChequeExcedente.Visible = True CargaDatos(DDlCheques.SelectedValue.ToEntero) @@ -315,6 +337,8 @@ Partial Class Compras_ReembolsosComprobaciones HdnCheque.Value = "-1" + ChkOtrosIngresosCheque.Visible = False + If UsuarioActual.TienePermisoProceso(113) Then TableExpedirCheque.Visible = True LimpiaDatos() @@ -410,9 +434,9 @@ Partial Class Compras_ReembolsosComprobaciones End If End If Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString - CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, TxtFechaDocumento.Text.Trim.ToDate, FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False)) + CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, TxtFechaDocumento.Text.Trim.ToDate, FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporteVinculado.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False)) 'AGREGO PREPOLIZA IE BANCOS - If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporte.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporteVinculado.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporteVinculado.Text.ToDecimal), ImporteMX:=TxtImporteVinculado.Text.ToDecimal * tipoCambio) Then MsgError = "Error al registrar detalle de concepto bancario" End If Else @@ -620,11 +644,12 @@ Partial Class Compras_ReembolsosComprobaciones End If 'Otros Ingresos - If ChkAjusteOI.Checked AndAlso gvr.FCTextBox("TxtComision").Text.ToDecimal > 0 Then + If (ChkAjusteOI.Checked Or ChkOtrosIngresosCheque.Checked) AndAlso gvr.FCTextBox("TxtComision").Text.ToDecimal > 0 Then If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor) Then MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos" End If - If CveCajaChica > 0 Then + If CveCajaChica > 0 AndAlso Not HdnCheque.Value.ToEntero > 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor, Contabilizable:=False) Then MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos" End If @@ -1919,4 +1944,5 @@ Partial Class Compras_ReembolsosComprobaciones #End Region + End Class diff --git a/Ventas/RepVentasUtilidad.aspx.vb b/Ventas/RepVentasUtilidad.aspx.vb index 230979595..1d7fc16cd 100644 --- a/Ventas/RepVentasUtilidad.aspx.vb +++ b/Ventas/RepVentasUtilidad.aspx.vb @@ -216,7 +216,9 @@ Partial Class Ventas_RepVentasUtilidad e.Row.CssClass = "Totales" End If - + If e.Row.DBCampo("CveVenta").ToEntero > 0 AndAlso Not CBool(e.Row.DBCampo("TienePago")) Then + e.Row.Cells(15).BackColor = Drawing.Color.LightPink + End If Dim Liga As String = String.Format("/Ventas/RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}", From 2535217c2b5cff8587d5fa58d94e253407967052 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 7 Nov 2019 10:15:16 -0700 Subject: [PATCH 09/24] --- App_Code/Modelos.vb | 28 +- App_Code/modExtensiones.vb | 29 +- Ashx/SIGFacturacion.ashx | 2 +- Contratos/FacturacionMasiva.aspx.vb | 2 +- LogMail.txt | 2 +- LogTimbrado.txt | 6 + OC/RepCotizacionesDetalle.aspx | 739 ++++++++++++++-------------- OC/RepCotizacionesDetalle.aspx.vb | 174 ++++--- Ventas/Clientes.aspx.vb | 2 +- Ventas/Ventas.aspx.vb | 2 +- asmx/WSApp.asmx | 2 +- asmx/WSSIGApp.asmx | 2 +- 12 files changed, 522 insertions(+), 468 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 2295f8946..c71136040 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -5041,7 +5041,21 @@ Namespace Modelos Public Property Inv_CveEstatusEntrega As Integer Public Property Inv_EstatusEntrega As String Public Property Inv_ValorInventario As Decimal - Public Property Fecha As DateTime + Public Property Fecha As DateTime + + Public ReadOnly Property FechaCP As DateTime + Get + If Me.SubProyecto IsNot Nothing Then + If Now.EsHorarioVerano Then + Return DateTime.UtcNow.AddHours(Me.SubProyecto.UTCOffsetVerano) + Else + Return DateTime.UtcNow.AddHours(Me.SubProyecto.UTCOffsetInvierno) + End If + Else + Return Fecha + End If + End Get + End Property Public Property FechaVencimiento As DateTime Public Property EstatusFactura As String Public Property SeTimbro As String @@ -8486,6 +8500,8 @@ Namespace Modelos FormatoFactura = "" SubProyecto = "" Correo = "" + UTCOffsetVerano = -7 + UTCOffsetInvierno = -7 End Sub Public Sub New() MyBase.New() @@ -8502,9 +8518,11 @@ Namespace Modelos Estado = Row("Estado").ToString Pais = Row("Pais").ToString CP = Row("CP").ToString - SubProyecto = Row("SubProyecto").ToString + SubProyecto = Row("SubProyecto").ToString + UTCOffsetVerano = Row("UTCOffsetVerano").ToString.ToEntero() + UTCOffsetInvierno = Row("UTCOffsetInvierno").ToString.ToEntero() End If - 'SetValues(Row) + End Sub Public ReadOnly Property LugarExp As String @@ -8531,7 +8549,9 @@ Namespace Modelos Public Property SubProyecto As String Public Property Correo As String Public Property Telefono As String - Public Property ImprimeNombre As String + Public Property ImprimeNombre As String + Public Property UTCOffsetVerano As Integer + Public Property UTCOffsetInvierno As Integer End Class diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 2c12cc557..11b2f7c26 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -434,7 +434,7 @@ Namespace Extensiones Return retorno End Function - Public Function FilesMove(oldName As String, newName As String, newDirectorio As String) As Boolean + Public Function FilesMove(oldName As String, newName As String, newDirectorio As String, Optional Sobreescribir As Boolean = False) As Boolean Dim retorno As Boolean = True Dim directorioOld As New StringBuilder Dim directorioNew As New StringBuilder @@ -451,7 +451,7 @@ Namespace Extensiones directorioNew.Append(newName) Try - My.Computer.FileSystem.MoveFile(directorioOld.ToString, directorioNew.ToString) + My.Computer.FileSystem.MoveFile(directorioOld.ToString, directorioNew.ToString, Sobreescribir) Catch ex As Exception Alert("", String.Format("{0} code[FilesMove]", ex.Message), TipoMensaje.MsgAdvertencia) retorno = False @@ -3100,6 +3100,31 @@ Namespace Extensiones Dim origin As DateTime = New DateTime(1970, 1, 1, 0, 0, 0, 0) Return origin.AddSeconds(timestamp) End Function + + Public Function GetLastWeekdayOfMonth(ByVal fecha As DateTime, day As DayOfWeek) As DateTime + Dim lastDayOfMonth As DateTime = New DateTime(fecha.Year, fecha.Month, 1).AddMonths(1).AddDays(-1) + Dim wantedDay As Integer = CInt(day) + Dim lastDay As Integer = CInt(lastDayOfMonth.DayOfWeek) + Return lastDayOfMonth.AddDays(If(lastDay >= wantedDay, wantedDay - lastDay, wantedDay - lastDay - 7)) + End Function + + Public Function GetFirstWeekdayOfMonth(ByVal fecha As DateTime, day As DayOfWeek) As DateTime + Dim result As DateTime = New DateTime(fecha.Year, fecha.Month, 1) + + While result.DayOfWeek <> day + result = result.AddDays(1) + End While + + Return result + End Function + + Public Function EsHorarioVerano(ByVal fecha As DateTime) As Boolean + Dim Year As Integer = fecha.Year + Dim FechaI As DateTime = New DateTime(Year, 4, 1, 0, 0, 0).GetFirstWeekdayOfMonth(DayOfWeek.Sunday) 'PRIMER DOMINGO DE ABRIL + Dim FechaF As DateTime = New DateTime(Year, 10, 1, 23, 59, 59).GetLastWeekdayOfMonth(DayOfWeek.Sunday) 'ULTIMO DOMINGO DE OCTUBRE + + Return fecha >= FechaI AndAlso fecha <= FechaF + End Function End Module #End Region diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index 1246aac36..43af054f9 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -416,7 +416,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", "")) Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie - Timbre.Comprobante.Fecha = Obj.Fecha + Timbre.Comprobante.Fecha = Obj.FechaCP Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT diff --git a/Contratos/FacturacionMasiva.aspx.vb b/Contratos/FacturacionMasiva.aspx.vb index d6d18aef3..7155797ae 100644 --- a/Contratos/FacturacionMasiva.aspx.vb +++ b/Contratos/FacturacionMasiva.aspx.vb @@ -668,7 +668,7 @@ Partial Class Contratos_FacturacionMasiva Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", "")) Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie - Timbre.Comprobante.Fecha = Obj.Fecha + Timbre.Comprobante.Fecha = Obj.FechaCP Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT diff --git a/LogMail.txt b/LogMail.txt index 9e13f1f3c..1040cc9c6 100644 --- a/LogMail.txt +++ b/LogMail.txt @@ -4,4 +4,4 @@ en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\WWWSIGIT\App_Code\ClsSisMail.vb:línea 129 05/09/2019:12:31 p. m. From:'signotificaciones@adssistemas.mx' - Para:';' - Asunto:'Envío de complemento de pago' - CCP: '' - Adjuntos: 2 - Ocurrió un error al mandar correo.System.InvalidOperationException: Se debe especificar un destinatario. en System.Net.Mail.SmtpClient.Send(MailMessage message) - en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\WWWSIGIT\App_Code\ClsSisMail.vb:línea 129 10/09/2019:12:16 p. m. From:'signotificaciones@adssistemas.mx' - Para:'DSDDS@hotmail.com' - Asunto:'SIG - La Orden Compra #26598 cambió de estatus.' - CCP: '' - Adjuntos: 0 10/09/2019:02:58 p. m. No se especifico a remitente - SIG - La Orden Compra #28107 cambió de estatus. 11/09/2019:11:56 a. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Solicitud Vacaciones ' - CCP: '' - Adjuntos: 0 11/09/2019:12:35 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'(Vacaciones:Permisos) Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:02 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Permiso para Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:03 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Vacaciones Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Vacaciones Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 20/09/2019:05:15 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29109' - CCP: '' - Adjuntos: 1 20/09/2019:05:36 p. m. No se especifico a remitente - Entrega de Factura HMO - 29110 20/09/2019:05:45 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29111' - CCP: '' - Adjuntos: 1 20/09/2019:05:47 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29112' - CCP: '' - Adjuntos: 1 23/09/2019:10:55 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'Solicitud de anticipo de Orden de Compra' - CCP: '' - Adjuntos: 0 23/09/2019:11:05 a. m. No se especifico a remitente - Solicitud de anticipo de Orden de Compra 23/09/2019:11:34 a. m. No se especifico a remitente - Solicitud de anticipo de Orden de Compra 25/09/2019:05:06 p. m. No se especifico a remitente - SIG - La Orden Compra #4860 cambió de estatus. 04/10/2019:12:09 p. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 83 17/10/2019:12:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1488 cambió de estatus.' - CCP: '' - Adjuntos: 0 17/10/2019:12:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1488 cambió de estatus.' - CCP: 'japmx95@gmail.com;;' - Adjuntos: 0 17/10/2019:12:10 p. m. No se especifico a remitente - SIG - Se Genero una Orden de Compra 17/10/2019:12:39 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 17/10/2019:07:07 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1489 cambió de estatus.' - CCP: '' - Adjuntos: 0 17/10/2019:07:07 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1489 cambió de estatus.' - CCP: 'japmx95@gmail.com;;' - Adjuntos: 0 17/10/2019:07:07 p. m. No se especifico a remitente - SIG - Se Genero una Orden de Compra 17/10/2019:07:11 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 17/10/2019:07:14 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Recepción de Material de OC ' - CCP: '' - Adjuntos: 0 21/10/2019:10:50 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 90 21/10/2019:10:53 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 91 21/10/2019:10:53 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 92 21/10/2019:10:59 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 93 21/10/2019:11:03 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 94 21/10/2019:07:01 p. m. No se especifico a remitente - SIG. Requisición #30796 Bitacora 21/10/2019:07:02 p. m. No se especifico a remitente - SIG. Requisición #30796 Bitacora 21/10/2019:07:18 p. m. No se especifico a remitente - SIG. Requisición #31573 Bitacora 21/10/2019:07:35 p. m. No se especifico a remitente - SIG - La Requisicion #31706 cambió de estatus. 21/10/2019:07:35 p. m. No se especifico a remitente - SIG - La Requisicion #31706 cambió de estatus. 21/10/2019:07:36 p. m. No se especifico a remitente - SIG - La Requisición #31706 cambió de estatus. 21/10/2019:07:36 p. m. No se especifico a remitente - SIG. Requisición #31706 Modificada 21/10/2019:07:37 p. m. No se especifico a remitente - SIG - Se Genero una Orden de Compra 21/10/2019:07:37 p. m. No se especifico a remitente - SIG - La Requisición #31706 se le ha asignado 21/10/2019:07:41 p. m. No se especifico a remitente - SIG - La Requisicion #31707 cambió de estatus. 21/10/2019:07:41 p. m. No se especifico a remitente - SIG - La Requisicion #31707 cambió de estatus. 21/10/2019:07:42 p. m. No se especifico a remitente - SIG. Requisición #31707 Bitacora 22/10/2019:09:25 a. m. No se especifico a remitente - SIG. Requisición #31697 Bitacora 22/10/2019:04:50 p. m. No se especifico a remitente - SIG - La Requisicion #31708 cambió de estatus. 22/10/2019:04:50 p. m. No se especifico a remitente - SIG - La Requisicion #31708 cambió de estatus. 22/10/2019:05:03 p. m. No se especifico a remitente - SIG. Requisición #31708 Modificada 24/10/2019:01:46 p. m. From:'signotificaciones@adssistemas.mx' - Para:'arnoldopc@hotmail.com' - Asunto:'SIG - La Requisición #31816 cambió de estatus.' - CCP: '' - Adjuntos: 0 24/10/2019:01:46 p. m. From:'signotificaciones@adssistemas.mx' - Para:'arnoldopc@hotmail.com' - Asunto:'SIG. Requisición #31816 Modificada' - CCP: '' - Adjuntos: 0 24/10/2019:01:46 p. m. From:'signotificaciones@adssistemas.mx' - Para:'rene.molina@adsistemas.mx;' - Asunto:'SIG - Se Genero una Orden de Compra' - CCP: '' - Adjuntos: 1 29/10/2019:12:51 p. m. No se especifico a remitente - SIG - La Orden Compra #30034 cambió de estatus. 30/10/2019:10:09 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 30/10/2019:10:10 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Recepción de Material de OC ' - CCP: '' - Adjuntos: 0 04/11/2019:11:03 a. m. From:'signotificaciones@adssistemas.mx' - Para:'janeth_borchardt@hotmail.com;janethborchardt94@gmail.com' - Asunto:'Desactivación de cliente ACUACULTURA BIOTECNOLOGICA SA DE CV' - CCP: '' - Adjuntos: 0 04/11/2019:11:09 a. m. From:'signotificaciones@adssistemas.mx' - Para:'janeth_borchardt@hotmail.com;janeth_borchardt94@hotmail.com' - Asunto:'Activación de cliente ACUACULTURA BIOTECNOLOGICA SA DE CV' - CCP: '' - Adjuntos: 0 \ No newline at end of file + en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\WWWSIGIT\App_Code\ClsSisMail.vb:línea 129 10/09/2019:12:16 p. m. From:'signotificaciones@adssistemas.mx' - Para:'DSDDS@hotmail.com' - Asunto:'SIG - La Orden Compra #26598 cambió de estatus.' - CCP: '' - Adjuntos: 0 10/09/2019:02:58 p. m. No se especifico a remitente - SIG - La Orden Compra #28107 cambió de estatus. 11/09/2019:11:56 a. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Solicitud Vacaciones ' - CCP: '' - Adjuntos: 0 11/09/2019:12:35 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'(Vacaciones:Permisos) Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:02 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Permiso para Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:03 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Vacaciones Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Vacaciones Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 20/09/2019:05:15 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29109' - CCP: '' - Adjuntos: 1 20/09/2019:05:36 p. m. No se especifico a remitente - Entrega de Factura HMO - 29110 20/09/2019:05:45 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29111' - CCP: '' - Adjuntos: 1 20/09/2019:05:47 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29112' - CCP: '' - Adjuntos: 1 23/09/2019:10:55 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'Solicitud de anticipo de Orden de Compra' - CCP: '' - Adjuntos: 0 23/09/2019:11:05 a. m. No se especifico a remitente - Solicitud de anticipo de Orden de Compra 23/09/2019:11:34 a. m. No se especifico a remitente - Solicitud de anticipo de Orden de Compra 25/09/2019:05:06 p. m. No se especifico a remitente - SIG - La Orden Compra #4860 cambió de estatus. 04/10/2019:12:09 p. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 83 17/10/2019:12:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1488 cambió de estatus.' - CCP: '' - Adjuntos: 0 17/10/2019:12:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1488 cambió de estatus.' - CCP: 'japmx95@gmail.com;;' - Adjuntos: 0 17/10/2019:12:10 p. m. No se especifico a remitente - SIG - Se Genero una Orden de Compra 17/10/2019:12:39 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 17/10/2019:07:07 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1489 cambió de estatus.' - CCP: '' - Adjuntos: 0 17/10/2019:07:07 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1489 cambió de estatus.' - CCP: 'japmx95@gmail.com;;' - Adjuntos: 0 17/10/2019:07:07 p. m. No se especifico a remitente - SIG - Se Genero una Orden de Compra 17/10/2019:07:11 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 17/10/2019:07:14 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Recepción de Material de OC ' - CCP: '' - Adjuntos: 0 21/10/2019:10:50 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 90 21/10/2019:10:53 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 91 21/10/2019:10:53 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 92 21/10/2019:10:59 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 93 21/10/2019:11:03 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 94 21/10/2019:07:01 p. m. No se especifico a remitente - SIG. Requisición #30796 Bitacora 21/10/2019:07:02 p. m. No se especifico a remitente - SIG. Requisición #30796 Bitacora 21/10/2019:07:18 p. m. No se especifico a remitente - SIG. Requisición #31573 Bitacora 21/10/2019:07:35 p. m. No se especifico a remitente - SIG - La Requisicion #31706 cambió de estatus. 21/10/2019:07:35 p. m. No se especifico a remitente - SIG - La Requisicion #31706 cambió de estatus. 21/10/2019:07:36 p. m. No se especifico a remitente - SIG - La Requisición #31706 cambió de estatus. 21/10/2019:07:36 p. m. No se especifico a remitente - SIG. Requisición #31706 Modificada 21/10/2019:07:37 p. m. No se especifico a remitente - SIG - Se Genero una Orden de Compra 21/10/2019:07:37 p. m. No se especifico a remitente - SIG - La Requisición #31706 se le ha asignado 21/10/2019:07:41 p. m. No se especifico a remitente - SIG - La Requisicion #31707 cambió de estatus. 21/10/2019:07:41 p. m. No se especifico a remitente - SIG - La Requisicion #31707 cambió de estatus. 21/10/2019:07:42 p. m. No se especifico a remitente - SIG. Requisición #31707 Bitacora 22/10/2019:09:25 a. m. No se especifico a remitente - SIG. Requisición #31697 Bitacora 22/10/2019:04:50 p. m. No se especifico a remitente - SIG - La Requisicion #31708 cambió de estatus. 22/10/2019:04:50 p. m. No se especifico a remitente - SIG - La Requisicion #31708 cambió de estatus. 22/10/2019:05:03 p. m. No se especifico a remitente - SIG. Requisición #31708 Modificada 24/10/2019:01:46 p. m. From:'signotificaciones@adssistemas.mx' - Para:'arnoldopc@hotmail.com' - Asunto:'SIG - La Requisición #31816 cambió de estatus.' - CCP: '' - Adjuntos: 0 24/10/2019:01:46 p. m. From:'signotificaciones@adssistemas.mx' - Para:'arnoldopc@hotmail.com' - Asunto:'SIG. Requisición #31816 Modificada' - CCP: '' - Adjuntos: 0 24/10/2019:01:46 p. m. From:'signotificaciones@adssistemas.mx' - Para:'rene.molina@adsistemas.mx;' - Asunto:'SIG - Se Genero una Orden de Compra' - CCP: '' - Adjuntos: 1 29/10/2019:12:51 p. m. No se especifico a remitente - SIG - La Orden Compra #30034 cambió de estatus. 30/10/2019:10:09 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 30/10/2019:10:10 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Recepción de Material de OC ' - CCP: '' - Adjuntos: 0 04/11/2019:11:03 a. m. From:'signotificaciones@adssistemas.mx' - Para:'janeth_borchardt@hotmail.com;janethborchardt94@gmail.com' - Asunto:'Desactivación de cliente ACUACULTURA BIOTECNOLOGICA SA DE CV' - CCP: '' - Adjuntos: 0 04/11/2019:11:09 a. m. From:'signotificaciones@adssistemas.mx' - Para:'janeth_borchardt@hotmail.com;janeth_borchardt94@hotmail.com' - Asunto:'Activación de cliente ACUACULTURA BIOTECNOLOGICA SA DE CV' - CCP: '' - Adjuntos: 0 06/11/2019:11:44 a. m. No se especifico a remitente - Entrega de Factura MATRIZ HM-1504 06/11/2019:11:53 a. m. No se especifico a remitente - Entrega de Factura MATRIZ HM-1505 06/11/2019:11:57 a. m. No se especifico a remitente - Entrega de Factura MATRIZ HM-1506 06/11/2019:06:05 p. m. No se especifico a remitente - SIG. Requisición #31835 Bitacora \ No newline at end of file diff --git a/LogTimbrado.txt b/LogTimbrado.txt index 4d2db01dc..4a1f04964 100644 --- a/LogTimbrado.txt +++ b/LogTimbrado.txt @@ -16,3 +16,9 @@ .. PAC: 4 - Verificado : (6) 6 Certificado : (384) 390 Armado: (27) 417 Genera: (390) 807 Timbrado: (2271) 3078 Guardado: (219) 3297 Actualizado: (902) 4199 ..01/10/2019:12:27 a. m. .. PAC: 4 - Verificado : (0) 0 Certificado : (204) 204 Armado: (1) 205 Genera: (249) 454 Timbrado: (431) 885 ..01/10/2019:12:27 a. m. + + .. PAC: 2 - Verificado : (332) 332 Armado: (228) 560 Guardado: (284) 844 Timbrado: (2434) 3278 Actualizado: (367) 3645 ..06/11/2019:11:44 a. m. + + .. PAC: 2 - Verificado : (207) 207 Armado: (233) 440 Guardado: (200) 640 Timbrado: (1745) 2385 Actualizado: (175) 2560 ..06/11/2019:11:53 a. m. + + .. PAC: 2 - Verificado : (197) 197 Armado: (220) 417 Guardado: (233) 650 Timbrado: (1795) 2445 Actualizado: (172) 2617 ..06/11/2019:11:57 a. m. diff --git a/OC/RepCotizacionesDetalle.aspx b/OC/RepCotizacionesDetalle.aspx index a5960e571..eeecd680b 100644 --- a/OC/RepCotizacionesDetalle.aspx +++ b/OC/RepCotizacionesDetalle.aspx @@ -1,374 +1,351 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCotizacionesDetalle.aspx.vb" Inherits="PopOCCotizacionesDetalle" %> - -<%--<%@ MasterType VirtualPath="~/Site.master" %>--%> - - - - - - - - - - - - - - - - - - - - - -
    Carga de Cotizaciones
    - -
    - -
    - -
    -
    - - <%--PROVEEDORES--%> -
    -
    - -
    -
    - Proveedores -
    -
    -
    -
    - -
    -
    - -
    - - - - - - - - - -
    - -
    - - -
    -
    - - -
    - - - - - -
    -
    - - - -
    - - -
    -
    - - <%--ARCHIVO--%> -
    - Archivo: - [HplArchivo] -   -
    - - Seleccionar Archivo - -
    - -
    - -
    -
    - - <%--DATOS DE COTIZACION--%> -
    - -
    - -
    -
    - Datos contización -
    -
    -
    -
    - -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - -
    - -
    - -
    - - - - - - - - - - -
    -
    - -
    - -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - -
    - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%----%> -
    -
    -
    -
    - -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCotizacionesDetalle.aspx.vb" Inherits="PopOCCotizacionesDetalle" %> + +<%--<%@ MasterType VirtualPath="~/Site.master" %>--%> + + + + + + + + + + + + + + + + +
    Carga de Cotizaciones
    +
    +
    +
    + + +
    + +
    +
    + Proveedores +
    +
    +
    +
    + +
    +
    + +
    + + + + + + + + + +
    + +
    + + +
    +
    + + +
    + + + + + +
    +
    +
    +
    +
    +
    +
    + Archivo +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + Datos contización +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + +
    + +
    + + + + + + + + + + +
    +
    + +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + - + +
    diff --git a/OC/RepCotizacionesDetalle.aspx.vb b/OC/RepCotizacionesDetalle.aspx.vb index ba8f2d67d..e2829799f 100644 --- a/OC/RepCotizacionesDetalle.aspx.vb +++ b/OC/RepCotizacionesDetalle.aspx.vb @@ -2,13 +2,14 @@ Option Explicit On Imports System.Data +Imports System.Net Imports Extensiones Partial Class PopOCCotizacionesDetalle - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "Propiedades" - + Friend Property EsNuevo As Boolean Get EsNuevo = DirectCast(ViewState("EsNuevo"), Boolean) @@ -43,11 +44,20 @@ Partial Class PopOCCotizacionesDetalle Set(ByVal value As DataTable) ViewState("DtDetalle") = value End Set - End Property - + End Property + Private Property Adjunto As String + Get + Adjunto = ViewState("Adjunto").ToString + End Get + Set(value As String) + ViewState("Adjunto") = value + End Set + End Property + + #End Region - - + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then @@ -76,9 +86,9 @@ Partial Class PopOCCotizacionesDetalle BtnEliminar.Visible = True End If End If - End Sub - - + End Sub + + #Region " INICIALIZA VALORES - CARGA COMBOS " Protected Sub CargaProveedoresClasificaciones() CboClasificacionProveedor.DataSource = GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa) @@ -97,11 +107,11 @@ Partial Class PopOCCotizacionesDetalle Protected Sub CargaMonedas() ddlMoneda.DataSource = GlobalDTMonedas() ddlMoneda.DataBind() - End Sub - + End Sub + #End Region - - + + #Region "C A R G A D A T O S " Private Sub CargaOCDetalle(pCveOrden As Integer) Dim objOC As New ClsOC @@ -129,11 +139,10 @@ Partial Class PopOCCotizacionesDetalle TxtFecha.Text = objCotizacion.Fecha.ToShortDateString ddlMoneda.SelectedValue = objCotizacion.CveMoneda.ToString TxtDiasCredito.Text = objCotizacion.DiasCredito.ToString - + Adjunto = objCotizacion.Adjunto If objCotizacion.Adjunto <> "" Then - HplArchivo.NavigateUrl = String.Format("/Empresas/{0}/Cotizaciones/{1}", UsuarioActual.CveEmpresa, objCotizacion.Adjunto) - HplArchivo.Text = String.Format("Descargar", IO.Path.GetExtension(objCotizacion.Adjunto).Replace("."c, "")) 'ImageUrl = String.Format("/Imagenes/{0}.png", IO.Path.GetExtension(Cot.NombreArchivo).Replace("."c, "")) - HplArchivo.Visible = True + 'HplArchivo.NavigateUrl = String.Format("/Empresas/{0}/Cotizaciones/{1}", UsuarioActual.CveEmpresa, objCotizacion.Adjunto) + LnkArchivo.Visible = True End If If objCotizacion.GetCotizacionesDetalle(pCveCotizacion) Then @@ -155,7 +164,7 @@ Partial Class PopOCCotizacionesDetalle TxtDiasCredito.Enabled = False TxtFecha.Enabled = False TxtFolio.Enabled = False - FUArchivo.Enabled = False + 'FUArchivo.Enabled = False If UsuarioActual.TienePermisoProceso(146) Then GvDC.Enabled = True @@ -164,61 +173,71 @@ Partial Class PopOCCotizacionesDetalle End If BtnGuardar.Enabled = False - End Sub + End Sub #End Region - - + + #Region " GUARDAR " Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click Dim objCotizacion As New ClsOC objCotizacion.IniciaTransacSQL() - Dim TieneError = False - - + Dim TieneError = False + + Dim FileExtension As String = "" + Dim Filesgral As List(Of Archivo) = TxtArchivo.getfiles().Archivos + Dim Filename As String = "" + For Each fileItem As Archivo In Filesgral + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)) '.Replace(".", "") + Filename = fileItem.filename + Next + Try If EsNuevo Then - If objCotizacion.AddCotizacion(CveOrdenCompra, CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, IO.Path.GetExtension(FUArchivo.FileName), ddlMoneda.SelectedValue.ToEntero, TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario) Then - If FUArchivo.HasFile Then - 'verificar que exista el directorio - If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) Then - System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) - End If - FUArchivo.SaveAs(String.Format("{0}/Empresas/{1}/Cotizaciones/{2}{3}", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, objCotizacion.CveCotizacion, IO.Path.GetExtension(FUArchivo.FileName))) + If objCotizacion.AddCotizacion(CveOrdenCompra, CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, FileExtension, ddlMoneda.SelectedValue.ToEntero, + TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario) Then + + 'verificar que exista el directorio + If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) Then + System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) + End If + + If Filename <> "" Then + Filename.FilesMove(objCotizacion.CveCotizacion.ToString(), String.Format("Empresas\{0}\Cotizaciones", UsuarioActual.CveEmpresa)) End If + For Each dr As GridViewRow In GvDC.Rows - TieneError = Not objCotizacion.AddCotizacionDetalle(objCotizacion.CveCotizacion, dr.DataKey("CvePS").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.DataKey("Cantidad").ToDouble, dr.DataKey("CveUnidadMedida").ToEntero, dr.FCTextBox("txtCantidadSurtir").Text.ToDouble, If(dr.FCTextBox("txtFechaEntrega").Text.Trim = "" Or dr.FCTextBox("txtFechaEntrega").Text = "__/__/____", "-1", dr.FCTextBox("txtFechaEntrega").Text), dr.FCTextBox("txtObservacion").Text.ToString, dr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero) + TieneError = Not objCotizacion.AddCotizacionDetalle(objCotizacion.CveCotizacion, dr.DataKey("CvePS").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.DataKey("Cantidad").ToDouble, + dr.DataKey("CveUnidadMedida").ToEntero, dr.FCTextBox("txtCantidadSurtir").Text.ToDouble, + If(dr.FCTextBox("txtFechaEntrega").Text.Trim = "" Or dr.FCTextBox("txtFechaEntrega").Text = "__/__/____", "-1", + dr.FCTextBox("txtFechaEntrega").Text), dr.FCTextBox("txtObservacion").Text.ToString, dr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero) If TieneError = True Then Exit For Next End If Else - Dim NombreArchivo As String = "" - - If objCotizacion.UpdateCotizacion(CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, IO.Path.GetExtension(FUArchivo.FileName), ddlMoneda.SelectedValue.ToEntero, TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario, CveCotizacion) Then - - If FUArchivo.HasFile Then - 'verificar que exista el directorio - If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) Then - System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) - End If - FUArchivo.SaveAs(String.Format("{0}/Empresas/{1}/Cotizaciones/{2}{3}", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, CveCotizacion, IO.Path.GetExtension(FUArchivo.FileName))) - NombreArchivo = CveCotizacion & IO.Path.GetExtension(FUArchivo.FileName) + If objCotizacion.UpdateCotizacion(CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, FileExtension, ddlMoneda.SelectedValue.ToEntero, TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario, CveCotizacion) Then + + 'verificar que exista el directorio + If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) Then + System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) + End If + + If Filename <> "" Then + Filename.FilesMove(CveCotizacion.ToString(), String.Format("Empresas\{0}\Cotizaciones", UsuarioActual.CveEmpresa)) End If For Each dr As GridViewRow In GvDC.Rows If dr.DataKey("CveCotizacionDetalle").ToEntero > 0 Then TieneError = Not objCotizacion.UpdateCotizacionDetalle(dr.DataKey("CveCotizacionDetalle").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.FCTextBox("txtCantidadSurtir").Text.ToDouble, dr.FCTextBox("txtFechaEntrega").Text, dr.FCTextBox("txtObservacion").Text.ToString) Else - Dim strTemp = dr.DataKey("CveOrdenCompraDetalle").ToString If dr.FCTextBox("txtCantidadSurtir").Text.ToString.ToDouble > 0 Then If dr.FCTextBox("TxtPU").Text.ToDouble > 0 Then TieneError = Not objCotizacion.AddCotizacionDetalle(CveCotizacion, dr.DataKey("CvePS").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.DataKey("Cantidad").ToDouble, dr.DataKey("CveUnidadMedida").ToEntero, dr.FCTextBox("txtCantidadSurtir").Text.ToString.ToDouble, If(dr.FCTextBox("txtFechaEntrega").Text.Trim = "" Or dr.FCTextBox("txtFechaEntrega").Text = "__/__/____", "-1", dr.FCTextBox("txtFechaEntrega").Text), dr.FCTextBox("txtObservacion").Text.ToString, dr.DataKey("CveOrdenCompraDetalle").ToEntero) End If - End If If TieneError = True Then Exit For Next @@ -229,38 +248,25 @@ Partial Class PopOCCotizacionesDetalle End If Catch ex As Exception TieneError = True - objCotizacion.RollBack() OnError("Se presento un error al guardar la cotización", ex) - End Try - - If Not TieneError Then - objCotizacion.Commit() Alert(If(EsNuevo, "Cotización Guardada.", "Cotización Actualizada."), TipoMensaje.MsgInformacion) - Else - Try - objCotizacion.RollBack() - Catch ex As Exception - OnError("Error al intetar hace RollBack", ex) - End Try - - - - + Else + objCotizacion.RollBack() End If objCotizacion.Dispose() RegistraScript("Ir();") - End Sub + End Sub #End Region - - - - + + + + #Region " ELIMINAR " Private Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click Dim objCotizacion As New ClsOC @@ -274,10 +280,10 @@ Partial Class PopOCCotizacionesDetalle objCotizacion.Dispose() RegistraScript("Ir();") - End Sub + End Sub #End Region - - + + #Region " G V D " Protected Sub GvD_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDC.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -365,10 +371,30 @@ Partial Class PopOCCotizacionesDetalle 'e.Row.Attributes.Add("data-validadores", ValidadoresId) - Dim asdasdasd As String = "" - End If - End Sub + Dim asdasdasd As String = "" + End If + End Sub #End Region - - + + + Protected Sub LnkArchivo_Click(sender As Object, e As EventArgs) + If Not String.IsNullOrEmpty(Adjunto) Then + Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, "Cotizaciones\" & Adjunto) + Dim Archivo As New System.IO.FileInfo(filePath) + + If Archivo.Exists Then + HttpContext.Current.Response.Clear() + HttpContext.Current.Response.ClearContent() + HttpContext.Current.Response.ContentType = "application/octet-stream" + HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" + System.IO.Path.GetFileName(filePath)) + HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) + HttpContext.Current.Response.TransmitFile(filePath) + HttpContext.Current.Response.Flush() + HttpContext.Current.Response.End() + + Archivo = Nothing + End If + End If + + End Sub End Class diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 88835c8aa..0434a039d 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -9409,7 +9409,7 @@ Partial Class Clientes Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", "")) Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie - Timbre.Comprobante.Fecha = Obj.Fecha + Timbre.Comprobante.Fecha = Obj.FechaCP Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 7b9a65473..56c155112 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -8338,7 +8338,7 @@ Partial Class Ventas Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", "")) Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie - Timbre.Comprobante.Fecha = Obj.Fecha + Timbre.Comprobante.Fecha = Obj.FechaCP Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT diff --git a/asmx/WSApp.asmx b/asmx/WSApp.asmx index 685e55e7f..0c92d6bd9 100644 --- a/asmx/WSApp.asmx +++ b/asmx/WSApp.asmx @@ -803,7 +803,7 @@ Public Class WSApp Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", "")) Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie - Timbre.Comprobante.Fecha = Obj.Fecha + Timbre.Comprobante.Fecha = Obj.FechaCP Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT diff --git a/asmx/WSSIGApp.asmx b/asmx/WSSIGApp.asmx index a9f62a494..febee922a 100644 --- a/asmx/WSSIGApp.asmx +++ b/asmx/WSSIGApp.asmx @@ -2142,7 +2142,7 @@ Public Class WSSIGApp Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", "")) Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie - Timbre.Comprobante.Fecha = Obj.Fecha + Timbre.Comprobante.Fecha = Obj.FechaCP Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT From b1d4830ebc8703c8619a8fc6c06f8863554b590e Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 7 Nov 2019 11:02:39 -0700 Subject: [PATCH 10/24] =?UTF-8?q?alert=20de=20m=C3=A1s,=20se=20quit=C3=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/PV.aspx.vb | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index a76ce216c..da7da6193 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -4920,7 +4920,7 @@ Partial Class PV TmpDTAjustes.Columns.Add("CveUM", GetType(Integer)) TmpDTAjustes.Columns.Add("CveVentaDetalle", GetType(Integer)) TmpDTAjustes.Columns.Add("CveVenta", GetType(Integer)) - TmpDTAjustes.Columns.Add("PUFactura", GetType(Integer)) + TmpDTAjustes.Columns.Add("PUFactura", GetType(Double)) End Sub @@ -5094,18 +5094,21 @@ Partial Class PV End Sub Private Sub CalculaMesesUso() - Dim FechaI = TxtFechaAjuste.Text.ToDate.AddDays(1) - Dim FechaF = Now - 'Dim NumDiasAlMes As Double = (365 / 12) - 'Dim DiasTranscurridos = DateDiff(DateInterval.Day, FechaI, FechaF) - 'Dim MesesTranscurridos As Double = (DiasTranscurridos / NumDiasAlMes) - 'Dim Diff = Math.Round(MesesTranscurridos - Math.Truncate(MesesTranscurridos), 2) + Dim FechaI As Date = TxtFechaAjuste.Text.ToDate.AddDays(1) + Dim FechaF As Date = Now + Dim FechaT As Date = String.Format("{0}/{1}/{2}", FechaI.Day, FechaF.Month, FechaF.Year).ToDate 'armo la fecha con el día del mes actual - 'Dim NoMesesTrascurridos = Math.Ceiling(MesesTranscurridos) - Dim NoMesesTrascurridos2 = DateDiff(DateInterval.Month, FechaI, FechaF) + Dim MesesTrascurridos As Integer = Math.Round(DateDiff(DateInterval.Day, FechaI, FechaT) / 30.4, 2).ToEntero 'saco los meses y lo redondeo + + If FechaT > FechaF Then + 'todavía está en el mes actual. + MesesTrascurridos = MesesTrascurridos + Else + MesesTrascurridos = MesesTrascurridos + 1 + End If + + TxtMesesUso.Text = MesesTrascurridos.ToString - 'TxtMesesUso.Text = If(Diff > 0.5, NoMesesTrascurridos, NoMesesTrascurridos2).ToString() - TxtMesesUso.Text = NoMesesTrascurridos2.ToString CalculaPorcentajeAjuste() End Sub @@ -5177,6 +5180,13 @@ Partial Class PV End If End If + 'el ajuste no puede ser mayor al precio de lo vendido de nuevo + If (TxtPrecio.Text.ToDouble - ((TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior))) < 0 Then + TxtDescuentoAjuste.Text = TxtPrecio.Text + TxtImporteAjuste.Text = "0.00" + CargoAnterior = CargoActual + End If + TxtDescuentoAjuste.Text = ((TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior)).FormatoNumero TxtDescuentoAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoActual - CargoAnterior).FormatoNumero}." End If @@ -5294,6 +5304,7 @@ Partial Class PV End If Dr("Descuento") = Math.Round((TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior), NumeroDecimales) + If Dr("Descuento").ToString.ToDouble > TxtPrecio.Text.ToDouble Then Dr("Descuento") = TxtPrecio.Text.ToDouble Dim TotalCalculableImpuestos As Decimal = (Dr("Cantidad").ToString.ToDecimal * (Dr("PU").ToString.ToDecimal)) - Dr("Descuento").ToString.ToDecimal Dr("ImporteIVA") = Math.Round(Dr("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales) From b98f0362dda393e52904ae00098c952a49b82d6f Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Thu, 7 Nov 2019 12:43:23 -0700 Subject: [PATCH 11/24] Validacion de Recepcion de Usados --- Ventas/PV.aspx.vb | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index a76ce216c..da6b993e0 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -3482,13 +3482,50 @@ Partial Class PV Return False End If - Dim CantidadUsados As Decimal = 0 + + 'Validacion de Recepción de Usados + Dim Vendido As Decimal = 0 + Dim Entregado As Decimal = 0 + Dim UltimoEntregado As Decimal = 0 + For Each Gvr As GridViewRow In GvRecepcionUsados.Rows If Gvr.RowType = DataControlRowType.DataRow Then - CantidadUsados = CantidadUsados + Gvr.FCTextBox("TxtCantidad").Text.ToEntero() + If Gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0 Then + Entregado += (Gvr.FCTextBox("TxtCantidad").Text.ToEntero * Gvr.DataKey("Cargo").ToDecimal) + UltimoEntregado = Gvr.DataKey("Cargo").ToDecimal + End If End If Next + If Entregado > 0 Then + 'Calcular Vendido + Dim DTTamanios As New DataTable + Dim ObjAcum As New ClsAcumuladores + If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then + DTTamanios = ObjAcum.DtResultados + End If + ObjAcum.Dispose() + Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") + + If DTTamanios.Rows.Count > 0 And DTTamanios IsNot Nothing And DrPS("CveTamaño").ToString.ToEntero > 0 Then + Vendido = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { DrPS("CveTamaño") }").ToDecimal + End If + + If Entregado > Vendido Then + If (Entregado - Vendido) >= UltimoEntregado Then + Alert("No puede entregar un cargo mayor a lo Vendido", TipoMensaje.MsgAdvertencia) + Return False + End If + End If + End If + + 'Dim CantidadUsados As Decimal = 0 + 'For Each Gvr As GridViewRow In GvRecepcionUsados.Rows + ' If Gvr.RowType = DataControlRowType.DataRow Then + ' CantidadUsados = CantidadUsados + Gvr.FCTextBox("TxtCantidad").Text.ToEntero() + ' End If + 'Next + 'If CantidadUsados > TxtCantidad.Text.ToEntero() Then ' Alert("No puede tener una cantidad mayor a la de los cargos", TipoMensaje.MsgAdvertencia) ' Return False From 159ba3b28a9b40e875fdcab85573fe59eadb7413 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 7 Nov 2019 13:50:18 -0700 Subject: [PATCH 12/24] =?UTF-8?q?se=20agreg=C3=B3=20columna=20de=20cleinte?= =?UTF-8?q?,=20y=20refrescar=20al=20recibir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/RecepcionUsados.aspx | 2 ++ Inventarios/RecepcionUsados.aspx.vb | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx index cd25a6832..804c83873 100644 --- a/Inventarios/RecepcionUsados.aspx +++ b/Inventarios/RecepcionUsados.aspx @@ -324,6 +324,8 @@ + + diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index 96262ce47..1b073987b 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -1096,6 +1096,7 @@ Partial Class Inventarios_RecepcionUsados EnvioCorreo() + CargaPendientesRecibir() UPDatos.Update() Else @@ -1923,6 +1924,10 @@ Partial Class Inventarios_RecepcionUsados End Sub Protected Sub BtnConsultarPendientes_Click(sender As Object, e As EventArgs) + CargaPendientesRecibir() + End Sub + + Private Sub CargaPendientesRecibir() Dim ObjVentas As New ClsVentas If ObjVentas.GetVentasUsados(-1, DdlSubProyectos.SelectedValue.ToEntero(), TxtFechaPendientes.Text.ToDateTime(), UsuarioActual.CveEmpresa) Then GVPendientes.DataSource = ObjVentas.DtResultados From 2945b20316dbcdbf5f7ba8ce4186f0b13d6a1889 Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Thu, 7 Nov 2019 13:52:57 -0700 Subject: [PATCH 13/24] Formato de Reporte de Solicitudes de Anticipo --- .../Grales/Formatos/RepSolicitudAnticipo.rdlc | 969 ++++++++++++++++++ 1 file changed, 969 insertions(+) create mode 100644 Empresas/Grales/Formatos/RepSolicitudAnticipo.rdlc diff --git a/Empresas/Grales/Formatos/RepSolicitudAnticipo.rdlc b/Empresas/Grales/Formatos/RepSolicitudAnticipo.rdlc new file mode 100644 index 000000000..0a0262614 --- /dev/null +++ b/Empresas/Grales/Formatos/RepSolicitudAnticipo.rdlc @@ -0,0 +1,969 @@ + + + + + + + + + + + + true + true + + + + + OC + + + + + + + Textbox28 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 7.36287cm + + + 3.6966cm + + + 2.91394cm + + + 1.65333cm + + + 2.5cm + + + + + 0.46771cm + + + + + true + true + + + + + =Fields!RazonSocial.Value + + + + + + + RazonSocial + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Nombre.Value + + + + + + + Nombre + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteSol.Value + + + + + + + ImporteSol + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + true + true + + + + + =Fields!FolioMov.Value + + + + + + + FolioMov + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + true + + + + + + + + + + + 0.46771cm + + + true + true + + + + + Proveedor + + + + + + + Textbox6 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Usuario Solicitó + + + + + + + Textbox4 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Importe Solicitud + + + + + + + Textbox40 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Mov. Banc. + + + + + + + Textbox5 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + =IIf(Parameters!Estatus.Value = "3",False,True) + + + + + 0.46771cm + + + true + true + + + + + Importe + + + + + + + Textbox18 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + =IIf(Parameters!Estatus.Value = "3",False,True) + + + + + + + + + + 1.60042cm + + + true + true + + + + + =Fields!Folio.Value + + + + + + + Folio + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet1 + 0.82931cm + 0.06614cm + 0.93542cm + 19.72716cm + + + + + + true + true + + + + + =Parameters!AgrupadoPor.Value + HTML + + + + + + + Textbox1 + 0.07056cm + 0.06614cm + 0.58236cm + 19.58715cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + 0.79506in + + + + + + + Textbox1 + 2.43857cm + 0.6cm + 14.68354cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REPORTE DE SOLICITUDES DE ANTICIPO + + + + + + + + + + + + + + + + Textbox2 + 0.63528cm + 2.40329cm + 0.52945cm + 14.68354cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.06614cm + 2.22362cm + 2.33715cm + 2 + + + + + + + + + + + 1.61043cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.40041cm + 16.97887cm + 0.68085cm + 2.06587cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + IMPRESO EN SIG, Rep. Solicitudes Anticipo + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 0.40041cm + 0.06614cm + 0cm + 19.58715cm + 6 + + + + + + + + + + 29.7cm + 21cm + 0.5cm + 0.5cm + 1cm + 1cm + 0.13cm + - 3.1764cm + 4.4023cm + 0.01325cm 0cm 20.90669cm 4 @@ -2107,6 +2108,7 @@ 0.127cm + 0cm 0cm 20.90669cm 5 diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 4b128eac3..115a6f2cf 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -373,16 +373,16 @@ Partial Class OS_OrdenesServicios End If UpDetalleOS.Update() End Sub - Protected Sub DdlCCEdit_SelectedIndexChanged(sender As Object, e As System.EventArgs) - Dim gvr As GridViewRow = DirectCast(DirectCast(sender, DropDownList).BindingContainer, GridViewRow) - Dim CveProyecto As String = DirectCast(sender, DropDownList).SelectedValue + 'Protected Sub DdlCCEdit_SelectedIndexChanged(sender As Object, e As System.EventArgs) + ' Dim gvr As GridViewRow = DirectCast(DirectCast(sender, DropDownList).BindingContainer, GridViewRow) + ' Dim CveProyecto As String = DirectCast(sender, DropDownList).SelectedValue - gvr.FCDropDownList("DDlSubProyecto").Items.Clear() - gvr.FCDropDownList("DDlSubProyecto").DataSource = GlobalDTSubProyectos(CveProyecto.ToEntero) - gvr.FCDropDownList("DDlSubProyecto").DataBind() - gvr.FCDropDownList("DDlSubProyecto").Items.Insert(0, New ListItem("Sin SubProyecto Asignado", "-1")) + ' gvr.FCDropDownList("DDlSubProyecto").Items.Clear() + ' gvr.FCDropDownList("DDlSubProyecto").DataSource = GlobalDTSubProyectos(CveProyecto.ToEntero) + ' gvr.FCDropDownList("DDlSubProyecto").DataBind() + ' gvr.FCDropDownList("DDlSubProyecto").Items.Insert(0, New ListItem("Sin SubProyecto Asignado", "-1")) - End Sub + 'End Sub Protected Sub DdlFR_SelectedIndexChanged(sender As Object, e As EventArgs) Dim DdlFR_Gv As DropDownList = CType(sender, DropDownList) Dim index As Integer = CType(DdlFR_Gv.NamingContainer, GridViewRow).FCLiteral("LtlConsecutivo").Text.ToString.ToEntero @@ -1303,6 +1303,7 @@ Partial Class OS_OrdenesServicios TmpDT.Rows(Row.RowIndex)("Estatus") = "False" Row.FCLinkButton("imgEstatus").CssClass = "btn btn-circle btn-sm red" End If + UpDetalleOS.Update() End Sub Private Sub BtnAddGvDetalle_Click(sender As Object, e As EventArgs) Handles BtnAddGvDetalle.Click Dim ObjOS As New ClsOS From fb772cb31e2cd4c980a03b72b8018c20b1072d20 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 8 Nov 2019 09:30:50 -0700 Subject: [PATCH 16/24] Metodo para informacion de eventos en el servicio web --- App_Code/ClsTSoft.vb | 19 +++ App_Code/WsTSoft.vb | 245 --------------------------- Sistemas/PopUpAddUsuario.aspx | 17 +- asmx/WsTSoft.asmx | 303 +++++++++++++++++++++++++++++++++- 4 files changed, 336 insertions(+), 248 deletions(-) delete mode 100644 App_Code/WsTSoft.vb diff --git a/App_Code/ClsTSoft.vb b/App_Code/ClsTSoft.vb index a32fc01e2..dabf2e49f 100644 --- a/App_Code/ClsTSoft.vb +++ b/App_Code/ClsTSoft.vb @@ -129,6 +129,25 @@ Public Class ClsTSoft OnError("Ocurrió un Error al obtener la información para PENSKE.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try + Return Retorno + End Function + Public Function GetInfoEventosPenske(FechaI As DateTime, FechaF As DateTime) As Boolean + Dim Retorno As Boolean = False + + SqlDataAdapter("PA_GPS_GetInfoEventosPenske") + + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaI + .Add("@FechaFin", SqlDbType.DateTime).Value = FechaF + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un Error al obtener la información para PENSKE.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno End Function diff --git a/App_Code/WsTSoft.vb b/App_Code/WsTSoft.vb deleted file mode 100644 index f35547537..000000000 --- a/App_Code/WsTSoft.vb +++ /dev/null @@ -1,245 +0,0 @@ -Imports System.Web -Imports System.Web.Services -Imports System.Web.Services.Protocols -Imports System.Collections.Generic -Imports System.Linq -Imports Extensiones -Imports Newtonsoft.Json - -' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. -' _ - - - -Public Class WsTSoft - Inherits System.Web.Services.WebService - - - Public Function AddRemision(FolioRemision As String, NoEconomico As String, CveEstatus As Integer, GeoInicial As String, GeoCarga As String, GeoEntrega As String, Fecha As String) As String - Dim retorno As String = "" - Dim objTsoft As New ClsTSoft - objTsoft.IniciaTransacSQL() - Dim Continuar As Boolean = objTsoft.AddRemisiones(FolioRemision, NoEconomico, CveEstatus, GeoInicial, GeoCarga, GeoEntrega, Fecha) - Dim objRem As New addRemisionObj - If Continuar Then - objTsoft.Commit() - objRem.CveRemision = objTsoft.DtResultados.Rows(0)("CveRemision").ToString().ToEntero() - objRem.CurrentError = "" - Else - objTsoft.RollBack() - objRem.CveRemision = 0 - objRem.CurrentError = objTsoft.MyCurrentError - End If - objTsoft.Dispose() - retorno = JsonConvert.SerializeObject(objRem) - Return retorno.ToString - End Function - - - Public Function UpEstatusRemision(FolioRemision As String, CveEstatus As String) As String - Dim retorno As String = "" - Dim objTsoft As New ClsTSoft - Dim Continuar As Boolean = objTsoft.UpEstatusRemision(FolioRemision, CveEstatus) - Dim objRem As New upEstatusRemisionObj - If Continuar Then - objRem.SeActualizo = 1 - objRem.CurrentError = "" - Else - objRem.SeActualizo = 0 - objRem.CurrentError = objTsoft.MyCurrentError - End If - objTsoft.Dispose() - retorno = JsonConvert.SerializeObject(objRem) - Return retorno.ToString - End Function - - Public Function GetUltimaPosicion(DevID As String) As String - Dim retorno As String = "" - Dim ObjGPS As New ClsGPS - Dim Continuar As Boolean = ObjGPS.UltimaPosicionEquipoGetWS(DevID) - Dim ObjPos As New LatLng - If Continuar Then - ObjPos.Lat = ObjGPS.DtResultados.Rows("0")("Lat").ToString - ObjPos.Lng = ObjGPS.DtResultados.Rows("0")("Lng").ToString - Else - ObjPos.CurrentError = "No se pudo obtener la posición." - End If - ObjGPS.Dispose() - retorno = JsonConvert.SerializeObject(ObjPos) - Return retorno.ToString - End Function - - Public Function TerminoRemision(FolioRemision As String, NoEconomico As String) As String - Dim retorno As String = "" - Dim objTsoft As New ClsTSoft - Dim Continuar As Boolean = objTsoft.UpEstatusRemision(FolioRemision, 6) - Dim objRem As New upEstatusRemisionObj - If Continuar Then - objRem.SeActualizo = 1 - objRem.CurrentError = "" - Else - objRem.SeActualizo = 0 - objRem.CurrentError = objTsoft.MyCurrentError - End If - objTsoft.Dispose() - retorno = JsonConvert.SerializeObject(objRem) - Return retorno.ToString - End Function - - Public Function GetRemisionHistorial(FolioRemision As String, NoEconomico As String) As String - Dim retorno As String = "" - Dim objTsoft As New ClsTSoft - Dim Continuar As Boolean = objTsoft.GETRemisionesHistorial(FolioRemision, NoEconomico) - Dim objRem As New GetRemisionHistorialesObj - If Continuar Then - objRem.Historial = objTsoft.DtResultados.DataTableToObject(Of GetRemisionHistorialsObj) - objRem.CurrentError = "" - Else - objRem.Historial = New List(Of GetRemisionHistorialsObj) - objRem.CurrentError = objTsoft.MyCurrentError - End If - objTsoft.Dispose() - retorno = JsonConvert.SerializeObject(objRem) - Return retorno.ToString - End Function - - Public Function TieneRemisionesActivas(NoEconomico As String) As String - Dim retorno As String = "" - Dim Continuar As Boolean = False - - Dim ObjTSoft As New ClsTSoft - Continuar = ObjTSoft.TieneRemisionesActivas(NoEconomico) - - Dim objRem As New MTieneRemisiones With - { - .TieneRemisiones = Continuar, - .CurrentError = ObjTSoft.MyCurrentError - } - ObjTSoft.Dispose() - retorno = JsonConvert.SerializeObject(objRem) - Return retorno - End Function - - Public Class addRemisionObj - Public CveRemision As Integer - Public CurrentError As String - End Class - - Public Class upEstatusRemisionObj - Public SeActualizo As Integer - Public CurrentError As String - End Class - - Public Class MTieneRemisiones - Public TieneRemisiones As Boolean - Public CurrentError As String - End Class - - Public Class LatLng - Public Lat As String - Public Lng As String - Public CurrentError As String - End Class - - Public Class GetRemisionHistorialsObj - Public Property Fecha As DateTime - Public Property FolioRemision As String - Public Property NoEconomico As String - Public Property Lat As String - Public Property Lon As String - Public Property Distancia As String - Public Property TrackingNumber As String - Public Property CveEstatus As Integer - End Class - - Public Class GetRemisionHistorialesObj - Public Historial As List(Of GetRemisionHistorialsObj) - Public CurrentError As String - End Class - - - Public Class ObjRemisiones - - Public Property cveRemisiones() As Integer - Get - Return m_cveRemisiones - End Get - Set - m_cveRemisiones = Value - End Set - End Property - Private m_cveRemisiones As Integer - Public Property folioRemision() As String - Get - Return m_folioRemision - End Get - Set - m_folioRemision = Value - End Set - End Property - Private m_folioRemision As String - Public Property cveDispositivo() As Integer - Get - Return m_cveDispositivo - End Get - Set - m_cveDispositivo = Value - End Set - End Property - Private m_cveDispositivo As Integer - Public Property iMEI() As String - Get - Return m_iMEI - End Get - Set - m_iMEI = Value - End Set - End Property - Private m_iMEI As String - Public Property cveEstatus() As Integer - Get - Return m_cveEstatus - End Get - Set - m_cveEstatus = Value - End Set - End Property - Private m_cveEstatus As Integer - Public Property geoInicio() As String - Get - Return m_geoInicio - End Get - Set - m_geoInicio = Value - End Set - End Property - Private m_geoInicio As String - Public Property geoFin() As String - Get - Return m_geoFin - End Get - Set - m_geoFin = Value - End Set - End Property - Private m_geoFin As String - Public Property lat() As String - Get - Return m_lat - End Get - Set - m_lat = Value - End Set - End Property - Private m_lat As String - Public Property lon() As String - Get - Return m_lon - End Get - Set - m_lon = Value - End Set - End Property - Private m_lon As String - End Class -End Class \ No newline at end of file diff --git a/Sistemas/PopUpAddUsuario.aspx b/Sistemas/PopUpAddUsuario.aspx index 9d685feb4..631fef59b 100644 --- a/Sistemas/PopUpAddUsuario.aspx +++ b/Sistemas/PopUpAddUsuario.aspx @@ -495,7 +495,7 @@ if (this.checked) { total = total + 1; } - if (total == 5) { + if (total == 7) { alert("Ya tiene el maximo numero de comandos favoritos para asignar."); this.checked = false; return false; @@ -513,9 +513,22 @@ } for (let i = thantes; i < thclick; i++) { let th = $(''); - let input = $('') + let input = $('') th.append(input); + var total = 0; input.click(function () { + var total = 0; + $(".ChecaFavoritos > input").each(function () { + + if (this.checked) { + total = total + 1; + } + if (total == 7) { + alert("Ya tiene el maximo numero de comandos favoritos para asignar."); + this.checked = false; + return false; + } + }); $('#' + gv + ' tr td:nth-child(' + i + ') input[type="checkbox"]:not([disabled="disabled"])').prop("checked", input.is(":checked")) }); tr.append(th); diff --git a/asmx/WsTSoft.asmx b/asmx/WsTSoft.asmx index 2ef85eaa7..94e8b0ab4 100644 --- a/asmx/WsTSoft.asmx +++ b/asmx/WsTSoft.asmx @@ -1 +1,302 @@ -<%@ WebService Language="VB" CodeBehind="~/App_Code/WsTSoft.vb" Class="WsTSoft" %> +<%@ WebService Language="VB" Class="WsTSoft" %> +Imports System.Web +Imports System.Net.Http +Imports System.Web.Services +Imports System.Data +Imports System.Web.Services.Protocols +Imports System.Collections.Generic +Imports System.Linq +Imports Extensiones +Imports Newtonsoft.Json +Imports Newtonsoft.Json.Linq + +' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. +' _ + + + +Public Class WsTSoft + Inherits System.Web.Services.WebService + + + Public Function AddRemision(FolioRemision As String, NoEconomico As String, CveEstatus As Integer, GeoInicial As String, GeoCarga As String, GeoEntrega As String, Fecha As String) As String + Dim retorno As String = "" + Dim objTsoft As New ClsTSoft + objTsoft.IniciaTransacSQL() + Dim Continuar As Boolean = objTsoft.AddRemisiones(FolioRemision, NoEconomico, CveEstatus, GeoInicial, GeoCarga, GeoEntrega, Fecha) + Dim objRem As New addRemisionObj + If Continuar Then + objTsoft.Commit() + objRem.CveRemision = objTsoft.DtResultados.Rows(0)("CveRemision").ToString().ToEntero() + objRem.CurrentError = "" + Else + objTsoft.RollBack() + objRem.CveRemision = 0 + objRem.CurrentError = objTsoft.MyCurrentError + End If + objTsoft.Dispose() + retorno = JsonConvert.SerializeObject(objRem) + Return retorno.ToString + End Function + + + Public Function UpEstatusRemision(FolioRemision As String, CveEstatus As String) As String + Dim retorno As String = "" + Dim objTsoft As New ClsTSoft + Dim Continuar As Boolean = objTsoft.UpEstatusRemision(FolioRemision, CveEstatus) + Dim objRem As New upEstatusRemisionObj + If Continuar Then + objRem.SeActualizo = 1 + objRem.CurrentError = "" + Else + objRem.SeActualizo = 0 + objRem.CurrentError = objTsoft.MyCurrentError + End If + objTsoft.Dispose() + retorno = JsonConvert.SerializeObject(objRem) + Return retorno.ToString + End Function + + Public Function GetUltimaPosicion(DevID As String) As String + Dim retorno As String = "" + Dim ObjGPS As New ClsGPS + Dim Continuar As Boolean = ObjGPS.UltimaPosicionEquipoGetWS(DevID) + Dim ObjPos As New LatLng + If Continuar Then + ObjPos.Lat = ObjGPS.DtResultados.Rows("0")("Lat").ToString + ObjPos.Lng = ObjGPS.DtResultados.Rows("0")("Lng").ToString + Else + ObjPos.CurrentError = "No se pudo obtener la posición." + End If + ObjGPS.Dispose() + retorno = JsonConvert.SerializeObject(ObjPos) + Return retorno.ToString + End Function + + Public Function TerminoRemision(FolioRemision As String, NoEconomico As String) As String + Dim retorno As String = "" + Dim objTsoft As New ClsTSoft + Dim Continuar As Boolean = objTsoft.UpEstatusRemision(FolioRemision, 6) + Dim objRem As New upEstatusRemisionObj + If Continuar Then + objRem.SeActualizo = 1 + objRem.CurrentError = "" + Else + objRem.SeActualizo = 0 + objRem.CurrentError = objTsoft.MyCurrentError + End If + objTsoft.Dispose() + retorno = JsonConvert.SerializeObject(objRem) + Return retorno.ToString + End Function + + Public Function GetRemisionHistorial(FolioRemision As String, NoEconomico As String) As String + Dim retorno As String = "" + Dim objTsoft As New ClsTSoft + Dim Continuar As Boolean = objTsoft.GETRemisionesHistorial(FolioRemision, NoEconomico) + Dim objRem As New GetRemisionHistorialesObj + If Continuar Then + objRem.Historial = objTsoft.DtResultados.DataTableToObject(Of GetRemisionHistorialsObj) + objRem.CurrentError = "" + Else + objRem.Historial = New List(Of GetRemisionHistorialsObj) + objRem.CurrentError = objTsoft.MyCurrentError + End If + objTsoft.Dispose() + retorno = JsonConvert.SerializeObject(objRem) + Return retorno.ToString + End Function + + Public Function GetInfoEventos(FechaInicio As String, FechaFin As String) As String + Dim retorno As String = "[]" + + Dim objTsoft As New ClsTSoft + If objTsoft.GetInfoEventosPenske(FechaInicio.ToDateTime(), FechaFin.ToDateTime()) Then + If objTsoft.DtResultados.Rows.Count > 0 Then + 'CONSULTA DIRECCIONES + Dim Direcciones As JArray = ConsultarDirecciones(objTsoft.DtResultados) + For Each Dir As JObject In Direcciones + objTsoft.DtResultados.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() + Next + + retorno = objTsoft.DtResultados.DataTableToJSONIPP() + Else + retorno = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.Mensaje = "No se encontraron resultados"}) + End If + Else + retorno = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.Mensaje = "Ocurrío un error al consultar los datos"}) + End If + objTsoft.Dispose() + + Return retorno.ToString + End Function + + Public Function TieneRemisionesActivas(NoEconomico As String) As String + Dim retorno As String = "" + Dim Continuar As Boolean = False + + Dim ObjTSoft As New ClsTSoft + Continuar = ObjTSoft.TieneRemisionesActivas(NoEconomico) + + Dim objRem As New MTieneRemisiones With + { + .TieneRemisiones = Continuar, + .CurrentError = ObjTSoft.MyCurrentError + } + ObjTSoft.Dispose() + retorno = JsonConvert.SerializeObject(objRem) + Return retorno + End Function + + + Public Function ConsultarDirecciones(Dt As DataTable) As JArray + Dim retorno As JArray = Nothing + Dim posicionesArray = New JArray(From Row As DataRow In Dt + Let index = Dt.Rows().IndexOf(Row) + Select New JObject( + New JProperty("indice", index), + New JProperty("cveTrama", -1), + New JProperty("lat", Row("Latitud").ToString.ToDouble), + New JProperty("lon", Row("Longitud").ToString.ToDouble) + )) + + Dim Base64array = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(posicionesArray.ToString())) + + Using wc As New HttpClient() + Try + Dim Url = New Uri($"{ClsPaginas.UrlDirecciones}nominatim/reverseMultiple.php") + Dim FormStuff = String.Format("formato=json&posiciones={0}", Base64array) + Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded") + Dim response = wc.PostAsync(Url, content).Result + Dim result = response.Content.ReadAsStringAsync().Result + retorno = JArray.Parse(result) + Catch ex As Exception + OnError("Ocurrió un error al obtener las direcciones", ex) + End Try + End Using + Return retorno + End Function + + Public Class addRemisionObj + Public CveRemision As Integer + Public CurrentError As String + End Class + + Public Class upEstatusRemisionObj + Public SeActualizo As Integer + Public CurrentError As String + End Class + + Public Class MTieneRemisiones + Public TieneRemisiones As Boolean + Public CurrentError As String + End Class + + Public Class LatLng + Public Lat As String + Public Lng As String + Public CurrentError As String + End Class + + Public Class GetRemisionHistorialsObj + Public Property Fecha As DateTime + Public Property FolioRemision As String + Public Property NoEconomico As String + Public Property Lat As String + Public Property Lon As String + Public Property Distancia As String + Public Property TrackingNumber As String + Public Property CveEstatus As Integer + End Class + + Public Class GetRemisionHistorialesObj + Public Historial As List(Of GetRemisionHistorialsObj) + Public CurrentError As String + End Class + + + Public Class ObjRemisiones + + Public Property cveRemisiones() As Integer + Get + Return m_cveRemisiones + End Get + Set + m_cveRemisiones = Value + End Set + End Property + Private m_cveRemisiones As Integer + Public Property folioRemision() As String + Get + Return m_folioRemision + End Get + Set + m_folioRemision = Value + End Set + End Property + Private m_folioRemision As String + Public Property cveDispositivo() As Integer + Get + Return m_cveDispositivo + End Get + Set + m_cveDispositivo = Value + End Set + End Property + Private m_cveDispositivo As Integer + Public Property iMEI() As String + Get + Return m_iMEI + End Get + Set + m_iMEI = Value + End Set + End Property + Private m_iMEI As String + Public Property cveEstatus() As Integer + Get + Return m_cveEstatus + End Get + Set + m_cveEstatus = Value + End Set + End Property + Private m_cveEstatus As Integer + Public Property geoInicio() As String + Get + Return m_geoInicio + End Get + Set + m_geoInicio = Value + End Set + End Property + Private m_geoInicio As String + Public Property geoFin() As String + Get + Return m_geoFin + End Get + Set + m_geoFin = Value + End Set + End Property + Private m_geoFin As String + Public Property lat() As String + Get + Return m_lat + End Get + Set + m_lat = Value + End Set + End Property + Private m_lat As String + Public Property lon() As String + Get + Return m_lon + End Get + Set + m_lon = Value + End Set + End Property + Private m_lon As String + End Class +End Class From 51c28b8448d1a6b114e6e39c2a5d4f17c27c4506 Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Fri, 8 Nov 2019 09:59:32 -0700 Subject: [PATCH 17/24] Totales de Formato de Situacion Financiera --- AC/RepSituacionFinanciera.aspx.vb | 1311 ++--- AC/Reportes/RepSituacionFinanciera.rdlc | 6182 ++++++++++++----------- 2 files changed, 3753 insertions(+), 3740 deletions(-) diff --git a/AC/RepSituacionFinanciera.aspx.vb b/AC/RepSituacionFinanciera.aspx.vb index 9a029a39f..36109f21b 100644 --- a/AC/RepSituacionFinanciera.aspx.vb +++ b/AC/RepSituacionFinanciera.aspx.vb @@ -1,655 +1,656 @@ -Option Explicit On -Option Strict On - -Imports System.Data -Imports Extensiones -Imports Microsoft.Reporting.WebForms -Partial Class AC_SituacionFinanciera - 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 DtCuentasOrden As DataTable - Get - DtCuentasOrden = DirectCast(ViewState("DtCuentasOrden"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtCuentasOrden") = value - End Set - End Property - Private Property TotalActivoActual As Double - Get - TotalActivoActual = ViewState("TotalActivoActual").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalActivoActual") = value - End Set - End Property - Private Property TotalActivoAnterior As Double - Get - TotalActivoAnterior = ViewState("TotalActivoAnterior").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalActivoAnterior") = value - End Set - End Property - Private Property TotalPasivoActual As Double - Get - TotalPasivoActual = ViewState("TotalPasivoActual").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalPasivoActual") = value - End Set - End Property - Private Property TotalPasivoAnterior As Double - Get - TotalPasivoAnterior = ViewState("TotalPasivoAnterior").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalPasivoAnterior") = value - End Set - End Property - Private Property TotalPatrimonioActual As Double - Get - TotalPatrimonioActual = ViewState("TotalPatrimonioActual").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalPatrimonioActual") = value - End Set - End Property - Private Property TotalPatrimonioAnterior As Double - Get - TotalPatrimonioAnterior = ViewState("TotalPatrimonioAnterior").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalPatrimonioAnterior") = value - End Set - End Property - Private Property TotalPasivoPatrimonioActual As Double - Get - TotalPasivoPatrimonioActual = ViewState("TotalPasivoPatrimonioActual").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalPasivoPatrimonioActual") = value - End Set - End Property - Private Property TotalPasivoPatrimonioAnterior As Double - Get - TotalPasivoPatrimonioAnterior = ViewState("TotalPasivoPatrimonioAnterior").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalPasivoPatrimonioAnterior") = value - End Set - End Property - Private Property FechaInicioActual As Date - Get - FechaInicioActual = ViewState("FechaInicioActual").ToString.ToDate - End Get - Set(value As Date) - ViewState("FechaInicioActual") = value - End Set - End Property - Private Property FechaFinActual As Date - Get - FechaFinActual = ViewState("FechaFinActual").ToString.ToDate - End Get - Set(value As Date) - ViewState("FechaFinActual") = value - End Set - End Property - Private Property FechaInicioAnterior As Date - Get - FechaInicioAnterior = ViewState("FechaInicioAnterior").ToString.ToDate - End Get - Set(value As Date) - ViewState("FechaInicioAnterior") = value - End Set - End Property - Private Property FechaFinAnterior As Date - Get - FechaFinAnterior = ViewState("FechaFinAnterior").ToString.ToDate - End Get - Set(value As Date) - ViewState("FechaFinAnterior") = value - End Set - End Property - Private Property TipoReporte As Integer - Get - TipoReporte = ViewState("TipoReporte").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("TipoReporte") = value - End Set - End Property -#End Region - - Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load - If Not Page.IsPostBack Then - - If UsuarioActual.Empresa.UsaAC Then - TipoReporte = -1 - Else - TipoReporte = 1 - tdTipoReporte.Visible = True - LtTitulo.Text = "Balance General" - End If - - - TotalActivoActual = 0 - TotalActivoAnterior = 0 - TotalPasivoActual = 0 - TotalPasivoAnterior = 0 - TotalPatrimonioActual = 0 - TotalPatrimonioAnterior = 0 - TotalPasivoPatrimonioActual = 0 - TotalPasivoPatrimonioAnterior = 0 - - 'TxtFechaInicio.Text = DateSerial(Year(Date.Now), 1, 1).ToShortDateString - 'TxtFechaFin.Text = Date.Now.ToShortDateString - - CargaEjercicios() - - CargaDatos() - - - End If - End Sub - - Private Sub CargaEjercicios() - Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa) - If ClsConta.GetEjercicios() Then - DdlEjercicio.DataSource = ClsConta.DtResultados - Else - DdlEjercicio.DataSource = Nothing - End If - ClsConta.Dispose() - DdlEjercicio.DataBind() - - DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString) - DdlPeriodo.SelectedValue = Now.Month.ToString - End Sub - - Private Sub CargaDatos() - Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) - - Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) - Dim FechaF = FechaI.ToDate.LastDayOfMonth.ToShortDateString - TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero) - - GvActivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue - GvActivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString - - GvPasivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue - GvPasivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString - - Dim IdCuentaAhorroDesahorro = 9999 - - If UsuarioActual.CveEmpresa = 48 Then - IdCuentaAhorroDesahorro = 87 - End If - If UsuarioActual.CveEmpresa = 120 Then - IdCuentaAhorroDesahorro = 646 - End If - - If ObjConta.GetBalanceGeneral("01/01/1000".ToDate, FechaF.ToDate, UsuarioActual.CveEmpresa, TipoReporte, UsuarioActual.Empresa.UsaAC, IdCuentaAhorroDesahorro) Then - DtDatos = ObjConta.DtResultados - - CargaGrids() - SumaTotales() - Else - DtDatos = Nothing - Alert("Ocurrio un error al cargar los datos del estado de situación financiera", TipoMensaje.MsgError) - End If - - ObjConta.Dispose() - End Sub - Private Sub CargaGrids() - - If Not ChkNivel.Checked Then - DtDatos = DtDatos.FiltraParametros("Level < 2") - End If - Dim CuentaAhorroDesahorro As Integer = 87 - - Select Case UsuarioActual.CveEmpresa - Case 120 - CuentaAhorroDesahorro = 646 - Case Else - CuentaAhorroDesahorro = 87 - End Select - - 'Defino Variables para el Orden - Dim Orden1, Orden2, Orden3, Orden4, Orden5, Orden6, Orden7 As String - If UsuarioActual.CveEmpresa = 48 Then Orden1 = "00011%" Else Orden1 = "011%" - If UsuarioActual.CveEmpresa = 48 Then Orden2 = "00012%" Else Orden2 = "012%" - If UsuarioActual.CveEmpresa = 48 Then Orden3 = "00021%" Else Orden3 = "021%" - If UsuarioActual.CveEmpresa = 48 Then Orden4 = "00022%" Else Orden4 = "022%" - If UsuarioActual.CveEmpresa = 48 Then Orden5 = "00031%" Else If UsuarioActual.CveEmpresa = 120 Then Orden5 = "0321%" Else Orden5 = "031%" - If UsuarioActual.CveEmpresa = 48 Then Orden6 = "00032%" Else Orden6 = "032%" - If UsuarioActual.CveEmpresa = 48 Then Orden7 = "00033%" Else Orden7 = "033%" - - 'ACTIVO - Dim DtActivoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden1}' ") - - Dim DtActivoNoCirculante As DataTable - - If UsuarioActual.CveEmpresa = 48 Then - DtActivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden2}' ") - Else - DtActivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden2}' ") - End If - - Dim Row As DataRow = DtActivoCirculante.NewRow - - If DtActivoCirculante.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL ACTIVO CIRCULANTE" - Row.Item("ImporteActual") = DtActivoCirculante.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtActivoCirculante.Rows(0)("ImporteAnterior").ToString - Row.Item("CtaMayor") = -1 - DtActivoCirculante.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL ACTIVO CIRCULANTE" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtActivoCirculante.Rows.Add(Row) - - - Row = DtActivoNoCirculante.NewRow - If DtActivoNoCirculante.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL ACTIVO NO CIRCULANTE" - - If UsuarioActual.CveEmpresa = 48 Then - Row.Item("ImporteActual") = DtActivoNoCirculante.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtActivoNoCirculante.Rows(0)("ImporteAnterior").ToString - ElseIf UsuarioActual.CveEmpresa = 120 Then - Row.Item("ImporteActual") = DtActivoNoCirculante.SUM("ImporteActual", " Sup ='ACTIVO NO CIRCULANTE' ") - Row.Item("ImporteAnterior") = DtActivoNoCirculante.SUM("ImporteAnterior", " Sup ='ACTIVO NO CIRCULANTE' ") - Else - Row.Item("ImporteActual") = DtActivoNoCirculante.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtActivoNoCirculante.Rows(0)("ImporteAnterior").ToString - End If - - - Row.Item("CtaMayor") = -1 - DtActivoNoCirculante.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL ACTIVO NO CIRCULANTE" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtActivoNoCirculante.Rows.Add(Row) - - GvActivo.DataSource = DtActivoCirculante - GvActivo.DataBind() - GvActivoNoCirculante.DataSource = DtActivoNoCirculante - GvActivoNoCirculante.DataBind() - UpActivo.Update() - - - 'PASIVO - Dim DtPasivoCirculante = DtDatos.FiltraParametros($"Tipo in ('D') AND Orden LIKE '{Orden3}' ") - Dim DtPasivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('D') AND Orden LIKE '{Orden4}' ") - - Row = DtPasivoCirculante.NewRow - If DtPasivoCirculante.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL PASIVO CIRCULANTE" - Row.Item("ImporteActual") = DtPasivoCirculante.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtPasivoCirculante.Rows(0)("ImporteAnterior").ToString - Row.Item("CtaMayor") = -1 - DtPasivoCirculante.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL PASIVO CIRCULANTE" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtPasivoCirculante.Rows.Add(Row) - - Row = DtPasivoNoCirculante.NewRow - If DtPasivoNoCirculante.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL PASIVO NO CIRCULANTE" - Row.Item("ImporteActual") = DtPasivoNoCirculante.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtPasivoNoCirculante.Rows(0)("ImporteAnterior").ToString - Row.Item("CtaMayor") = -1 - DtPasivoNoCirculante.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL PASIVO NO CIRCULANTE" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtPasivoNoCirculante.Rows.Add(Row) - - - GvPasivo.DataSource = DtPasivoCirculante - GvPasivo.DataBind() - GvPasivoNoCirculante.DataSource = DtPasivoNoCirculante - GvPasivoNoCirculante.DataBind() - UpPasivo.Update() - - - 'PATRIMONIO - Dim DtPatrimonioContribuido = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden5}' ") - Dim DtPatrimonioGenerado = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden6}' ") - Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden7}' ") - - Row = DtPatrimonioContribuido.NewRow - If DtPatrimonioContribuido.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL PATRIMONIO CONTRIBUIDO" - Row.Item("ImporteActual") = DtPatrimonioContribuido.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtPatrimonioContribuido.Rows(0)("ImporteAnterior").ToString - Row.Item("CtaMayor") = -1 - DtPatrimonioContribuido.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL PATRIMONIO CONTRIBUIDO" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtPatrimonioContribuido.Rows.Add(Row) - - Row = DtPatrimonioGenerado.NewRow - If DtPatrimonioGenerado.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL PATRIMONIO GENERADO" - 'El id = 87 es el id de la cuenta "RESULTADOS DEL EJERCICIO:(AHORRO/DESAHORRO)" - If DtPatrimonioGenerado.FiltraParametros($"Id = {CuentaAhorroDesahorro}").Rows.Count > 0 Then - Row.Item("ImporteActual") = (DtPatrimonioGenerado.Rows(0)("ImporteActual").ToString.ToDouble + DtPatrimonioGenerado.FiltroPrimero($"Id = {CuentaAhorroDesahorro}")("ImporteActual").ToString.ToDouble).ToString - Row.Item("ImporteAnterior") = (DtPatrimonioGenerado.Rows(0)("ImporteAnterior").ToString.ToDouble + DtPatrimonioGenerado.FiltroPrimero($"Id = {CuentaAhorroDesahorro}")("ImporteAnterior").ToString.ToDouble).ToString - Else - Row.Item("ImporteActual") = DtPatrimonioGenerado.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtPatrimonioGenerado.Rows(0)("ImporteAnterior").ToString - End If - Row.Item("CtaMayor") = -1 - DtPatrimonioGenerado.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL PATRIMONIO GENERADO" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtPatrimonioGenerado.Rows.Add(Row) - - Row = DtPatrimonioActualizacion.NewRow - If DtPatrimonioActualizacion.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION" - Row.Item("ImporteActual") = DtPatrimonioActualizacion.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtPatrimonioActualizacion.Rows(0)("ImporteAnterior").ToString - Row.Item("CtaMayor") = -1 - DtPatrimonioActualizacion.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtPatrimonioActualizacion.Rows.Add(Row) - - - GvPatrimonio.DataSource = DtPatrimonioContribuido - GvPatrimonio.DataBind() - GvPatrimonioGenerado.DataSource = DtPatrimonioGenerado - GvPatrimonioGenerado.DataBind() - GvPatrimonioActualizacion.DataSource = DtPatrimonioActualizacion - GvPatrimonioActualizacion.DataBind() - UpPatrimonio.Update() - End Sub - Private Sub SumaTotales() - TotalPasivoPatrimonioActual = TotalPasivoActual + TotalPatrimonioActual - TotalPasivoPatrimonioAnterior = TotalPasivoAnterior + TotalPatrimonioAnterior - - 'Llena Lb´s Totales - LbTotalActivoActual.Text = TotalActivoActual.ToString.FormatoNumero - LbTotalActivoAnterior.Text = TotalActivoAnterior.ToString.FormatoNumero - - LbTotalPasivoActual.Text = TotalPasivoActual.ToString.FormatoNumero - LbTotalPasivoAnterior.Text = TotalPasivoAnterior.ToString.FormatoNumero - - LbTotalPatrimonioActual.Text = TotalPatrimonioActual.ToString.FormatoNumero - LbTotalPatrimonioAnterior.Text = TotalPatrimonioAnterior.ToString.FormatoNumero - - LbTotalPasivoPatrimonioActual.Text = TotalPasivoPatrimonioActual.ToString.FormatoNumero - LbTotalPasivoPatrimonioAnterior.Text = TotalPasivoPatrimonioAnterior.ToString.FormatoNumero - - - Dim Descuadre = False - 'COLOREA ROJO SI NO CUADRAN TOTALES - If TotalActivoActual <> TotalPasivoPatrimonioActual Then - LbTotalActivoActual.ForeColor = Drawing.Color.Red - LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Red - Descuadre = True - Else - LbTotalActivoActual.ForeColor = Drawing.Color.Black - LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Black - End If - - If TotalActivoAnterior <> TotalPasivoPatrimonioAnterior Then - LbTotalActivoAnterior.ForeColor = Drawing.Color.Red - LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Red - Descuadre = True - Else - LbTotalActivoAnterior.ForeColor = Drawing.Color.Black - LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Black - End If - - If Descuadre Then - LbDescuadre.Text = "Las sumas de los totales están descuadradas." - Else - LbDescuadre.Text = "" - End If - - - End Sub - - Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click - 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) - 'Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) - 'Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy") - - 'If ObjConta.GetSituacionFinanciera("01/01/2000".ToDate, FechaF.ToDate, DdlTipoReporte.SelectedValue.ToEntero) Then - ' DtDatos = ObjConta.DtResultados - ' 'If ChkFirma.Checked = True Then - - ' ' Dim Row As DataRow = DtDatos.NewRow - ' ' Row.Item("Nombre") = String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de contabilidad", "") - ' ' Row.Item("Sup") = String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", "") - ' ' Row.Item("ImporteActual") = "0" - ' ' Row.Item("ImporteAnterior") = "0" - ' ' Row.Item("Tipo") = "Firma" - ' ' DtDatos.Rows.Add(Row) - ' 'End If - 'End If - 'ObjConta.Dispose() - - If Not IsNothing(DtDatos) Then - ImprimirReporte() - Else - Alert("No se econtró información para el reporte.", TipoMensaje.MsgAdvertencia) - End If - - End Sub - - - Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) - TotalActivoActual = 0 - TotalActivoAnterior = 0 - TotalPasivoActual = 0 - TotalPasivoAnterior = 0 - TotalPatrimonioActual = 0 - TotalPatrimonioAnterior = 0 - TotalPasivoPatrimonioActual = 0 - TotalPasivoPatrimonioAnterior = 0 - - CargaDatos() - End Sub - - -#Region "GV´S ROW DATA BOUND" - - Protected Sub GvActivo_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalActivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalActivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble - e.Row.FCLabel("LbNombre").Font.Italic = True - e.Row.FCLabel("LbNombre").Font.Bold = True - e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;") - Else - e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte) - e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte) - End If - - If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red - End If - If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - - If e.Row.DBCampo("Level").ToString = "2" Then - e.Row.FCLabel("LbNombre").Text = String.Format("   {0}", e.Row.DBCampo("Nombre").ToString) - ElseIf e.Row.DBCampo("Level").ToString = "1" Then - e.Row.FCLabel("LbNombre").Font.Bold = True - End If - - End If - End Sub - - Protected Sub GvPasivo_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - - 'Totales - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalPasivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalPasivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble - e.Row.FCLabel("LbNombre").Font.Italic = True - e.Row.FCLabel("LbNombre").Font.Bold = True - e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;") - 'Cuentas - Else - e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString) - End If - - - 'Colorea NEGATIVOS - If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red - End If - If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - - If e.Row.DBCampo("Level").ToString = "2" Then - e.Row.FCLabel("LbNombre").Text = String.Format("   {0}", e.Row.DBCampo("Nombre").ToString) - ElseIf e.Row.DBCampo("Level").ToString = "1" Then - e.Row.FCLabel("LbNombre").Font.Bold = True - End If - - End If - End Sub - - Protected Sub GvPatrimonio_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalPatrimonioActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalPatrimonioAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble - e.Row.FCLabel("LbNombre").Font.Italic = True - e.Row.FCLabel("LbNombre").Font.Bold = True - e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;") - 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray - 'e.Row.ControlStyle.ForeColor = Drawing.Color.White - 'e.Row.ControlStyle.Font.Bold = True - Else - e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString) - End If - - If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red - End If - If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - - If e.Row.DBCampo("Level").ToString = "2" Then - e.Row.FCLabel("LbNombre").Text = String.Format("   {0}", e.Row.DBCampo("Nombre").ToString) - ElseIf e.Row.DBCampo("Level").ToString = "1" Then - e.Row.FCLabel("LbNombre").Font.Bold = True - End If - - End If - End Sub - -#End Region - - Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click - If Not IsNothing(DtDatos) Then - ImprimirReporte("Excel") - Else - Alert("No se econtró información para el reporte.", TipoMensaje.MsgAdvertencia) - End If - End Sub - - - Private Sub ImprimirReporte(Optional Formato As String = "PDF") - Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) - Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy") - 'nombre del archivo a generar - Dim fileName As String = "EdoSituacionFinanciera" - 'ubicacion del rdlc - Dim reportpath As String = "AC/Reportes/RepSituacionFinanciera.rdlc" - - DtCuentasOrden = New DataTable - If Not DtCuentasOrden.Columns.Contains("Concepto") Then DtCuentasOrden.Columns.Add("Concepto", GetType(String)) - If Not DtCuentasOrden.Columns.Contains("Importe") Then DtCuentasOrden.Columns.Add("Importe", GetType(String)) - If Not DtCuentasOrden.Columns.Contains("Nivel") Then DtCuentasOrden.Columns.Add("Nivel", GetType(String)) - - Dim Dr = DtCuentasOrden.NewRow - Dr("Concepto") = "PRUEBA" - Dr("Importe") = "15236.85" - Dr("Nivel") = "1" - DtCuentasOrden.Rows.Add(Dr) - - Dim DDdr = DtCuentasOrden.NewRow - DDdr("Concepto") = "PRUEBA 2" - DDdr("Importe") = "15236.85" - DDdr("Nivel") = "2" - DtCuentasOrden.Rows.Add(DDdr) - - 'parametros a enviar al reporte - Dim lrds As New List(Of ReportDataSource) - Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = If(ChkNivel.Checked, DtDatos, DtDatos.FiltraParametros("Level < 2"))} - lrds.Add(rds) - - Dim rds1 As New ReportDataSource With {.Name = "DataSet2", .Value = If(DtCuentasOrden IsNot Nothing, DtCuentasOrden, New DataTable)} ' sino esta creado el objeto, lo creamos, para que no truene el reporte - lrds.Add(rds1) - - Dim params As New List(Of ReportParameter) - params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) - params.Add(New ReportParameter("CveEmpresa", UsuarioActual.CveEmpresa.ToString)) - params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri)) - If (UsuarioActual.CveEmpresa = 48 And ChkFirma.Checked) Then - params.Add(New ReportParameter("pFirma1", String.Format("Lic. Damian A. Benitez Alcantar{0}Director Administrativo", vbCrLf))) - params.Add(New ReportParameter("pFirma2", String.Format("Ing. Soraida Mesinas Reyes{0}Director General", vbCrLf))) - ElseIf (ChkFirma.Checked) Then - params.Add(New ReportParameter("pFirma1", String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de Contabilidad", vbCrLf))) - params.Add(New ReportParameter("pFirma2", String.Format("ING. Soraida Mesinas Reyes{0} Director General", vbCrLf))) - Else - params.Add(New ReportParameter("pFirma1", "")) - params.Add(New ReportParameter("pFirma2", "")) - End If - params.Add(New ReportParameter("pFechaFin", FechaF)) - ImprimirPDF(reportpath, lrds, params, fileName, Formato) - End Sub -End Class +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms +Partial Class AC_SituacionFinanciera + 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 DtCuentasOrden As DataTable + Get + DtCuentasOrden = DirectCast(ViewState("DtCuentasOrden"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtCuentasOrden") = value + End Set + End Property + Private Property TotalActivoActual As Double + Get + TotalActivoActual = ViewState("TotalActivoActual").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalActivoActual") = value + End Set + End Property + Private Property TotalActivoAnterior As Double + Get + TotalActivoAnterior = ViewState("TotalActivoAnterior").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalActivoAnterior") = value + End Set + End Property + Private Property TotalPasivoActual As Double + Get + TotalPasivoActual = ViewState("TotalPasivoActual").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalPasivoActual") = value + End Set + End Property + Private Property TotalPasivoAnterior As Double + Get + TotalPasivoAnterior = ViewState("TotalPasivoAnterior").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalPasivoAnterior") = value + End Set + End Property + Private Property TotalPatrimonioActual As Double + Get + TotalPatrimonioActual = ViewState("TotalPatrimonioActual").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalPatrimonioActual") = value + End Set + End Property + Private Property TotalPatrimonioAnterior As Double + Get + TotalPatrimonioAnterior = ViewState("TotalPatrimonioAnterior").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalPatrimonioAnterior") = value + End Set + End Property + Private Property TotalPasivoPatrimonioActual As Double + Get + TotalPasivoPatrimonioActual = ViewState("TotalPasivoPatrimonioActual").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalPasivoPatrimonioActual") = value + End Set + End Property + Private Property TotalPasivoPatrimonioAnterior As Double + Get + TotalPasivoPatrimonioAnterior = ViewState("TotalPasivoPatrimonioAnterior").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalPasivoPatrimonioAnterior") = value + End Set + End Property + Private Property FechaInicioActual As Date + Get + FechaInicioActual = ViewState("FechaInicioActual").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaInicioActual") = value + End Set + End Property + Private Property FechaFinActual As Date + Get + FechaFinActual = ViewState("FechaFinActual").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaFinActual") = value + End Set + End Property + Private Property FechaInicioAnterior As Date + Get + FechaInicioAnterior = ViewState("FechaInicioAnterior").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaInicioAnterior") = value + End Set + End Property + Private Property FechaFinAnterior As Date + Get + FechaFinAnterior = ViewState("FechaFinAnterior").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaFinAnterior") = value + End Set + End Property + Private Property TipoReporte As Integer + Get + TipoReporte = ViewState("TipoReporte").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("TipoReporte") = value + End Set + End Property +#End Region + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + + If UsuarioActual.Empresa.UsaAC Then + TipoReporte = -1 + Else + TipoReporte = 1 + tdTipoReporte.Visible = True + LtTitulo.Text = "Balance General" + End If + + + TotalActivoActual = 0 + TotalActivoAnterior = 0 + TotalPasivoActual = 0 + TotalPasivoAnterior = 0 + TotalPatrimonioActual = 0 + TotalPatrimonioAnterior = 0 + TotalPasivoPatrimonioActual = 0 + TotalPasivoPatrimonioAnterior = 0 + + 'TxtFechaInicio.Text = DateSerial(Year(Date.Now), 1, 1).ToShortDateString + 'TxtFechaFin.Text = Date.Now.ToShortDateString + + CargaEjercicios() + + CargaDatos() + + + End If + End Sub + + Private Sub CargaEjercicios() + Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa) + If ClsConta.GetEjercicios() Then + DdlEjercicio.DataSource = ClsConta.DtResultados + Else + DdlEjercicio.DataSource = Nothing + End If + ClsConta.Dispose() + DdlEjercicio.DataBind() + + DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString) + DdlPeriodo.SelectedValue = Now.Month.ToString + End Sub + + Private Sub CargaDatos() + Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) + + Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) + Dim FechaF = FechaI.ToDate.LastDayOfMonth.ToShortDateString + TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero) + + GvActivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue + GvActivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString + + GvPasivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue + GvPasivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString + + Dim IdCuentaAhorroDesahorro = 9999 + + If UsuarioActual.CveEmpresa = 48 Then + IdCuentaAhorroDesahorro = 87 + End If + If UsuarioActual.CveEmpresa = 120 Then + IdCuentaAhorroDesahorro = 646 + End If + + If ObjConta.GetBalanceGeneral("01/01/1000".ToDate, FechaF.ToDate, UsuarioActual.CveEmpresa, TipoReporte, UsuarioActual.Empresa.UsaAC, IdCuentaAhorroDesahorro) Then + DtDatos = ObjConta.DtResultados + + CargaGrids() + SumaTotales() + Else + DtDatos = Nothing + Alert("Ocurrio un error al cargar los datos del estado de situación financiera", TipoMensaje.MsgError) + End If + + ObjConta.Dispose() + End Sub + Private Sub CargaGrids() + + If Not ChkNivel.Checked Then + DtDatos = DtDatos.FiltraParametros("Level < 2") + End If + Dim CuentaAhorroDesahorro As Integer = 87 + + Select Case UsuarioActual.CveEmpresa + Case 120 + CuentaAhorroDesahorro = 646 + Case Else + CuentaAhorroDesahorro = 87 + End Select + + 'Defino Variables para el Orden + Dim Orden1, Orden2, Orden3, Orden4, Orden5, Orden6, Orden7 As String + If UsuarioActual.CveEmpresa = 48 Then Orden1 = "00011%" Else Orden1 = "011%" + If UsuarioActual.CveEmpresa = 48 Then Orden2 = "00012%" Else Orden2 = "012%" + If UsuarioActual.CveEmpresa = 48 Then Orden3 = "00021%" Else Orden3 = "021%" + If UsuarioActual.CveEmpresa = 48 Then Orden4 = "00022%" Else Orden4 = "022%" + If UsuarioActual.CveEmpresa = 48 Then Orden5 = "00031%" Else If UsuarioActual.CveEmpresa = 120 Then Orden5 = "0321%" Else Orden5 = "031%" + If UsuarioActual.CveEmpresa = 48 Then Orden6 = "00032%" Else Orden6 = "032%" + If UsuarioActual.CveEmpresa = 48 Then Orden7 = "00033%" Else Orden7 = "033%" + + 'ACTIVO + Dim DtActivoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden1}' ") + + Dim DtActivoNoCirculante As DataTable + + If UsuarioActual.CveEmpresa = 48 Then + DtActivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden2}' ") + Else + DtActivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden2}' ") + End If + + Dim Row As DataRow = DtActivoCirculante.NewRow + + If DtActivoCirculante.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL ACTIVO CIRCULANTE" + Row.Item("ImporteActual") = DtActivoCirculante.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtActivoCirculante.Rows(0)("ImporteAnterior").ToString + Row.Item("CtaMayor") = -1 + DtActivoCirculante.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL ACTIVO CIRCULANTE" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtActivoCirculante.Rows.Add(Row) + + + Row = DtActivoNoCirculante.NewRow + If DtActivoNoCirculante.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL ACTIVO NO CIRCULANTE" + + If UsuarioActual.CveEmpresa = 48 Then + Row.Item("ImporteActual") = DtActivoNoCirculante.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtActivoNoCirculante.Rows(0)("ImporteAnterior").ToString + ElseIf UsuarioActual.CveEmpresa = 120 Then + Row.Item("ImporteActual") = DtActivoNoCirculante.SUM("ImporteActual", " Sup ='ACTIVO NO CIRCULANTE' ") + Row.Item("ImporteAnterior") = DtActivoNoCirculante.SUM("ImporteAnterior", " Sup ='ACTIVO NO CIRCULANTE' ") + Else + Row.Item("ImporteActual") = DtActivoNoCirculante.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtActivoNoCirculante.Rows(0)("ImporteAnterior").ToString + End If + + + Row.Item("CtaMayor") = -1 + DtActivoNoCirculante.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL ACTIVO NO CIRCULANTE" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtActivoNoCirculante.Rows.Add(Row) + + GvActivo.DataSource = DtActivoCirculante + GvActivo.DataBind() + GvActivoNoCirculante.DataSource = DtActivoNoCirculante + GvActivoNoCirculante.DataBind() + UpActivo.Update() + + + 'PASIVO + Dim DtPasivoCirculante = DtDatos.FiltraParametros($"Tipo in ('D') AND Orden LIKE '{Orden3}' ") + Dim DtPasivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('D') AND Orden LIKE '{Orden4}' ") + + Row = DtPasivoCirculante.NewRow + If DtPasivoCirculante.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL PASIVO CIRCULANTE" + Row.Item("ImporteActual") = DtPasivoCirculante.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtPasivoCirculante.Rows(0)("ImporteAnterior").ToString + Row.Item("CtaMayor") = -1 + DtPasivoCirculante.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL PASIVO CIRCULANTE" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtPasivoCirculante.Rows.Add(Row) + + Row = DtPasivoNoCirculante.NewRow + If DtPasivoNoCirculante.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL PASIVO NO CIRCULANTE" + Row.Item("ImporteActual") = DtPasivoNoCirculante.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtPasivoNoCirculante.Rows(0)("ImporteAnterior").ToString + Row.Item("CtaMayor") = -1 + DtPasivoNoCirculante.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL PASIVO NO CIRCULANTE" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtPasivoNoCirculante.Rows.Add(Row) + + + GvPasivo.DataSource = DtPasivoCirculante + GvPasivo.DataBind() + GvPasivoNoCirculante.DataSource = DtPasivoNoCirculante + GvPasivoNoCirculante.DataBind() + UpPasivo.Update() + + + 'PATRIMONIO + Dim DtPatrimonioContribuido = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden5}' ") + Dim DtPatrimonioGenerado = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden6}' ") + Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden7}' ") + + Row = DtPatrimonioContribuido.NewRow + If DtPatrimonioContribuido.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL PATRIMONIO CONTRIBUIDO" + Row.Item("ImporteActual") = DtPatrimonioContribuido.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtPatrimonioContribuido.Rows(0)("ImporteAnterior").ToString + Row.Item("CtaMayor") = -1 + DtPatrimonioContribuido.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL PATRIMONIO CONTRIBUIDO" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtPatrimonioContribuido.Rows.Add(Row) + + Row = DtPatrimonioGenerado.NewRow + If DtPatrimonioGenerado.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL PATRIMONIO GENERADO" + 'El id = 87 es el id de la cuenta "RESULTADOS DEL EJERCICIO:(AHORRO/DESAHORRO)" + If DtPatrimonioGenerado.FiltraParametros($"Id = {CuentaAhorroDesahorro}").Rows.Count > 0 Then + Row.Item("ImporteActual") = (DtPatrimonioGenerado.Rows(0)("ImporteActual").ToString.ToDouble + DtPatrimonioGenerado.FiltroPrimero($"Id = {CuentaAhorroDesahorro}")("ImporteActual").ToString.ToDouble).ToString + Row.Item("ImporteAnterior") = (DtPatrimonioGenerado.Rows(0)("ImporteAnterior").ToString.ToDouble + DtPatrimonioGenerado.FiltroPrimero($"Id = {CuentaAhorroDesahorro}")("ImporteAnterior").ToString.ToDouble).ToString + Else + Row.Item("ImporteActual") = DtPatrimonioGenerado.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtPatrimonioGenerado.Rows(0)("ImporteAnterior").ToString + End If + Row.Item("CtaMayor") = -1 + DtPatrimonioGenerado.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL PATRIMONIO GENERADO" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtPatrimonioGenerado.Rows.Add(Row) + + Row = DtPatrimonioActualizacion.NewRow + If DtPatrimonioActualizacion.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION" + Row.Item("ImporteActual") = DtPatrimonioActualizacion.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtPatrimonioActualizacion.Rows(0)("ImporteAnterior").ToString + Row.Item("CtaMayor") = -1 + DtPatrimonioActualizacion.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtPatrimonioActualizacion.Rows.Add(Row) + + + GvPatrimonio.DataSource = DtPatrimonioContribuido + GvPatrimonio.DataBind() + GvPatrimonioGenerado.DataSource = DtPatrimonioGenerado + GvPatrimonioGenerado.DataBind() + GvPatrimonioActualizacion.DataSource = DtPatrimonioActualizacion + GvPatrimonioActualizacion.DataBind() + UpPatrimonio.Update() + End Sub + Private Sub SumaTotales() + TotalPasivoPatrimonioActual = TotalPasivoActual + TotalPatrimonioActual + TotalPasivoPatrimonioAnterior = TotalPasivoAnterior + TotalPatrimonioAnterior + + 'Llena Lb´s Totales + LbTotalActivoActual.Text = TotalActivoActual.ToString.FormatoNumero + LbTotalActivoAnterior.Text = TotalActivoAnterior.ToString.FormatoNumero + + LbTotalPasivoActual.Text = TotalPasivoActual.ToString.FormatoNumero + LbTotalPasivoAnterior.Text = TotalPasivoAnterior.ToString.FormatoNumero + + LbTotalPatrimonioActual.Text = TotalPatrimonioActual.ToString.FormatoNumero + LbTotalPatrimonioAnterior.Text = TotalPatrimonioAnterior.ToString.FormatoNumero + + LbTotalPasivoPatrimonioActual.Text = TotalPasivoPatrimonioActual.ToString.FormatoNumero + LbTotalPasivoPatrimonioAnterior.Text = TotalPasivoPatrimonioAnterior.ToString.FormatoNumero + + + Dim Descuadre = False + 'COLOREA ROJO SI NO CUADRAN TOTALES + If TotalActivoActual <> TotalPasivoPatrimonioActual Then + LbTotalActivoActual.ForeColor = Drawing.Color.Red + LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Red + Descuadre = True + Else + LbTotalActivoActual.ForeColor = Drawing.Color.Black + LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Black + End If + + If TotalActivoAnterior <> TotalPasivoPatrimonioAnterior Then + LbTotalActivoAnterior.ForeColor = Drawing.Color.Red + LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Red + Descuadre = True + Else + LbTotalActivoAnterior.ForeColor = Drawing.Color.Black + LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Black + End If + + If Descuadre Then + LbDescuadre.Text = "Las sumas de los totales están descuadradas." + Else + LbDescuadre.Text = "" + End If + + + End Sub + + Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click + 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) + 'Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) + 'Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy") + + 'If ObjConta.GetSituacionFinanciera("01/01/2000".ToDate, FechaF.ToDate, DdlTipoReporte.SelectedValue.ToEntero) Then + ' DtDatos = ObjConta.DtResultados + ' 'If ChkFirma.Checked = True Then + + ' ' Dim Row As DataRow = DtDatos.NewRow + ' ' Row.Item("Nombre") = String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de contabilidad", "") + ' ' Row.Item("Sup") = String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", "") + ' ' Row.Item("ImporteActual") = "0" + ' ' Row.Item("ImporteAnterior") = "0" + ' ' Row.Item("Tipo") = "Firma" + ' ' DtDatos.Rows.Add(Row) + ' 'End If + 'End If + 'ObjConta.Dispose() + + If Not IsNothing(DtDatos) Then + ImprimirReporte() + Else + Alert("No se econtró información para el reporte.", TipoMensaje.MsgAdvertencia) + End If + + End Sub + + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + TotalActivoActual = 0 + TotalActivoAnterior = 0 + TotalPasivoActual = 0 + TotalPasivoAnterior = 0 + TotalPatrimonioActual = 0 + TotalPatrimonioAnterior = 0 + TotalPasivoPatrimonioActual = 0 + TotalPasivoPatrimonioAnterior = 0 + + CargaDatos() + End Sub + + +#Region "GV´S ROW DATA BOUND" + + Protected Sub GvActivo_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then + TotalActivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble + TotalActivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble + e.Row.FCLabel("LbNombre").Font.Italic = True + e.Row.FCLabel("LbNombre").Font.Bold = True + e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;") + Else + e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte) + e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte) + End If + + If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red + End If + If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red + End If + + If e.Row.DBCampo("Level").ToString = "2" Then + e.Row.FCLabel("LbNombre").Text = String.Format("   {0}", e.Row.DBCampo("Nombre").ToString) + ElseIf e.Row.DBCampo("Level").ToString = "1" Then + e.Row.FCLabel("LbNombre").Font.Bold = True + End If + + End If + End Sub + + Protected Sub GvPasivo_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + + 'Totales + If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then + TotalPasivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble + TotalPasivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble + e.Row.FCLabel("LbNombre").Font.Italic = True + e.Row.FCLabel("LbNombre").Font.Bold = True + e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;") + 'Cuentas + Else + e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString) + e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString) + End If + + + 'Colorea NEGATIVOS + If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red + End If + If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red + End If + + If e.Row.DBCampo("Level").ToString = "2" Then + e.Row.FCLabel("LbNombre").Text = String.Format("   {0}", e.Row.DBCampo("Nombre").ToString) + ElseIf e.Row.DBCampo("Level").ToString = "1" Then + e.Row.FCLabel("LbNombre").Font.Bold = True + End If + + End If + End Sub + + Protected Sub GvPatrimonio_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then + TotalPatrimonioActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble + TotalPatrimonioAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble + e.Row.FCLabel("LbNombre").Font.Italic = True + e.Row.FCLabel("LbNombre").Font.Bold = True + e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;") + 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray + 'e.Row.ControlStyle.ForeColor = Drawing.Color.White + 'e.Row.ControlStyle.Font.Bold = True + Else + e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString) + e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString) + End If + + If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red + End If + If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red + End If + + If e.Row.DBCampo("Level").ToString = "2" Then + e.Row.FCLabel("LbNombre").Text = String.Format("   {0}", e.Row.DBCampo("Nombre").ToString) + ElseIf e.Row.DBCampo("Level").ToString = "1" Then + e.Row.FCLabel("LbNombre").Font.Bold = True + End If + + End If + End Sub + +#End Region + + Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click + If Not IsNothing(DtDatos) Then + ImprimirReporte("Excel") + Else + Alert("No se econtró información para el reporte.", TipoMensaje.MsgAdvertencia) + End If + End Sub + + + Private Sub ImprimirReporte(Optional Formato As String = "PDF") + Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) + Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy") + 'nombre del archivo a generar + Dim fileName As String = "EdoSituacionFinanciera" + 'ubicacion del rdlc + Dim reportpath As String = "AC/Reportes/RepSituacionFinanciera.rdlc" + + DtCuentasOrden = New DataTable + If Not DtCuentasOrden.Columns.Contains("Concepto") Then DtCuentasOrden.Columns.Add("Concepto", GetType(String)) + If Not DtCuentasOrden.Columns.Contains("Importe") Then DtCuentasOrden.Columns.Add("Importe", GetType(String)) + If Not DtCuentasOrden.Columns.Contains("Nivel") Then DtCuentasOrden.Columns.Add("Nivel", GetType(String)) + + Dim Dr = DtCuentasOrden.NewRow + Dr("Concepto") = "PRUEBA" + Dr("Importe") = "15236.85" + Dr("Nivel") = "1" + DtCuentasOrden.Rows.Add(Dr) + + Dim DDdr = DtCuentasOrden.NewRow + DDdr("Concepto") = "PRUEBA 2" + DDdr("Importe") = "15236.85" + DDdr("Nivel") = "2" + DtCuentasOrden.Rows.Add(DDdr) + + 'parametros a enviar al reporte + Dim lrds As New List(Of ReportDataSource) + Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = If(ChkNivel.Checked, DtDatos, DtDatos.FiltraParametros("Level < 2"))} + lrds.Add(rds) + + Dim rds1 As New ReportDataSource With {.Name = "DataSet2", .Value = If(DtCuentasOrden IsNot Nothing, DtCuentasOrden, New DataTable)} ' sino esta creado el objeto, lo creamos, para que no truene el reporte + lrds.Add(rds1) + + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("CveEmpresa", UsuarioActual.CveEmpresa.ToString)) + params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri)) + If (UsuarioActual.CveEmpresa = 48 And ChkFirma.Checked) Then + params.Add(New ReportParameter("pFirma1", String.Format("Lic. Damian A. Benitez Alcantar{0}Director Administrativo", vbCrLf))) + params.Add(New ReportParameter("pFirma2", String.Format("Ing. Soraida Mesinas Reyes{0}Director General", vbCrLf))) + ElseIf (ChkFirma.Checked) Then + params.Add(New ReportParameter("pFirma1", String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de Contabilidad", vbCrLf))) + params.Add(New ReportParameter("pFirma2", String.Format("ING. Soraida Mesinas Reyes{0} Director General", vbCrLf))) + Else + params.Add(New ReportParameter("pFirma1", "")) + params.Add(New ReportParameter("pFirma2", "")) + End If + params.Add(New ReportParameter("pFechaFin", FechaF)) + params.Add(New ReportParameter("Level2", If(ChkNivel.Checked, "SI", "NO"))) + ImprimirPDF(reportpath, lrds, params, fileName, Formato) + End Sub +End Class diff --git a/AC/Reportes/RepSituacionFinanciera.rdlc b/AC/Reportes/RepSituacionFinanciera.rdlc index 750d7f2cc..6665a3008 100644 --- a/AC/Reportes/RepSituacionFinanciera.rdlc +++ b/AC/Reportes/RepSituacionFinanciera.rdlc @@ -1,3086 +1,3098 @@ - - - 0 - - - - System.Data.DataSet - /* Local Connection */ - - 3560db3f-20af-4776-9f09-85925745c52f - - - - - - DataSet1 - /* Local Query */ - - - - Nombre - System.String - - - ImporteActual - System.Int16 - - - ImporteAnterior - System.Int16 - - - CtaMayor - System.Int16 - - - Orden - System.String - - - Tipo - System.String - - - Sup - System.String - - - Level - System.Int16 - - - TipoCuenta - System.Int16 - - - - DataSet1 - c:\users\caudillo\documents\visual studio 2013\Projects\WebApplication1\WebApplication1\DataSet1.xsd - ActivoCirculante - - - - - - - - - - - - - - - 6cm - - - 2.5cm - - - 2.20896cm - - - - - 0.6cm - - - - - true - true - - - - - ACTIVO CIRCULANTE - - - - - - - Textbox7 - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - 0.45cm - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - - - - - TOTAL ACTIVO CIRCULANTE - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteActual.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteAnterior.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - - - - - - - - - Before - - - - DataSet1 - - - =Fields!Tipo.Value - In - - =CStr("A,B,C").Split(",") - - - - =Fields!Orden.Value - Like - - =IIf(Parameters!CveEmpresa.Value = 48, "00011*", "011*") - - - - =Fields!CtaMayor.Value - NotEqual - - 3 - - - - 2.6512cm - 0.06568cm - 1.65cm - 10.70896cm - - - Verdana - 8pt - - - - - - - 6cm - - - 2.5cm - - - 2.20896cm - - - - - 0.6cm - - - - - true - true - - - - - ACTIVO NO CIRCULANTE - - - - - - - Textbox7 - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - 0.45cm - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - TOTAL ACTIVO NO CIRCULANTE - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteActual.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum( Fields!ImporteAnterior.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - - - - - - Before - - - - DataSet1 - - - =Fields!Tipo.Value - In - - =CStr("A,B,C").Split(",") - - - - =Fields!Orden.Value - Like - - =IIf(Parameters!CveEmpresa.Value = 48, "00012*", "012*") - - - - =Fields!CtaMayor.Value - NotEqual - - 3 - - - - 4.74417cm - 0.06568cm - 1.65cm - 10.70896cm - 1 - - - Verdana - 8pt - - - - - - - 5.10007cm - - - 2.1825cm - - - 2.17523cm - - - - - 0.6cm - - - - - true - true - - - - - PASIVO CIRCULANTE - - - - - - - Textbox7 - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - 0.45cm - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - TOTAL PASIVO CIRCULANTE - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteActual.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteAnterior.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - - - - - - Before - - - - DataSet1 - - - =Fields!Tipo.Value - Equal - - D - - - - =Fields!CtaMayor.Value - NotEqual - - 3 - - - - =Fields!Orden.Value - Like - - =IIf(Parameters!CveEmpresa.Value = 48, "00021*", "021*") - - - - 2.6512cm - 10.88047cm - 1.65cm - 9.4578cm - 2 - - - Verdana - 8pt - - - - - - - 5.14411cm - - - 2.1825cm - - - 2.13119cm - - - - - 0.6cm - - - - - true - true - - - - - PASIVO NO CIRCULANTE - - - - - - - Textbox7 - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - 0.45cm - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - TOTAL PASIVO NO CIRCULANTE - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteActual.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteAnterior.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - - - - - - Before - - - - DataSet1 - - - =Fields!Tipo.Value - Equal - - D - - - - =Fields!CtaMayor.Value - NotEqual - - 3 - - - - =Fields!Orden.Value - Like - - =IIf(Parameters!CveEmpresa.Value = 48, "00022*", "022*") - - - - 4.74417cm - 10.88047cm - 1.65cm - 9.4578cm - 3 - - - Verdana - 8pt - - - - true - true - - - - - ACTIVO - - - - - - - Textbox28 - 1.84891cm - 0.27028cm - 0.6cm - 9.7954cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - PASIVO - - - - - - - Textbox28 - 1.91009cm - 10.88047cm - 0.6cm - 8.40286cm - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 5.18815cm - - - 2.13846cm - - - 2.13119cm - - - - - 0.6cm - - - - - true - true - - - - - CAPITAL CONTABLE - - - - - - - Textbox7 - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - 0.45cm - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - TOTAL CAPITAL - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteActual.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteAnterior.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - - - - - - Before - - - - DataSet1 - - - =Fields!Tipo.Value - Equal - - F - - - - =Fields!CtaMayor.Value - NotEqual - - 3 - - - - 8.30193cm - 10.88047cm - 1.65cm - 9.4578cm - 6 - - - Verdana - 8pt - - - - true - true - - - - - CAPITAL - - - - - - - Textbox28 - 7.52554cm - 10.92451cm - 0.6cm - 9.41376cm - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Total del Activo - - - - - - - Textbox45 - 11.31317cm - 0.27027cm - 0.6cm - 4.81646cm - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalActivoAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalActivoActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Total CAPITAL - - - - - - - Textbox45 - 10.22837cm - 10.88047cm - 0.6cm - 3.1816cm - 11 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalPatrimonioHAnterior.Value + Variables!TotalPatrimonioCAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalPatrimonioHActual.Value + Variables!TotalPatrimonioCActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Total Pasivo y Patrimonio - - - - - - - Textbox45 - 11.31317cm - 10.77464cm - 0.6cm - 4.55974cm - 14 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalpasivoYHaciendaAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalpasivoYHaciendaActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Total del Pasivo: - - - - - - - Textbox45 - 6.57056cm - 10.88047cm - 0.6cm - 3.1816cm - 17 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalPasivoAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalPasivoActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Iif(round(Math.Abs(Variables!TotalActivoAnterior.Value-Variables!TotalpasivoYHaciendaAnterior.Value),2) <.005 AND Round(Math.Abs(Variables!TotalActivoActual.Value-Variables!TotalpasivoYHaciendaActual.Value),2) <.005,"" ,"La suma de los totales estan descuadradas." & round(Math.Abs(Variables!TotalActivoAnterior.Value-Variables!TotalpasivoYHaciendaAnterior.Value),2)) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - External - = Parameters!pImg.Value - FitProportional - 0.03141cm - 0.31432cm - 1.5cm - 1.5cm - 21 - - - - - - true - true - - - - - =Parameters!pEmp.Value - - - - - - - Textbox1 - 0.03141cm - 3.40996cm - 0.81167cm - 12.91455cm - 22 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Estado de Situación Financiera al - - - - =Parameters!pFechaFin.Value - - - - - - - Textbox5 - 0.89924cm - 3.40996cm - 0.6cm - 12.91455cm - 23 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="Fecha Impresión:" & vbcrlf & Format( Globals!ExecutionTime,"dd/MM/yyyy") - - - - - - - Textbox8 - 0.03141cm - 16.58113cm - 0.81167cm - 3.49249cm - 24 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 6cm - - - 2.5cm - - - 2.20896cm - - - - - 0.6cm - - - - - true - true - - - - - ACTIVO DIFERIDO - - - - - - - Textbox7 - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - 0.45cm - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - TOTAL ACTIVO DIFERIDO - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteActual.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteAnterior.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - - - - - - Before - - - - DataSet1 - - - =Fields!CtaMayor.Value - NotEqual - - 3 - - - - 6.92554cm - 0.06568cm - 1.65cm - 10.70896cm - 25 - - =IIf(Parameters!CveEmpresa.Value = 48,True,False) - - - - Verdana - 8pt - - - - 5.1587in - - - - =Parameters!pFechaFin.Value - - - - - - - Textbox5 - 3.454cm - 0.6cm - 12.91455cm - - = (Globals.PageNumber=1) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="Fecha Impresión:" & vbcrlf & Format( Globals!ExecutionTime,"dd/MM/yyyy") - - - - - - - Textbox8 - 0.02088cm - 16.62517cm - 0.57912cm - 3.49249cm - 1 - - = (Globals.PageNumber=1) - - - - 2pt - 2pt - - - - - - - - - 3.73062cm - true - true - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 3.13062cm - 16.37931cm - 0.6cm - 3.95896cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!pFirma2.Value - - - - Textbox2 - 0.10583cm - 1.71666cm - 0.99688cm - 8.02269cm - 1 - - = Iif((Globals.PageNumber=Globals.TotalPages) and (Parameters!pFirma2.Value <> ""),false,true) - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!pFirma1.Value - - - - Textbox2 - 2.73374cm - 6.03938cm - 0.99688cm - 8.02269cm - 2 - - = Iif((Globals.PageNumber=Globals.TotalPages) and (Parameters!pFirma1.Value <> ""),false,true) - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - - Textbox2 - 0.10582cm - 10.37435cm - 0.99688cm - 8.02269cm - 3 - - =Microsoft.VisualBasic.Interaction.Iif((Globals!PageNumber = Globals!TotalPages) And (Parameters!pFirma1.Value <> ""), False, True) - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0.5cm - 0.5cm - 1cm - 1cm - 0.13cm - + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + + + + + TOTAL ACTIVO CIRCULANTE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteActual.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteAnterior.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + In + + =CStr("A,B,C").Split(",") + + + + =Fields!Orden.Value + Like + + =IIf(Parameters!CveEmpresa.Value = 48, "00011*", "011*") + + + + =Fields!CtaMayor.Value + NotEqual + + 3 + + + + 2.6512cm + 0.06568cm + 1.65cm + 10.70896cm + + + Verdana + 8pt + + + + + + + 6cm + + + 2.5cm + + + 2.20896cm + + + + + 0.6cm + + + + + true + true + + + + + ACTIVO NO CIRCULANTE + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL ACTIVO NO CIRCULANTE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteActual.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteAnterior.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + In + + =CStr("A,B,C").Split(",") + + + + =Fields!Orden.Value + Like + + =IIf(Parameters!CveEmpresa.Value = 48, "00012*", "012*") + + + + =Fields!CtaMayor.Value + NotEqual + + 3 + + + + 4.74417cm + 0.06568cm + 1.65cm + 10.70896cm + 1 + + + Verdana + 8pt + + + + + + + 5.10007cm + + + 2.1825cm + + + 2.17523cm + + + + + 0.6cm + + + + + true + true + + + + + PASIVO CIRCULANTE + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL PASIVO CIRCULANTE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteActual.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteAnterior.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + Equal + + D + + + + =Fields!CtaMayor.Value + NotEqual + + 3 + + + + =Fields!Orden.Value + Like + + =IIf(Parameters!CveEmpresa.Value = 48, "00021*", "021*") + + + + 2.6512cm + 10.88047cm + 1.65cm + 9.4578cm + 2 + + + Verdana + 8pt + + + + + + + 5.14411cm + + + 2.1825cm + + + 2.13119cm + + + + + 0.6cm + + + + + true + true + + + + + PASIVO NO CIRCULANTE + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL PASIVO NO CIRCULANTE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteActual.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteAnterior.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + Equal + + D + + + + =Fields!CtaMayor.Value + NotEqual + + 3 + + + + =Fields!Orden.Value + Like + + =IIf(Parameters!CveEmpresa.Value = 48, "00022*", "022*") + + + + 4.74417cm + 10.88047cm + 1.65cm + 9.4578cm + 3 + + + Verdana + 8pt + + + + true + true + + + + + ACTIVO + + + + + + + Textbox28 + 1.84891cm + 0.27028cm + 0.6cm + 9.7954cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + PASIVO + + + + + + + Textbox28 + 1.91009cm + 10.88047cm + 0.6cm + 8.40286cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 5.18815cm + + + 2.13846cm + + + 2.13119cm + + + + + 0.6cm + + + + + true + true + + + + + CAPITAL CONTABLE + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL CAPITAL + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteActual.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteAnterior.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + Equal + + F + + + + =Fields!CtaMayor.Value + NotEqual + + 3 + + + + 8.30193cm + 10.88047cm + 1.65cm + 9.4578cm + 6 + + + Verdana + 8pt + + + + true + true + + + + + CAPITAL + + + + + + + Textbox28 + 7.52554cm + 10.92451cm + 0.6cm + 9.41376cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total del Activo + + + + + + + Textbox45 + 11.31317cm + 0.27027cm + 0.6cm + 4.81646cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalActivoAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalActivoActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total CAPITAL + + + + + + + Textbox45 + 10.22837cm + 10.88047cm + 0.6cm + 3.1816cm + 11 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalPatrimonioHAnterior.Value + Variables!TotalPatrimonioCAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalPatrimonioHActual.Value + Variables!TotalPatrimonioCActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total Pasivo y Patrimonio + + + + + + + Textbox45 + 11.31317cm + 10.77464cm + 0.6cm + 4.55974cm + 14 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalpasivoYHaciendaAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalpasivoYHaciendaActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total del Pasivo: + + + + + + + Textbox45 + 6.57056cm + 10.88047cm + 0.6cm + 3.1816cm + 17 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalPasivoAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalPasivoActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Iif(round(Math.Abs(Variables!TotalActivoAnterior.Value-Variables!TotalpasivoYHaciendaAnterior.Value),2) <.005 AND Round(Math.Abs(Variables!TotalActivoActual.Value-Variables!TotalpasivoYHaciendaActual.Value),2) <.005,"" ,"La suma de los totales estan descuadradas." & round(Math.Abs(Variables!TotalActivoAnterior.Value-Variables!TotalpasivoYHaciendaAnterior.Value),2)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + External + = Parameters!pImg.Value + FitProportional + 0.03141cm + 0.31432cm + 1.5cm + 1.5cm + 21 + + + + + + true + true + + + + + =Parameters!pEmp.Value + + + + + + + Textbox1 + 0.03141cm + 3.40996cm + 0.81167cm + 12.91455cm + 22 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Estado de Situación Financiera al + + + + =Parameters!pFechaFin.Value + + + + + + + Textbox5 + 0.89924cm + 3.40996cm + 0.6cm + 12.91455cm + 23 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Fecha Impresión:" & vbcrlf & Format( Globals!ExecutionTime,"dd/MM/yyyy") + + + + + + + Textbox8 + 0.03141cm + 16.58113cm + 0.81167cm + 3.49249cm + 24 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 6cm + + + 2.5cm + + + 2.20896cm + + + + + 0.6cm + + + + + true + true + + + + + ACTIVO DIFERIDO + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL ACTIVO DIFERIDO + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteActual.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteAnterior.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!CtaMayor.Value + NotEqual + + 3 + + + + 6.92554cm + 0.06568cm + 1.65cm + 10.70896cm + 25 + + =IIf(Parameters!CveEmpresa.Value = 48,True,False) + + + + Verdana + 8pt + + + + 5.1587in + + + + =Parameters!pFechaFin.Value + + + + + + + Textbox5 + 3.454cm + 0.6cm + 12.91455cm + + = (Globals.PageNumber=1) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Fecha Impresión:" & vbcrlf & Format( Globals!ExecutionTime,"dd/MM/yyyy") + + + + + + + Textbox8 + 0.02088cm + 16.62517cm + 0.57912cm + 3.49249cm + 1 + + = (Globals.PageNumber=1) + + + + 2pt + 2pt + + + + + + + + + 3.73062cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 3.13062cm + 16.37931cm + 0.6cm + 3.95896cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!pFirma2.Value + + + + Textbox2 + 0.10583cm + 1.71666cm + 0.99688cm + 8.02269cm + 1 + + = Iif((Globals.PageNumber=Globals.TotalPages) and (Parameters!pFirma2.Value <> ""),false,true) + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!pFirma1.Value + + + + Textbox2 + 2.73374cm + 6.03938cm + 0.99688cm + 8.02269cm + 2 + + = Iif((Globals.PageNumber=Globals.TotalPages) and (Parameters!pFirma1.Value <> ""),false,true) + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + Textbox2 + 0.10582cm + 10.37435cm + 0.99688cm + 8.02269cm + 3 + + =Microsoft.VisualBasic.Interaction.Iif((Globals!PageNumber = Globals!TotalPages) And (Parameters!pFirma1.Value <> ""), False, True) + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0.5cm + 0.5cm + 1cm + 1cm + 0.13cm + - - - Reporte de Almacen Periodo - - -
  • - Ver En -
  • - - -
  • - Ver Grafica -
  • -
    -
    -
  • - Genera PDF -
  • -
  • - Genera Excel -
  • -
    - - - - - - - -
    -
    -
    - - "> - -
    -
    -
    -
    Fecha Corte:
    -
    -
    - - - - -
    - - -
    -
    Tipo Almacen:
    -
    - -
    -
    Modalidad:
    -
    - - - - - -
    - -
    -
    -
    -
    -
    -
    - - -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - -
    - - - - - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAlmacenPeriodo.aspx.vb" Inherits="Inventarios_RepAlmacenPeriodo" %> + + + + + + + + Reporte de Almacen Periodo + + +
  • + Ver En +
  • + + +
  • + Ver Grafica +
  • +
    +
    +
  • + Genera PDF +
  • +
  • + Genera Excel +
  • +
    + + + + + + + +
    +
    +
    + + +
    +
    +
    +
    Fecha Corte:
    +
    +
    + + + + +
    + + +
    +
    Tipo Almacen:
    +
    + +
    +
    Modalidad:
    +
    + + + + + +
    +
    + +
    +
    Almacen:
    +
    + +
    +
    +
    +
    + +
    +
    +
    + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    + + + + + + - - - + + +
    + diff --git a/Inventarios/RepAlmacenPeriodo.aspx.vb b/Inventarios/RepAlmacenPeriodo.aspx.vb index c8ae610f4..f4c8efd47 100644 --- a/Inventarios/RepAlmacenPeriodo.aspx.vb +++ b/Inventarios/RepAlmacenPeriodo.aspx.vb @@ -39,18 +39,30 @@ Partial Class Inventarios_RepAlmacenPeriodo DdlTipoAlmacen.DataSource = GlobalDTTipoAlmacen(1) DdlTipoAlmacen.DataBind() DdlTipoAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + DdlAlmacen.DataBind() + DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlSucursal.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, CveEstatus:=1) + DdlSucursal.DataBind() + DdlSucursal.Items.Insert(0, New ListItem("Todas", "-1")) + End Sub Private Sub CargaDatos() Dim objInv As New ClsInventarios Dim FechaCorte As Date - FechaCorte = If(IsDate(TxtFechaCorte.Text.Trim()), TxtFechaCorte.Text.ToDate, MaxFecha) + FechaCorte = If(IsDate(TxtFechaCorte.Text.Trim()), TxtFechaCorte.Text.ToDate, MaxFecha) Dim TipoAlmacen As String = If(DdlTipoAlmacen.GetSelectedValuesM = "", "-1", DdlTipoAlmacen.GetSelectedValuesM) + Dim Almacenes As String = If(DdlAlmacen.GetSelectedValuesM = "", "-1", DdlAlmacen.GetSelectedValuesM) + Dim CveSubProyecto As Integer = DdlSucursal.SelectedValue.ToEntero() If RblTotal.Checked Then Ver = 1 If RblExistencia.Checked Then Ver = 2 - If objInv.GetRepAlmacenesPeriodo(FechaCorte, UsuarioActual.CveEmpresa, TipoAlmacen, DdlModalidadFiltro.SelectedValue.ToEntero, ChkInventariable.Checked, Ver) Then + If objInv.GetRepAlmacenesPeriodo(FechaCorte, UsuarioActual.CveEmpresa, TipoAlmacen, DdlModalidadFiltro.SelectedValue.ToEntero, ChkInventariable.Checked, Ver, + Almacenes:=Almacenes, CveSubProyecto:=CveSubProyecto, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then GVAlmacen.DataSource = objInv.DtResultados TmpDT = objInv.DtResultados End If From beb266520303a92d4dd8e77d355592ee70130c47 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 11 Nov 2019 12:27:37 -0700 Subject: [PATCH 22/24] =?UTF-8?q?-se=20activan=20las=20cuentas=20dep=C3=B3?= =?UTF-8?q?sitos=20si=20tiene=20el=20proveedor=20--=20impresi=C3=B3n=20de?= =?UTF-8?q?=20p=C3=B3liza,=20que=20no=20salga?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsContPAQi.vb | 16 +++++++++++++--- Bancos/ProveedoresAbonar.aspx.vb | 23 +++++++++++++---------- Contabilidad/PolizasImpresion.aspx | 2 +- Ventas/Ventas.aspx.vb | 26 +++++++++++++++++++++----- 4 files changed, 48 insertions(+), 19 deletions(-) diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb index e5cd3194c..baa716b43 100644 --- a/App_Code/ClsContPAQi.vb +++ b/App_Code/ClsContPAQi.vb @@ -7360,20 +7360,30 @@ Public Class ClsContPAQi StrSQL.Append(" AND (@CveUsuario = -1 OR P.IdUsuario = @CveUsuario) ") StrSQL.Append(" END; ") + StrSQL.Append(" DECLARE @DtProv TABLE (IdPoliza INT INDEX IX1 CLUSTERED) ") + StrSQL.Append(" IF @CveTipoProveedor > 0 ") + StrSQL.Append(" BEGIN ") + StrSQL.Append(" INSERT INTO @DtProv SELECT PP.IdPoliza + FROM SERVIDOR.Ventas.dbo.Conta_PrePolizasDetalle PPD ") + StrSQL.Append(" INNER JOIN SERVIDOR.Ventas.dbo.Conta_PrePolizas PP ON PP.CvePrePoliza = PPD.CvePrePoliza + INNER JOIN SERVIDOR.Ventas.dbo.Comp_Proveedores Prov ON Prov.CveProveedor = PPD.CveProveedor and PP.IdPoliza > 0 + AND Prov.CveTipoProveedor = @CveTipoProveedor AND Prov.CveEmpresa = @CveEmpresa + AND PP.Fecha >= @Inicio AND PP.Fecha <= @Fin") + StrSQL.Append(" END; ") + StrSQL.Append(" SELECT P.Id,P.Fecha,T.Nombre as TipoPoliza, MP.IdPoliza, P.IdUsuario, P.Concepto AS ConceptoPoliza,P.Cargos,P.Abonos,P.Folio ,P.Folio AS Numero , SN.Nombre AS SegNeg, MP.Concepto, ") StrSQL.Append(" CASE WHEN ISNUMERIC(C.CODIGO) = 1 THEN FORMAT(CAST (C.CODIGO AS FLOAT),(SELECT REPLACE(Mascarilla,'X','0') FROM Parametros)) ELSE C.CODIGO END AS CuentaFormato , MP.TipoMovto ") StrSQL.Append(" ,C.Nombre AS Cuenta ,MP.Referencia AS Referencia, CASE WHEN MP.TipoMovto=0 THEN MP.Importe ELSE 0 END AS Cargo ") StrSQL.Append(" , CASE WHEN MP.TipoMovto=1 THEN MP.Importe ELSE 0 END AS Abono,U.Nombre AS UsuarioRegistro ") StrSQL.Append(" FROM Polizas P ") StrSQL.Append(" LEFT JOIN MovimientosPoliza MP ON P.Id= MP.IdPoliza ") - StrSQL.Append(" LEFT JOIN SERVIDOR.Ventas.dbo.Conta_PrePolizasDetalle PPD ON PPD.CvePrePolizaDetalle = MP.CvePrePolizaDetalle ") - StrSQL.Append(" LEFT JOIN SERVIDOR.Ventas.dbo.Conta_PrePolizas PP ON PP.CvePrePoliza = PPD.CvePrePoliza ") + StrSQL.Append(" LEFT JOIN SERVIDOR.Ventas.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ") StrSQL.Append(" LEFT JOIN Cuentas C ON C.Id = MP.IdCuenta ") StrSQL.Append(" LEFT JOIN TiposPolizas T ON T.Id = P.TipoPol ") StrSQL.Append(" LEFT JOIN SegmentosNegocio SN ON SN.Id = MP.IdSegNeg ") StrSQL.Append(" WHERE P.Fecha >= @Inicio AND P.Fecha <= @Fin ") - StrSQL.Append(" AND (@CveTipoProveedor = -1 OR PPD.CveProveedor in (SELECT CveProveedor FROM SERVIDOR.Ventas.dbo.Comp_Proveedores POV WHERE POV.CveEmpresa = @CveEmpresa AND POV.CveTipoProveedor = @CveTipoProveedor)) ") + StrSQL.Append(" AND (@CveTipoProveedor = -1 OR ( MP.IdPoliza IN (SELECT IdPoliza FROM @DtProv))) ") StrSQL.Append(" AND (@FolioI = -1 OR P.Folio >= @FolioI) ") StrSQL.Append(" AND (@FolioF = -1 OR P.Folio <= @FolioF) ") StrSQL.Append(" AND (@TipoP=-1 OR @TipoP =P.TipoPol) ") diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 9ee86c31d..434b07f56 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -504,8 +504,9 @@ Partial Class Bancos_ProveedoresAbonar End If CargaDatos() '(tCveProveedor, CveMoneda, FechaI, FechaF, CveUsuarioRegistro, CveUsuarioProgramo, Serie) - - 'CUANDO VIENE PROGRAMADO LLENA EL TEXTO OBSERVACIONES + CargaCuentasDepositos() + + 'CUANDO VIENE PROGRAMADO LLENA EL TEXTO OBSERVACIONES If CveUsuarioProgramo <> -1 Then RegistraScript("SumaValores();") Else @@ -2817,12 +2818,13 @@ Partial Class Bancos_ProveedoresAbonar If 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 StrImporte As String = DtDatos.Rows(0)("Saldo").ToString.FormatoNumero Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString)) params.Add(New ReportParameter("Sucursal", DtDatos.Rows(1)("SubProyecto").ToString)) - params.Add(New ReportParameter("Importe", $"${DtDatos.Rows(0)("Saldo").ToString.FormatoNumero}")) + params.Add(New ReportParameter("Importe", $"${StrImporte}")) params.Add(New ReportParameter("RazonSocial", TxtPagueseA.Text)) params.Add(New ReportParameter("Fecha", TxtFechaDocumento.Text)) Dim Transferencia = "", Banco = "", CLABE = "", Cuenta = "", Correo = "" @@ -2844,13 +2846,14 @@ Partial Class Bancos_ProveedoresAbonar params.Add(New ReportParameter("CLABE", CLABE)) params.Add(New ReportParameter("Cuenta", Cuenta)) params.Add(New ReportParameter("Correo", Correo)) - If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) - Else - params.Add(New ReportParameter("LogoPath", "")) - End If - ImprimirPDF("Empresas/Grales/Formatos/Solicitud.rdlc", DtDatos, params, "Solicitud", Opcion) - Else + If Imagen.Exists Then + params.Add(New ReportParameter("LogoPath", logouri)) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + Dim NombreArchivo As String = "SolicitudPago" ''String.Format("SolicitudPago{0}.pdf", TxtPagueseA.Text).Replace(" ", "") + ImprimirPDF("Empresas/Grales/Formatos/Solicitud.rdlc", DtDatos, params, NombreArchivo, Opcion) + Else Alert("No se encontraron datos.", TipoMensaje.MsgAdvertencia) End If End Sub diff --git a/Contabilidad/PolizasImpresion.aspx b/Contabilidad/PolizasImpresion.aspx index 3c7ec186b..7eed8c897 100644 --- a/Contabilidad/PolizasImpresion.aspx +++ b/Contabilidad/PolizasImpresion.aspx @@ -109,7 +109,7 @@
    - + diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index e268ff6bf..6593ee3ef 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3344,7 +3344,7 @@ Partial Class Ventas Dim Cons As Integer = 1 For Each dr As DataRow In OS.DtResultados.FiltraParametros("SeFacturara = 1 ").Rows - AgregarProductoServicio(dr("Cantidad").ToString.ToDecimal, dr("CveUM").ToString.ToEntero, dr("UM").ToString, -1, "", dr("CvePS").ToString.ToEntero, "", dr("Obs").ToString, dr("PU"), 0, -1, "", + AgregarProductoServicio(dr("Cantidad").ToString.ToDecimal, dr("CveUM").ToString.ToEntero, dr("UM").ToString, -1, "", dr("CvePS").ToString.ToEntero, "", dr("Obs").ToString, dr("PU").ToString.ToDecimal, 0, -1, "", dr("CveSubProyecto").ToString.ToEntero, dr("SubProyecto").ToString) 'Dim drt As DataRow = TmpDT.NewRow @@ -4217,6 +4217,11 @@ Partial Class Ventas BtnPermisoEditarCotizacion.Visible = True End If + 'SOLO LA PUEDE EDITAR USUATIOACTUAL-VENDEDOR | NO DEBE ESTAR FACTURADA + If UsuarioActual.TienePermisoProceso(281) And TmpDT.SUM("CantidadFacturadaCot") = 0 Then 'And TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") + BtnPermisoEditarCotizacion.Visible = True + End If + 'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR If TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") Then BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True) @@ -4279,10 +4284,21 @@ Partial Class Ventas 'CargaDetalle If ObjVentas.GetVentaDetalle(CveVenta) Then - TmpDT = ObjVentas.DtResultados - TmpDT.Columns.Add("EntregaDirecta", GetType(Integer)) - TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer)) - 'TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal)) + + + For Each dr As DataRow In ObjVentas.DtResultados.Rows + AgregarProductoServicio(dr("Cantidad").ToString.ToDecimal, dr("CveUM").ToString.ToEntero, dr("UM").ToString, dr("CveClasificacion").ToString.ToEntero, dr("Clasificacion").ToString, + dr("CvePS").ToString.ToEntero, dr("PS").ToString, dr("Obs").ToString, dr("PU").ToString.ToDecimal, dr("Descuento").ToString.ToDecimal, + dr("CveProyecto").ToString.ToEntero, dr("Proyecto").ToString, dr("CveSubProyecto").ToString.ToEntero, dr("SubProyecto").ToString, + CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, CveVentaDetalleCotizacion:=dr("CveVentaDetalleCotizacion").ToString.ToEntero, RegeneraIEPS:=False, SeActualiza:=True) + + + Next + + 'TmpDT = ObjVentas.DtResultados + 'TmpDT.Columns.Add("EntregaDirecta", GetType(Integer)) + 'TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer)) + ''TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal)) GvPS.DataSource = ObjVentas.DtResultados GvPS.DataBind() End If From 59cb7565ecf415b3af0dd4d9aa5d165eaa433bce Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Mon, 11 Nov 2019 13:06:10 -0700 Subject: [PATCH 23/24] Cambios BDH --- Ventas/CatClasificaciones.aspx | 4 ++++ Ventas/PV.aspx | 19 ++++++++++--------- Ventas/PV.aspx.vb | 6 +++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Ventas/CatClasificaciones.aspx b/Ventas/CatClasificaciones.aspx index 9311cc807..cfd24954e 100644 --- a/Ventas/CatClasificaciones.aspx +++ b/Ventas/CatClasificaciones.aspx @@ -281,6 +281,10 @@ +
    + + +
    diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index 9fd8b00cc..55fb82ddc 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -2738,7 +2738,7 @@ -
    +
    @@ -2802,22 +2802,22 @@
    -
    +
    - <%--
    +
    - +
    -
    --%> +
    @@ -2842,7 +2842,7 @@
    - + <%----% <%----%> @@ -2863,6 +2863,7 @@
    + <%----%> <%----%> @@ -2886,7 +2887,7 @@
    - + <%----%> <%----%> @@ -3126,7 +3127,7 @@ $get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ','); $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); - $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); + $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); $get("TxtDescuento").value = formato_numero(Total, 2, '.', ','); $get("TxtDescP").value = formato_numero(0, 2, '.', ','); $get("HdnDescuento").value = Total; @@ -3166,7 +3167,7 @@ $get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ','); $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); - $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); + $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); $get("TxtDescuento").value = formato_numero(Total, 2, '.', ','); $get("HdnDescuento").value = Total; if (TipoDescuento == 2) { diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index e9d0fd0f7..92388a1df 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -5160,11 +5160,11 @@ Partial Class PV End If Contador += 1 Next - 'TxtPUFactura.Text = PUFactura.FormatoNumero(2) + TxtPUFactura.Text = PUFactura.FormatoNumero(2) End If If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then - 'TxtPUFactura.Text = "" + TxtPUFactura.Text = "" End If CalculaPorcentajeAjuste() @@ -5747,7 +5747,7 @@ Partial Class PV params.Add(New ReportParameter("PorcentajeAjuste", TxtPorcentajeAjuste.Text.Trim)) 'Informacion Acumulador - params.Add(New ReportParameter("CodEnsamble", If(TxtCodEnsamble.Text.Length > 7, TxtCodEnsamble.Text.Trim.Substring(0, 7), ""))) + params.Add(New ReportParameter("CodEnsamble", TxtCodEnsamble.Text.Trim)) params.Add(New ReportParameter("CodLinea", TxtCodLinea.Text.Trim)) params.Add(New ReportParameter("CodInspeccion", TxtCodInspeccion.Text.Trim)) From 0a96123c2db973d9749a47f0bf4fb864366abd66 Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Mon, 11 Nov 2019 14:41:25 -0700 Subject: [PATCH 24/24] Sugiere precio en base al Costo de la clasificacion --- App_Code/ClsClasificaciones.vb | 6 ++- Ventas/CatClasificaciones.aspx | 86 ++++++++++++++++++------------- Ventas/CatClasificaciones.aspx.vb | 8 ++- Ventas/Ventas.aspx.vb | 19 +++++++ 4 files changed, 78 insertions(+), 41 deletions(-) diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index 0970a55d3..72436f388 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -192,7 +192,7 @@ Public Class ClsClasificaciones End Function Public Function AddClasificaciones(Clasificacion As String, Codigo As String, IdCuentaGasto As Integer, CuentaGasto As String, IdCuentaCostos As Integer, CuentaCostos As String, IdCuentaIngreso As Integer, CuentaIngreso As String, CveCategoria As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional RequiereSerieLote As Integer = 0, Optional UsoClasificacion As Integer = -1, Optional CveSATPS As Integer = -1, Optional RequiereAFCompra As Boolean = True, Optional RequiereAFInsumo As Boolean = True, Optional RequierePersonal As Boolean = True, - Optional EsAcumulador As Boolean = False, Optional TopVentas As Boolean = False, Optional TopCompras As Boolean = False) As Boolean + Optional EsAcumulador As Boolean = False, Optional TopVentas As Boolean = False, Optional TopCompras As Boolean = False, Optional PrecioBaseCosto As Decimal = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClasificacionesAdd") @@ -227,6 +227,7 @@ Public Class ClsClasificaciones .Add("@EsAcumulador", SqlDbType.Bit).Value = EsAcumulador .Add("@TopCompras", SqlDbType.Bit).Value = TopCompras .Add("@TopVentas", SqlDbType.Bit).Value = TopVentas + .Add("@PrecioBaseCosto", SqlDbType.Money).Value = PrecioBaseCosto End With @@ -300,7 +301,7 @@ Public Class ClsClasificaciones End Function Public Function UpdateClasificacion(Clasificacion As String, Codigo As String, IdCuentaGasto As Integer, CuentaGasto As String, IdCuentaCostos As Integer, CuentaCostos As String, IdCuentaIngresos As Integer, CuentaIngresos As String, Estatus As Boolean, Afectable As Boolean, CveCategoria As Integer, CveUsuario As Integer, CveClasificacion As Integer, Optional RequiereSerieLote As Integer = 0, Optional UsoClasificacion As Integer = -1, Optional CveSATPS As Integer = -1, Optional RequiereAFCompra As Boolean = True, Optional RequiereAFInsumo As Boolean = True, Optional RequierePersonal As Boolean = True, - Optional EsAcumulador As Boolean = False, Optional TopVentas As Boolean = False, Optional TopCompras As Boolean = False) As Boolean + Optional EsAcumulador As Boolean = False, Optional TopVentas As Boolean = False, Optional TopCompras As Boolean = False, Optional PrecioBaseCosto As Decimal = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClasificacionesUpdate") @@ -335,6 +336,7 @@ Public Class ClsClasificaciones .Add("@EsAcumulador", SqlDbType.Bit).Value = EsAcumulador .Add("@TopCompras", SqlDbType.Bit).Value = TopCompras .Add("@TopVentas", SqlDbType.Bit).Value = TopVentas + .Add("@PrecioBaseCosto", SqlDbType.Money).Value = PrecioBaseCosto End With diff --git a/Ventas/CatClasificaciones.aspx b/Ventas/CatClasificaciones.aspx index cfd24954e..d8fbfc59d 100644 --- a/Ventas/CatClasificaciones.aspx +++ b/Ventas/CatClasificaciones.aspx @@ -76,7 +76,7 @@
    + DataKeyNames="CveClasificacion, CveCategoria, Clasificacion, UsoClasificacion, CuentaGasto, CuentaCostos, CuentaIngresos, IdCuentaGasto, IdCuentaCostos, IdCuentaIngresos,RequiereSerieLote,CveSATPS,SATClaveProductoServicio, RequiereAFCompra, RequiereAFInsumo, RequierePersonal, Estatus,EsAcumulador,TopVentas,TopCompras,PrecioBaseCosto" EmptyDataText="No se encontraron Clasificaciones Registradas" ToolTip="Listado de Clasificaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None"> @@ -210,41 +210,57 @@
    -
    - - +
    + +
    +
    +
    + + +
    + +
    + + + + + + +
    + + +
    + + +
    + + +
    + + +
    + + +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    -
    - - - - - - -
    +
    - -
    - - -
    - - -
    - - -
    - - -
    - - -
    -
    - - -
    @@ -281,10 +297,6 @@
    -
    - - -
    diff --git a/Ventas/CatClasificaciones.aspx.vb b/Ventas/CatClasificaciones.aspx.vb index 518919900..0f1bd5b3e 100644 --- a/Ventas/CatClasificaciones.aspx.vb +++ b/Ventas/CatClasificaciones.aspx.vb @@ -178,11 +178,12 @@ Partial Class CatClasificaciones DdlCuentaCostos.SelectedValue.ToEntero, DdlCuentaCostos.SelectedItem.Text, DdlCuentaIngresos.SelectedValue.ToEntero, DdlCuentaIngresos.SelectedItem.Text, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero, - RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked) Then + RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)") TxtClasificacion.Text = "" + TxtPrecioBaseCosto.Text = "" DdlCuentaGasto.SelectedValueExist("0") DdlCuentaCostos.SelectedValueExist("0") DdlCuentaIngresos.SelectedValueExist("0") @@ -201,7 +202,7 @@ Partial Class CatClasificaciones If ObjClasificaciones.UpdateClasificacion(Clasificacion, "", DdlGasto.SelectedValue.ToEntero, DdlGasto.SelectedItem.Text, DdlCosto.SelectedValue.ToEntero, DdlCosto.SelectedItem.Text, DdlIngresos.SelectedValue.ToEntero, DdlIngresos.SelectedItem.Text, Estatus, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero, - RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked) Then + RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones")) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) @@ -346,6 +347,7 @@ Partial Class CatClasificaciones Limpiador() TxtClasificacion.Text = "" + TxtPrecioBaseCosto.Text = "" DdlCategoria.SelectedIndex = 0 DdlSATPS.SelectedValue = "" DdlSATPS.SelectedText = "" @@ -371,6 +373,7 @@ Partial Class CatClasificaciones Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim CveClasificacion As String = GvRow.DataKey("CveClasificacion").ToString Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString + Dim PrecioBaseCosto As String = GvRow.DataKey("PrecioBaseCosto").ToString Dim CveCategoria As String = GvRow.DataKey("CveCategoria").ToString Dim CuentaGasto As String = GvRow.DataKey("CuentaGasto").ToString Dim CuentaCostos As String = GvRow.DataKey("CuentaCostos").ToString @@ -421,6 +424,7 @@ Partial Class CatClasificaciones TxtClasificacion.Text = Clasificacion + TxtPrecioBaseCosto.Text = PrecioBaseCosto.FormatoNumero(2) DdlCategoria.SelectedValueExist(CveCategoria) DdlUsoClasificacion.SelectedValue = UsoClasificacion HdnIDClasificacion.Value = CveClasificacion diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index cf8524973..1e1c3dc49 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -12923,6 +12923,16 @@ Partial Class Ventas DdlUnidadMedida.DataBind() DdlUnidadMedida.SelectedValueExist(drPS("CveUnidadMedida").ToString) + If drPS("CveTipoPS").ToString = "1" Then 'Si es servicio + If UsuarioActual.Empresa.Funcionalidad(558).ToString = "1" Then 'Si es Empresa llantera + TxtPrecio.Enabled = True + Else + TxtPrecio.Enabled = False + End If + Else + TxtPrecio.Enabled = True + End If + If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count = 0 Then DdlMoneda.SelectedValueExist(drPS("CveMoneda").ToString) CambiaMoneda() @@ -12979,7 +12989,16 @@ Partial Class Ventas End If + Dim PrecioBaseCosto As Decimal = 0 + Dim ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificaciones() Then + PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal + End If + If PrecioSugerido > 0 Then + If PrecioBaseCosto > 0 Then + PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1) + End If TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere End If