From 836f0fe7df96fe103644caecf117b02ee7013131 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Sat, 17 Aug 2019 13:52:36 -0700 Subject: [PATCH 1/4] --- .gitignore | 3 ++- App_Code/ClsPaginas.vb | 14 ++++++++++++-- Ventas/RepConciliacionEmitidosSat.aspx | 5 +++-- Ventas/RepConciliacionEmitidosSat.aspx.cs | 8 ++++---- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 87735880e..fc8032bc3 100644 --- a/.gitignore +++ b/.gitignore @@ -265,4 +265,5 @@ paket-files/ # Python Tools for Visual Studio (PTVS) __pycache__/ -*.pyc \ No newline at end of file +*.pyc +/Utilerias diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 0b2f51307..6315f2c4b 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -389,7 +389,17 @@ Public Class ClsPaginas Property GlobalDTPSATUM() As DataTable Get - GlobalDTPSATUM = DirectCast(Application("GlobalDTPSATUM"), DataTable) + + 'System.Data.EnumerableRowCollection + If Not IsNothing(Application("GlobalDTPSATUM")) Then + If Application("GlobalDTPSATUM").GetType().IsSubclassOf(GetType(EnumerableRowCollection)) Then + Return DirectCast(Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow)).CopyToDataTable() + Else + Return DirectCast(Application("GlobalDTPSATUM"), DataTable) + End If + Else + Return Nothing + End If End Get Set(value As DataTable) Application("GlobalDTPSATUM") = value @@ -3320,7 +3330,7 @@ Public Class ClsPaginas PaginaDict = New System.Collections.Hashtable PaginaDict.Add("/Inicio.aspx".ToUpper(), -1) - + PaginaDict.Add("/Ventas/RepConciliacionEmitidosSat.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/CatConceptos2.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/Aguinaldo.aspx".ToUpper(), -1) diff --git a/Ventas/RepConciliacionEmitidosSat.aspx b/Ventas/RepConciliacionEmitidosSat.aspx index 2e7772fdc..9be90a3db 100644 --- a/Ventas/RepConciliacionEmitidosSat.aspx +++ b/Ventas/RepConciliacionEmitidosSat.aspx @@ -98,10 +98,11 @@ <%-- --%> - + - + r + diff --git a/Ventas/RepConciliacionEmitidosSat.aspx.cs b/Ventas/RepConciliacionEmitidosSat.aspx.cs index 94dc209c0..1f4e28eae 100644 --- a/Ventas/RepConciliacionEmitidosSat.aspx.cs +++ b/Ventas/RepConciliacionEmitidosSat.aspx.cs @@ -388,7 +388,7 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas Row["CveTipoPS"] = DrPS["CveTipoPS"]; Row["CveTipoInvPS"] = DrPS["Inv_CveMetodoInventario"]; Row["CveTamaño"] = DrPS["CveTamaño"]; - ADSistemaLibrary.SatXml.CFDIConceptoImpuesto impuesto = item.Impuestos.FirstOrDefault(x => x.Impuesto == "002" && x.Impuesto == "Traslado"); + ADSistemaLibrary.SatXml.CFDIConceptoImpuesto impuesto = item.Impuestos.FirstOrDefault(x => x.Impuesto == "002" && x.Tipo == "Traslado"); if (impuesto != null) { Row["PorcentajeIVA"] = impuesto.TasaOCuota; @@ -400,7 +400,7 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas Row["ImporteIVA"] = 0; } Row["IVA"] = Row["PorcentajeIVA"]; - impuesto = item.Impuestos.FirstOrDefault(x => x.Impuesto == "003" && x.Impuesto == "Traslado"); + impuesto = item.Impuestos.FirstOrDefault(x => x.Impuesto == "003" && x.Tipo == "Traslado"); if (impuesto != null) { Row["PorcentajeIEPS"] = impuesto.TasaOCuota; @@ -413,7 +413,7 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas Row["ImporteIEPS"] = 0; Row["IEPS"] = 0; } - impuesto = item.Impuestos.FirstOrDefault(x => x.Impuesto == "001" && x.Impuesto == "Retencion"); + impuesto = item.Impuestos.FirstOrDefault(x => x.Impuesto == "001" && x.Tipo == "Retencion"); if (impuesto != null) { Row["ImporteRetISR"] = impuesto.Importe; @@ -424,7 +424,7 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas Row["ImporteRetISR"] = 0; Row["PorcentajeRetISR"] = 0; } - impuesto = item.Impuestos.FirstOrDefault(x => x.Impuesto == "002" && x.Impuesto == "Retencion"); + impuesto = item.Impuestos.FirstOrDefault(x => x.Impuesto == "002" && x.Tipo == "Retencion"); if (impuesto != null) { Row["ImporteRetIVA"] = impuesto.Importe; From 83f52ddd40403841db10f78f7804d633e4de506e Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 19 Aug 2019 09:56:32 -0700 Subject: [PATCH 2/4] --- App_Code/ClsPaginas.vb | 8 +- Sistemas/SessionesActivas.aspx.vb | 14 +- Ventas/RepConciliacionEmitidosSat.aspx.cs | 268 +++++++++++++++------- 3 files changed, 199 insertions(+), 91 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 6315f2c4b..04ad93303 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3318,9 +3318,6 @@ Public Class ClsPaginas - 'Protected Overridable Sub Page_PreRender(sender As Object, e As EventArgs) Handles Me.PreRender - - 'End Sub Private Function Obt_ClavePagina(Pagina As String) As Integer Dim Retorno As Integer @@ -4671,11 +4668,14 @@ Public Class ClsPaginas Mensaje.Alert(Mensaje, pOpcion, JSBtnAceptar, TimeoutToast:=timeout) End If End Sub - Protected Overrides Sub SavePageStateToPersistenceMedium(pviewState As Object) + Protected Overridable Sub Page_PreRender(sender As Object, e As EventArgs) Handles Me.PreRender If Not IsNothing(ViewState("strToastMsglargonoreplace")) AndAlso ViewState("strToastMsglargonoreplace").ToString.Length > 0 Then RegistraScript(ViewState("strToastMsglargonoreplace").ToString(), "esteseraunticklargoparaquenosesobrescribaconotro") ViewState("strToastMsglargonoreplace") = Nothing End If + + End Sub + Protected Overrides Sub SavePageStateToPersistenceMedium(pviewState As Object) 'If Request.Form("__VIEWSTATE_KEY") IsNot Nothing Then Cache.Remove(Request.Form("__VIEWSTATE_KEY")) 'elimino la cachado anteriormente Dim VSKey As String = String.Format("VIEWSTATE_{0}_{1}_{2}", Session.SessionID, Request.Path, Date.Now.Ticks) 'Cache.Add(VSKey, pviewState, Nothing, Date.Now.AddMinutes(60), Cache.NoSlidingExpiration, CacheItemPriority.Default, Nothing) 'Store the ViewState on Cache diff --git a/Sistemas/SessionesActivas.aspx.vb b/Sistemas/SessionesActivas.aspx.vb index 169069e5d..d75f57267 100644 --- a/Sistemas/SessionesActivas.aspx.vb +++ b/Sistemas/SessionesActivas.aspx.vb @@ -16,13 +16,13 @@ Partial Class SessionesActivas End Property Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then - - Dim listacve As New List(Of String) - listacve.Add("1815") - Notificaciones.AlertaVentana("notificacion", listacve, timeoutseconds:=0) - - RCveUsuario = "0" - ClsSisNotificaciones.SendNotificacionERP(100, "Titulo", "Hola Mundo", 1) + + ' Dim listacve As New List(Of String) + ' listacve.Add("1815") + ' Notificaciones.AlertaVentana("notificacion", listacve, timeoutseconds:=0) + + ' RCveUsuario = "0" + 'ClsSisNotificaciones.SendNotificacionERP(100, "Titulo", "Hola Mundo", 1) CargaDatos("") End If End Sub diff --git a/Ventas/RepConciliacionEmitidosSat.aspx.cs b/Ventas/RepConciliacionEmitidosSat.aspx.cs index 1f4e28eae..649c309c0 100644 --- a/Ventas/RepConciliacionEmitidosSat.aspx.cs +++ b/Ventas/RepConciliacionEmitidosSat.aspx.cs @@ -24,6 +24,7 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas DdlSubProyectoDatos.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros("EsSucursal = True "); DdlSubProyectoDatos.DataBind(); DdlClasificacion.DataSource = get_GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion: 1).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby: "Clasificacion"); + DdlClasificacion.DataBind(); @@ -43,98 +44,184 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas DdlPS.setEsWebService(false); DdlPS.ddl.DataSource = get_GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion: CveClasificacion, Estatus: 1, AplicaParaVenta: 1); DdlPS.ddl.DataBind(); - } + } } } protected void CargaConciliacionemitidasSATGet() { ClsVentas ObjV = new ClsVentas(); ObjV.ConciliacionemitidasSATGet(UsuarioActual.CveEmpresa); - GVConciliacionemitidasSAT.DataSource = ObjV.DtResultados; + GVConciliacionemitidasSAT.DataSource = ObjV.DtResultados.FiltraParametros("", "CveVenta"); ObjV.Dispose(); GVConciliacionemitidasSAT.DataBind(); UpDatosReporte.Update(); + + } + private void registrarventa(GridViewRow gvrow) + { + + { + + string ruta = gvrow.DataKey("RutaXml"); + strErrores = new StringBuilder(); + XmlSatCFDI objxml = null; + Modelos.Factura objfact = null; + bool continuar = true; + objxml = XmlSatCFDI.readXML(ruta); + continuar = continuar && (objxml != null); + if (continuar) + { + + objfact = GetFacturaFromXML(objxml); + } + continuar = continuar && (objfact != null); + if (continuar) + { + + // Dim As New (ObjVentas.IniciaTransacSQL()) + // Dim As = Nothing + // Dim MensajeAlert = New StringBuilder + ClsVentas ObjVentas = new ClsVentas(); + ClsInventarios ObjInventario = new ClsInventarios(ObjVentas.IniciaTransacSQL()); + ClsContabilidad ObjConta = new ClsContabilidad(ObjVentas.IniciaTransacSQL()); + ClsContratos ObjContr = new ClsContratos(ObjVentas.IniciaTransacSQL()); + ClsOS ObjOS = new ClsOS(ObjVentas.IniciaTransacSQL()); + ClsBancos ObjBancos = new ClsBancos(ObjVentas.IniciaTransacSQL()); + ClsClientes ObjClientes = new ClsClientes(ObjVentas.IniciaTransacSQL()); + ClsOIEventos ObjEventos = new ClsOIEventos(ObjVentas.IniciaTransacSQL()); + ClsCGame ObjCGame = new ClsCGame(ObjVentas.IniciaTransacSQL()); + ClsEdocumentacion ObjDocCliente = new ClsEdocumentacion(ObjVentas.IniciaTransacSQL()); + ClsAcumuladores ObjAcum = new ClsAcumuladores(ObjVentas.IniciaTransacSQL()); + ClsContPAQi ObjContPaq = null; + //StringBuilder MensajeAlert = new StringBuilder() ; + try + { + objfact.GuardarVenta(ref objfact, ref ObjVentas, ref ObjConta, ref ObjInventario, ref ObjContr, ref objfact.DtDetalle, objfact.CveNCaVincular, ref ObjContPaq, ref ObjBancos, ref ObjOS, ref ObjEventos, ref ObjCGame, ref ObjClientes, ObjAcum: ObjAcum); + + } + catch (Exception) + { + objfact.CveVenta = -1; + } + if (ObjVentas.UpdateEstatusFactura(3, objxml.complemento.UUID, "", DateTime.ParseExact(objxml.comprobante.Fecha.Replace("T", " "), "yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture), ObjVentas.CveVenta, CvePAC: 4)) + if (objfact.CveVenta > 0 && objfact.ErrorList.Count == 0) + { + ObjVentas.Commit(); + } + else + { + foreach (string item in objfact.ErrorList) + { + strErrores.AppendLine("
"); + strErrores.AppendLine(item); + } + objfact.CveVenta = -1; + ObjVentas.RollBack(); + } + ObjVentas.Dispose(); + ObjConta.Dispose(); + ObjInventario.Dispose(); + ObjCGame.Dispose(); + ObjContr.Dispose(); + ObjDocCliente.Dispose(); + ObjClientes.Dispose(); + ObjAcum.Dispose(); + + } + if (objfact != null && objfact.CveVenta > 0) + { + CargaConciliacionemitidasSATGet(); + Alert($"se ha agregado la factura correctamente.
Ver Factura ", ModExtensiones.TipoMensaje.ToastInformacion, timeout: 25); + } + else { continuar = false; } + if (!continuar) + { + Alert($"no se pudo agregar la factura {strErrores.ToString()}", ModExtensiones.TipoMensaje.MsgAdvertencia); + } + } + } protected void LnkRegistrar_Click(object sender, EventArgs e) { GridViewRow gvrow = (GridViewRow)(((LinkButton)sender).NamingContainer); - string ruta = gvrow.DataKey("RutaXml"); - strErrores = new StringBuilder(); - XmlSatCFDI objxml = null; - Modelos.Factura objfact = null; - bool continuar = true; - objxml = XmlSatCFDI.readXML(ruta); - continuar = continuar && (objxml != null); - if (continuar) - { + registrarventa(gvrow); + //string ruta = gvrow.DataKey("RutaXml"); + //strErrores = new StringBuilder(); + //XmlSatCFDI objxml = null; + //Modelos.Factura objfact = null; + //bool continuar = true; + //objxml = XmlSatCFDI.readXML(ruta); + //continuar = continuar && (objxml != null); + //if (continuar) + //{ - objfact = GetFacturaFromXML(objxml); - } - continuar = continuar && (objfact != null); - if (continuar) - { + // objfact = GetFacturaFromXML(objxml); + //} + //continuar = continuar && (objfact != null); + //if (continuar) + //{ - // Dim As New (ObjVentas.IniciaTransacSQL()) - // Dim As = Nothing - // Dim MensajeAlert = New StringBuilder - ClsVentas ObjVentas = new ClsVentas(); - ClsInventarios ObjInventario = new ClsInventarios(ObjVentas.IniciaTransacSQL()); - ClsContabilidad ObjConta = new ClsContabilidad(ObjVentas.IniciaTransacSQL()); - ClsContratos ObjContr = new ClsContratos(ObjVentas.IniciaTransacSQL()); - ClsOS ObjOS = new ClsOS(ObjVentas.IniciaTransacSQL()); - ClsBancos ObjBancos = new ClsBancos(ObjVentas.IniciaTransacSQL()); - ClsClientes ObjClientes = new ClsClientes(ObjVentas.IniciaTransacSQL()); - ClsOIEventos ObjEventos = new ClsOIEventos(ObjVentas.IniciaTransacSQL()); - ClsCGame ObjCGame = new ClsCGame(ObjVentas.IniciaTransacSQL()); - ClsEdocumentacion ObjDocCliente = new ClsEdocumentacion(ObjVentas.IniciaTransacSQL()); - ClsAcumuladores ObjAcum = new ClsAcumuladores(ObjVentas.IniciaTransacSQL()); - ClsContPAQi ObjContPaq = null; - //StringBuilder MensajeAlert = new StringBuilder() ; - try - { - objfact.GuardarVenta(ref objfact, ref ObjVentas, ref ObjConta, ref ObjInventario, ref ObjContr, ref objfact.DtDetalle, objfact.CveNCaVincular, ref ObjContPaq, ref ObjBancos, ref ObjOS, ref ObjEventos, ref ObjCGame, ref ObjClientes, ObjAcum: ObjAcum); + // // Dim As New (ObjVentas.IniciaTransacSQL()) + // // Dim As = Nothing + // // Dim MensajeAlert = New StringBuilder + // ClsVentas ObjVentas = new ClsVentas(); + // ClsInventarios ObjInventario = new ClsInventarios(ObjVentas.IniciaTransacSQL()); + // ClsContabilidad ObjConta = new ClsContabilidad(ObjVentas.IniciaTransacSQL()); + // ClsContratos ObjContr = new ClsContratos(ObjVentas.IniciaTransacSQL()); + // ClsOS ObjOS = new ClsOS(ObjVentas.IniciaTransacSQL()); + // ClsBancos ObjBancos = new ClsBancos(ObjVentas.IniciaTransacSQL()); + // ClsClientes ObjClientes = new ClsClientes(ObjVentas.IniciaTransacSQL()); + // ClsOIEventos ObjEventos = new ClsOIEventos(ObjVentas.IniciaTransacSQL()); + // ClsCGame ObjCGame = new ClsCGame(ObjVentas.IniciaTransacSQL()); + // ClsEdocumentacion ObjDocCliente = new ClsEdocumentacion(ObjVentas.IniciaTransacSQL()); + // ClsAcumuladores ObjAcum = new ClsAcumuladores(ObjVentas.IniciaTransacSQL()); + // ClsContPAQi ObjContPaq = null; + // //StringBuilder MensajeAlert = new StringBuilder() ; + // try + // { + // objfact.GuardarVenta(ref objfact, ref ObjVentas, ref ObjConta, ref ObjInventario, ref ObjContr, ref objfact.DtDetalle, objfact.CveNCaVincular, ref ObjContPaq, ref ObjBancos, ref ObjOS, ref ObjEventos, ref ObjCGame, ref ObjClientes, ObjAcum: ObjAcum); - } - catch (Exception ) - { - objfact.CveVenta = -1; - } - if (ObjVentas.UpdateEstatusFactura(3, objxml.complemento.UUID, "", DateTime.ParseExact(objxml.comprobante.Fecha.Replace("T", " "), "yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture), ObjVentas.CveVenta, CvePAC: 4)) - if (objfact.CveVenta > 0 && objfact.ErrorList.Count == 0) - { - ObjVentas.Commit(); - } - else - { - foreach (string item in objfact.ErrorList) - { - strErrores.AppendLine("
"); - strErrores.AppendLine(item); - } - objfact.CveVenta = -1; - ObjVentas.RollBack(); - } - ObjVentas.Dispose(); - ObjConta.Dispose(); - ObjInventario.Dispose(); - ObjCGame.Dispose(); - ObjContr.Dispose(); - ObjDocCliente.Dispose(); - ObjClientes.Dispose(); - ObjAcum.Dispose(); + // } + // catch (Exception ) + // { + // objfact.CveVenta = -1; + // } + // if (ObjVentas.UpdateEstatusFactura(3, objxml.complemento.UUID, "", DateTime.ParseExact(objxml.comprobante.Fecha.Replace("T", " "), "yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture), ObjVentas.CveVenta, CvePAC: 4)) + // if (objfact.CveVenta > 0 && objfact.ErrorList.Count == 0) + // { + // ObjVentas.Commit(); + // } + // else + // { + // foreach (string item in objfact.ErrorList) + // { + // strErrores.AppendLine("
"); + // strErrores.AppendLine(item); + // } + // objfact.CveVenta = -1; + // ObjVentas.RollBack(); + // } + // ObjVentas.Dispose(); + // ObjConta.Dispose(); + // ObjInventario.Dispose(); + // ObjCGame.Dispose(); + // ObjContr.Dispose(); + // ObjDocCliente.Dispose(); + // ObjClientes.Dispose(); + // ObjAcum.Dispose(); - } - if (objfact != null && objfact.CveVenta > 0) - { - CargaConciliacionemitidasSATGet(); - Alert($"se ha agregado la factura correctamente.
Ver Factura ", ModExtensiones.TipoMensaje.MsgInformacion); - } - else { continuar = false; } - if (!continuar) - { - Alert($"no se pudo agregar la factura {strErrores.ToString()}", ModExtensiones.TipoMensaje.MsgAdvertencia); - } + //} + //if (objfact != null && objfact.CveVenta > 0) + //{ + // CargaConciliacionemitidasSATGet(); + // Alert($"se ha agregado la factura correctamente.
Ver Factura ", ModExtensiones.TipoMensaje.ToastInformacion,timeout:25); + //} + //else { continuar = false; } + //if (!continuar) + //{ + // Alert($"no se pudo agregar la factura {strErrores.ToString()}", ModExtensiones.TipoMensaje.MsgAdvertencia); + //} } protected Modelos.Factura GetFacturaFromXML(XmlSatCFDI objxml) @@ -389,10 +476,16 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas Row["CveTipoInvPS"] = DrPS["Inv_CveMetodoInventario"]; Row["CveTamaño"] = DrPS["CveTamaño"]; ADSistemaLibrary.SatXml.CFDIConceptoImpuesto impuesto = item.Impuestos.FirstOrDefault(x => x.Impuesto == "002" && x.Tipo == "Traslado"); + decimal sumaimpuesto=0; + decimal PorcentajeIVA = 0; if (impuesto != null) { - Row["PorcentajeIVA"] = impuesto.TasaOCuota; - Row["ImporteIVA"] = impuesto.Importe; + decimal decimpuesto = 0; + decimal.TryParse(impuesto.TasaOCuota, out decimpuesto); + PorcentajeIVA = decimpuesto/100; + Row["PorcentajeIVA"] = decimpuesto / 100; + Row["ImporteIVA"] = decimpuesto / 100;// impuesto.Importe;//Math.Round(item.Importe * (decimpuesto/100), 2); + sumaimpuesto += impuesto.Importe; } else { @@ -403,9 +496,12 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas impuesto = item.Impuestos.FirstOrDefault(x => x.Impuesto == "003" && x.Tipo == "Traslado"); if (impuesto != null) { - Row["PorcentajeIEPS"] = impuesto.TasaOCuota; + decimal decimpuesto = 0; + decimal.TryParse(impuesto.TasaOCuota, out decimpuesto); + Row["PorcentajeIEPS"] = decimpuesto / 100; Row["ImporteIEPS"] = impuesto.Importe; Row["IEPS"] = impuesto.Importe; + sumaimpuesto += impuesto.Importe; } else { @@ -416,8 +512,11 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas impuesto = item.Impuestos.FirstOrDefault(x => x.Impuesto == "001" && x.Tipo == "Retencion"); if (impuesto != null) { + decimal decimpuesto = 0; + decimal.TryParse(impuesto.TasaOCuota, out decimpuesto); + Row["PorcentajeRetISR"] = decimpuesto / 100; Row["ImporteRetISR"] = impuesto.Importe; - Row["PorcentajeRetISR"] = impuesto.TasaOCuota; + sumaimpuesto -= impuesto.Importe; } else { @@ -427,8 +526,11 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas impuesto = item.Impuestos.FirstOrDefault(x => x.Impuesto == "002" && x.Tipo == "Retencion"); if (impuesto != null) { + decimal decimpuesto = 0; + decimal.TryParse(impuesto.TasaOCuota, out decimpuesto); + Row["PorcentajeRetIVA"] = decimpuesto / 100; Row["ImporteRetIVA"] = impuesto.Importe; - Row["PorcentajeRetIVA"] = impuesto.TasaOCuota; + sumaimpuesto -= impuesto.Importe; } else { @@ -438,7 +540,8 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas Row["Descuento"] = item.Descuento; Row["TipoDescuento"] = "2"; - Row["Total"] = item.Importe; + //Row["Total"] = item.Importe - sumaimpuesto; + Row["Total"] = item.Importe /(1+ PorcentajeIVA); Row["TotalImporte"] = item.Importe; Row["SATClaveProdServ"] = item.ClaveProdServ; @@ -468,6 +571,11 @@ public partial class Ventas_RepConciliacionEmitidosSat : ClsPaginas protected void LnkAceptarDefault_Click(object sender, EventArgs e) { RegistraScript("$('#DModalDefaults').modal('hide');"); + //foreach (GridViewRow gvrow in GVConciliacionemitidasSAT.Rows) + //{ + + // registrarventa(gvrow); + //} } } /* From f8179670b40df94370e820c8fb121584ccc87d3d Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Mon, 19 Aug 2019 11:05:35 -0700 Subject: [PATCH 3/4] Entrega Directa requiere Cliente y Vendedor --- OC/OC.aspx | 2 ++ OC/OC.aspx.vb | 6 ++++++ localhost.sln | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 localhost.sln diff --git a/OC/OC.aspx b/OC/OC.aspx index ccc521dda..9fe4917bf 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -589,6 +589,8 @@
+<%-- + --%>
Vendedor: diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 90fb21398..f2bb091f8 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -2219,6 +2219,12 @@ Partial Class OC End Function Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click + 'Entrega Directa requiere Cliente y Vendedor + If ChkEntregaDirecta.Checked And Ddlcliente.SelectedValue.ToEntero <= 0 Then + Alert("Al ser una Entrega Directa es necesario seleccionar un cliente, por favor seleccione uno.") + Exit Sub + End If + 'VALIDACIONES PARA GUARDAR If ValidaGuardar() Then Exit Sub diff --git a/localhost.sln b/localhost.sln new file mode 100644 index 000000000..57e824a65 --- /dev/null +++ b/localhost.sln @@ -0,0 +1,45 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://localhost", "http://localhost", "{82D0C8D1-3CF5-471D-92AF-71A9AE4B4335}" + ProjectSection(WebsiteProperties) = preProject + SccProjectName = ""$/localhost", CAAAAAAA" + SccAuxPath = "" + SccLocalPath = "." + SccProvider = "MSSCCI:Microsoft Visual SourceSafe" + UseIISExpress = "false" + TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.6" + Debug.AspNetCompiler.VirtualPath = "/localhost" + Debug.AspNetCompiler.PhysicalPath = "..\SIGIT\" + Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost\" + Debug.AspNetCompiler.Updateable = "true" + Debug.AspNetCompiler.ForceOverwrite = "true" + Debug.AspNetCompiler.FixedNames = "false" + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.VirtualPath = "/localhost" + Release.AspNetCompiler.PhysicalPath = "..\SIGIT\" + Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost\" + Release.AspNetCompiler.Updateable = "true" + Release.AspNetCompiler.ForceOverwrite = "true" + Release.AspNetCompiler.FixedNames = "false" + Release.AspNetCompiler.Debug = "False" + SlnRelativePath = "..\SIGIT\" + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {82D0C8D1-3CF5-471D-92AF-71A9AE4B4335}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {82D0C8D1-3CF5-471D-92AF-71A9AE4B4335}.Debug|Any CPU.Build.0 = Debug|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B4590109-7BF9-411C-A1AE-792C02707CE6} + EndGlobalSection +EndGlobal From 67e4aadedae3ee3f52869f2e4acb1414f380b32e Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Mon, 19 Aug 2019 12:09:43 -0700 Subject: [PATCH 4/4] Guarda Folio correcto en la Referencia de PrePoliza --- Bancos/IE.aspx.vb | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 78282a279..7a2b5318c 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -2376,13 +2376,18 @@ Partial Class Bancos_IE 'valida prepoliza If CvePrePoliza > 0 Then - Dim Conc As String = If(TxtObservaciones.Text = "", TxtFolio.Text, TxtObservaciones.Text) - Dim Ref As String = If(TxtObservaciones.Text = "", TxtFolio.Text, TxtObservaciones.Text) - + Dim Folio As String = "" CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PagueseA, TxtImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero, TxtTipoCambio.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, ChkAplicaImpuestos.Checked, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveEstatusIE:=DdlEstatusIE.SelectedValue.ToString.ToEntero, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1)) + If ObjIE.GetBancosIE(CveIE, UsuarioActual.CveEmpresa) Then + Folio = ObjIE.Folio + End If + + Dim Conc As String = If(TxtObservaciones.Text = "", Folio, TxtObservaciones.Text) + Dim Ref As String = If(TxtObservaciones.Text = "", Folio, TxtObservaciones.Text) + If CveIE > 0 Then If Comprobante <> "" Then @@ -2562,7 +2567,7 @@ Partial Class Bancos_IE Dim ImporteAplicar = 0.0D Dim ImporteAplicarMN = 0.0D Dim ImporteAplicarME = 0.0D - Dim ReferenciaAplicar = TxtFolio.Text + Dim ReferenciaAplicar = Folio Dim ConceptoAplicar = $"Devolución al cliente {PagueseA} {TxtImporte.Text} NC:{SerieFolioDevDin}" ImporteAplicar = TxtImporte.Text.ToDecimal @@ -2643,7 +2648,7 @@ Partial Class Bancos_IE Dim ImporteAplicar = 0.0D Dim ImporteAplicarMN = 0.0D Dim ImporteAplicarME = 0.0D - Dim ReferenciaAplicar = TxtFolio.Text + Dim ReferenciaAplicar = Folio Dim ConceptoAplicar = $"Devolución de Proveedor {PagueseA} {TxtImporte.Text} NC:{SerieFolioDeCDin}" @@ -3038,11 +3043,11 @@ Partial Class Bancos_IE If DdlTipoTransaccion.SelectedValue = "1" Then TipoChq = "CHQ" ConceptoRenglon = String.Format("Anticipo {0}", PagueseA) - IDPoliza = Conta.AddPoliza(2, ConceptoRenglon, Total, Total, UsuarioActual.CveUsuario, Fecha, TxtFolio.Text, TipoChq) + IDPoliza = Conta.AddPoliza(2, ConceptoRenglon, Total, Total, UsuarioActual.CveUsuario, Fecha, Folio, TipoChq) If IDPoliza > 0 Then FolioPoliza = Conta.Folio - Referencia = TxtFolio.Text + Referencia = Folio ConceptoRenglon = String.Format("Anticipo {0} {1}", PagueseA, TxtObservaciones.Text) Total = TxtImporte.Text.ToDouble