Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -3201,7 +3201,7 @@ Public Class ClsContratos
|
||||
End Function
|
||||
|
||||
|
||||
Public Function GetPresupuestosResumen(CveEmpresa As Integer, CveSubProyecto As Integer, Opcion As Integer) As Boolean
|
||||
Public Function GetPresupuestosResumen(CveEmpresa As Integer, CveSubProyecto As Integer, FechaInicio As Date, FechaFin As Date, Opcion As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Con_PresupuestosResumenGet")
|
||||
@@ -3209,6 +3209,8 @@ Public Class ClsContratos
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
||||
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
|
||||
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -3,8 +3,6 @@ Option Strict On
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Web.XmlTransform
|
||||
Imports Telerik.Web.UI.ComboBox.ComboBoxStyles
|
||||
|
||||
Public Class ClsInventarios
|
||||
Implements IDisposable
|
||||
|
||||
@@ -481,7 +481,7 @@ Public Class ClsSisUsuarios
|
||||
Retorno.Portal = True
|
||||
Retorno.Referencia = Data.Rows(0)("Referencia").ToString
|
||||
Retorno.EsSupervisorRH = If(Data.Rows(0)("EsSupervisorRH").ToString = "1", True, False)
|
||||
'Retorno.Liga = Data.Rows(0)("Liga").ToString
|
||||
Retorno.RutaDB = ConnStr
|
||||
'cargo los modulos del usuario y genero el menú
|
||||
Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveCliente)
|
||||
|
||||
@@ -538,7 +538,7 @@ Public Class ClsSisUsuarios
|
||||
Retorno.Portal = True
|
||||
Retorno.Referencia = Data.Rows(0)("Referencia").ToString
|
||||
Retorno.EsSupervisorRH = If(Data.Rows(0)("EsSupervisorRH").ToString = "1", True, False)
|
||||
'Retorno.Liga = Data.Rows(0)("Liga").ToString
|
||||
Retorno.RutaDB = ConnStr
|
||||
'cargo los modulos del usuario y genero el menú
|
||||
Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveProveedor)
|
||||
|
||||
|
||||
@@ -1977,14 +1977,14 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetRepPSEcono(CveSubProyecto As Integer, CvePS As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional GPO As Integer = -1,
|
||||
Public Function GetRepPSEcono(CveSubProyectos As String, CvePS As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional GPO As Integer = -1,
|
||||
Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0,
|
||||
Optional Clasificacion As String = "-1", Optional Linea As String = "-1", Optional Marca As String = "-1", Optional orden As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_RepPSEconoGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveSubProyectos", SqlDbType.VarChar).Value = CveSubProyectos
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@FechaI", SqlDbType.Date).Value = FechaI
|
||||
.Add("@FechaF", SqlDbType.Date).Value = FechaF
|
||||
|
||||
@@ -930,19 +930,23 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
Dim CveAlmacen = IfNull(context.Request("cvealmacen"), "-1").ToString.ToEntero
|
||||
|
||||
Dim UsaGlobal As Boolean = True
|
||||
Dim MostrarTodosAlmacenes As Boolean = False
|
||||
Dim MostrarTodosAlmacenes As Boolean = True
|
||||
|
||||
'verifica existencias
|
||||
If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso usuario.Empresa.Funcionalidad(141) = "1" Then
|
||||
UsaGlobal = False
|
||||
If usuario.CveEmpresa = 119 Then MostrarTodosAlmacenes = False
|
||||
'If (usuario.Empresa.Funcionalidad(558) = "1") AndAlso Pagina.Contiene("ventas/ventas") Then
|
||||
' MostrarTodosAlmacenes = True
|
||||
'End If
|
||||
|
||||
If (usuario.Empresa.Funcionalidad(558) = "1") AndAlso Pagina.Contiene("ventas/ventas") Then
|
||||
MostrarTodosAlmacenes = True
|
||||
End If
|
||||
'If (usuario.Empresa.Funcionalidad(578) = "1") AndAlso Pagina.Contiene("ventas/ventas") Then 'sms
|
||||
' MostrarTodosAlmacenes = True
|
||||
'End If
|
||||
|
||||
If (usuario.Empresa.Funcionalidad(578) = "1") AndAlso Pagina.Contiene("ventas/ventas") Then 'sms
|
||||
MostrarTodosAlmacenes = True
|
||||
End If
|
||||
'If (usuario.Empresa.CveEmpresa.Contiene(189, 193, 195, 197)) AndAlso Pagina.Contiene("ventas/ventas") Then 'sms
|
||||
' MostrarTodosAlmacenes = True
|
||||
'End If
|
||||
|
||||
Dim objInv As New ClsInventarios
|
||||
Try
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<li>
|
||||
<asp:HyperLink ID="HpLPrePoliza" NavigateUrl="#" runat="server" Visible="false" Style="color: #686868;"><i class="" style="color:#686868;"></i> PrePoliza</asp:HyperLink>
|
||||
<asp:HyperLink ID="HpLPrePoliza" NavigateUrl="#" runat="server" Visible="false" Style="color: #686868;"><i class="" style="color:#686868;"></i> Póliza</asp:HyperLink>
|
||||
</li>
|
||||
<asp:UpdatePanel ID="UppEliminarIE" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
@@ -55,11 +55,10 @@
|
||||
|
||||
<asp:GridView ID="GvS" runat="server" AutoGenerateColumns="False" ShowFooter="True" EmptyDataText="No se encontraron Cuentas X Pagar Pendientes" CssClass="table table-striped table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<asp:BoundField ItemStyle-Width="5%" ItemStyle-CssClass="Texto" DataField="NumCuenta" HeaderText="Cuenta" Visible="false"></asp:BoundField>
|
||||
<asp:HyperLinkField ItemStyle-Width="5%" ItemStyle-CssClass="Texto" DataTextField="TipoTransaccionAbrev" HeaderText="Tipo" DataNavigateUrlFormatString="IE.aspx?CveIE={0}" DataNavigateUrlFields="CveIE"></asp:HyperLinkField>
|
||||
<asp:HyperLinkField ItemStyle-Width="5%" ItemStyle-CssClass="Texto" DataTextField="Folio" HeaderText="Folio" DataNavigateUrlFormatString="IE.aspx?CveIE={0}" DataNavigateUrlFields="CveIE"></asp:HyperLinkField>
|
||||
<asp:BoundField ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" DataField="FechaDocumento" DataFormatString="{0:d}" HeaderText="Fecha"></asp:BoundField>
|
||||
<asp:BoundField ItemStyle-Width="15%" ItemStyle-CssClass="Texto" DataField="TipoTransaccion" HeaderText="Tipo" ></asp:BoundField>
|
||||
<asp:BoundField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" DataField="FechaDocumento" DataFormatString="{0:d}" HeaderText="Fecha"></asp:BoundField>
|
||||
<asp:BoundField ItemStyle-Width="15%" DataField="PagueseA" HeaderText="Beneficiario/Pagador" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
|
||||
<asp:BoundField ItemStyle-Width="15%" DataField="Observaciones" HeaderText="Observaciones" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
|
||||
<asp:BoundField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" DataField="EstatusIE" HeaderText="Estatus"></asp:BoundField>
|
||||
|
||||
@@ -1875,407 +1875,407 @@ Partial Class Compras_Compras
|
||||
CreaDTConceptos()
|
||||
CargaComprobanteXML(XMLDoc)
|
||||
If NuevaValidacionXML = 1 OrElse (Version = "3.3" OrElse Version = "4.0") Then
|
||||
Dim Xml As String
|
||||
Dim nodo As XmlNode = XMLDoc.DocumentElement
|
||||
Dim Version As String = ValorXML(nodo, "version")
|
||||
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
|
||||
Dim cfdVer As String = ""
|
||||
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
|
||||
Dim Xml As String
|
||||
Dim nodo As XmlNode = XMLDoc.DocumentElement
|
||||
Dim Version As String = ValorXML(nodo, "version")
|
||||
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
|
||||
Dim cfdVer As String = ""
|
||||
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
|
||||
|
||||
If Version = "3.2" Then
|
||||
Prefijo = "cfd"
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
ElseIf Version = "3.3" Then
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/3"
|
||||
Else ' se considera que es la version 4.0
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/4"
|
||||
End If
|
||||
|
||||
'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
|
||||
namespaces.AddNamespace(Prefijo, cfdVer)
|
||||
namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas")
|
||||
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
|
||||
namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
|
||||
namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal")
|
||||
|
||||
Dim nodeconceptos As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Conceptos", Prefijo), namespaces)
|
||||
Xml = Replace(nodeconceptos.OuterXml, "<cfdi:", "<")
|
||||
Xml = Xml.Replace("</cfdi:", "</")
|
||||
Xml = Xml.Replace("xmlns:cfdi=""http://www.sat.gob.mx/cfd/3""", "")
|
||||
Xml = Xml.Replace("xmlns:cfdi=""http://www.sat.gob.mx/cfd/4""", "")
|
||||
Xml = Xml.Replace(""", "") 'comillas
|
||||
Xml = System.Web.HttpUtility.HtmlDecode(Xml.ToString)
|
||||
Xml = Xml.Replace(Chr(13), "") 'salto de linea
|
||||
Xml = Xml.Replace(Chr(10), "")
|
||||
Xml = Xml.Replace("<br />", "") 'salto de linea html
|
||||
Xml = Xml.Replace("<br>", "")
|
||||
Xml = Xml.Replace("<", "")
|
||||
Xml = Xml.Replace("&", "") 'adicional, si hay otros
|
||||
|
||||
If ObjeFacturas.GetFacturasComparacionXML(Version, Xml, UsuarioActual.CveEmpresa) Then
|
||||
TmpDT = ObjeFacturas.DtResultados
|
||||
TmpDT.Columns.Add("CveSATPSActualizado")
|
||||
SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL
|
||||
|
||||
If Not TmpDT.Columns.Contains("Amortizacion") Then
|
||||
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
|
||||
End If
|
||||
|
||||
AddPS2(False)
|
||||
|
||||
'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101
|
||||
Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
|
||||
For Each drr As DataRow In TmpDT.FiltraParametros("ClaveProdServ = '01010101'").Rows
|
||||
ProductosCodigoSATNoPermitidos.AppendFormat("{0}</br>", drr("PS"))
|
||||
Next
|
||||
|
||||
If TmpDT.MAX("RetISRPorcentaje").ToDecimal = 0.0125 Then RetISRResico = True
|
||||
If TmpDT.MAX("RetIVAPorcentaje").ToDecimal = 0.04 Then RetIVAFlete = True
|
||||
|
||||
If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
|
||||
Dim mensajeAdvertencia As String = String.Format("El XML que intenta registrar contiene partidas o artículos con código SAT ‘01010101’ el cual no es aceptado, hable con su proveedor para cancelar y/o refacturar un XML válido.<br/> Partidas o artículos con código ‘01010101’: </br></br>{0}", ProductosCodigoSATNoPermitidos.ToString)
|
||||
Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
|
||||
If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso Not UsuarioActual.CveUsuario.Contiene(1719, 1721) Then BtnGuardar.Enabled = False '' solo se activa para el usuario Sara.JAM
|
||||
BtnGuardar.ToolTip = "No se permite registrar facturas con conceptos con código '01010101'. Solicite al proveedor un nuevo comprobante."
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim SbValRet As New StringBuilder
|
||||
For Each concepto As XmlNode In nodeconceptos
|
||||
' Obtener la descripción del concepto
|
||||
Dim descripcion As String = ValorXML(concepto, "Descripcion")
|
||||
Dim importeValue As Decimal = Decimal.Parse(ValorXML(concepto, "Importe"))
|
||||
|
||||
' Seleccionar el nodo de Impuestos dentro de Concepto, si existe
|
||||
Dim impuestosNode As XmlNode = concepto.SelectSingleNode("cfdi:Impuestos", namespaces)
|
||||
|
||||
If Not impuestosNode Is Nothing Then
|
||||
' Seleccionar los nodos de Retencion dentro de Impuestos
|
||||
Dim retenciones As XmlNodeList = impuestosNode.SelectNodes("cfdi:Retenciones/cfdi:Retencion", namespaces)
|
||||
For Each retencion As XmlNode In retenciones
|
||||
' Obtener los valores de los atributos Base e Importe
|
||||
Dim baseValue As Decimal = Decimal.Parse(ValorXML(retencion, "Base"))
|
||||
Dim impuesto As String = ValorXML(retencion, "Impuesto")
|
||||
|
||||
If impuesto = "001" Then
|
||||
impuesto = "Retención ISR"
|
||||
ElseIf impuesto = "002" Then
|
||||
impuesto = "Retención IVA"
|
||||
ElseIf impuesto = "003" Then
|
||||
impuesto = "IEPS"
|
||||
End If
|
||||
|
||||
|
||||
' Validar si Base coincide con Importe
|
||||
If baseValue <> importeValue Then
|
||||
'SbValRet.Append($"La base e importe de la retención del impuesto {impuesto} no coinciden para {descripcion}. Base: {baseValue.ToString()}, Importe: {importeValue.ToString()} <br>")
|
||||
SbValRet.Append($"Producto: {descripcion} La base e importe del impuesto {impuesto} no coincide Base: {baseValue.ToString()}, Importe Producto: {importeValue.ToString()} <br>")
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
|
||||
If SbValRet.ToString.Trim.Length > 0 Then
|
||||
Alert(SbValRet.ToString, TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Else
|
||||
CargaConceptosXML(XMLDoc)
|
||||
If Version = "3.2" Then
|
||||
Prefijo = "cfd"
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
ElseIf Version = "3.3" Then
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/3"
|
||||
Else ' se considera que es la version 4.0
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/4"
|
||||
End If
|
||||
|
||||
Select Case TipoComprobante
|
||||
Case "ingreso" : DdlTipoComprobante.SelectedValue = "Fac" : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC")) : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
|
||||
Case "egreso" : DdlTipoComprobante.SelectedValue = "NC" : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Fac")) : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) : ChkAplicaNotaCredito.Enabled = False
|
||||
Case "I"
|
||||
DdlTipoComprobante.SelectedValue = "Fac"
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
|
||||
DdlTipoCompra.Items.Remove(DdlTipoCompra.Items.FindByValue("6"))
|
||||
DdlTipoCompra.Items.Remove(DdlTipoCompra.Items.FindByValue("11"))
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then DdlTipoCompra.Items.Add(New ListItem("Recolección", "14"))
|
||||
Case "E"
|
||||
DdlTipoComprobante.SelectedValue = "NC"
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Fac"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
|
||||
ChkAplicaNotaCredito.Enabled = False
|
||||
'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
|
||||
DdlTipoCompra.Items.Clear()
|
||||
DdlTipoCompra.Items.Add(New ListItem("Seleccione", "-1"))
|
||||
DdlTipoCompra.Items.Add(New ListItem("NC Con Productos", "6"))
|
||||
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
|
||||
DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
|
||||
DdlTipoCompra.Items.Add(New ListItem("Garantía", "12"))
|
||||
Case "T"
|
||||
DdlTipoCompra.Items.Clear()
|
||||
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
|
||||
DdlTipoComprobante.SelectedValue = "Fac"
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
|
||||
namespaces.AddNamespace(Prefijo, cfdVer)
|
||||
namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas")
|
||||
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
|
||||
namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
|
||||
namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal")
|
||||
|
||||
End Select
|
||||
Dim nodeconceptos As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Conceptos", Prefijo), namespaces)
|
||||
Xml = Replace(nodeconceptos.OuterXml, "<cfdi:", "<")
|
||||
Xml = Xml.Replace("</cfdi:", "</")
|
||||
Xml = Xml.Replace("xmlns:cfdi=""http://www.sat.gob.mx/cfd/3""", "")
|
||||
Xml = Xml.Replace("xmlns:cfdi=""http://www.sat.gob.mx/cfd/4""", "")
|
||||
Xml = Xml.Replace(""", "") 'comillas
|
||||
Xml = System.Web.HttpUtility.HtmlDecode(Xml.ToString)
|
||||
Xml = Xml.Replace(Chr(13), "") 'salto de linea
|
||||
Xml = Xml.Replace(Chr(10), "")
|
||||
Xml = Xml.Replace("<br />", "") 'salto de linea html
|
||||
Xml = Xml.Replace("<br>", "")
|
||||
Xml = Xml.Replace("<", "")
|
||||
Xml = Xml.Replace("&", "") 'adicional, si hay otros
|
||||
|
||||
'DIV ALIAS
|
||||
CargaPSAlias()
|
||||
|
||||
RFC = dr("RFCDe").ToString
|
||||
RFCProveedor = RFC
|
||||
TxtFecha.Text = dr("FechaFactura").ToString.ToDate.ToShortDateString
|
||||
TxtSerie.Text = dr("Serie").ToString
|
||||
TxtFolio.Text = dr("Folio").ToString
|
||||
DdlValidadaSAT.SelectedValue = If(dr("FueValidado").ToString.Contiene("Si", "1"), "Si", "No")
|
||||
DdlValidadaSAT.Enabled = False
|
||||
LblTipoFact.Text = dr("TipoFactura").ToString
|
||||
SerieVieja = dr("Serie").ToString
|
||||
LblMetodoPago.Text = MetodoPago
|
||||
|
||||
Dim SubTotal2, IVA, IEPS As Decimal
|
||||
IVA = TrasladoIVA
|
||||
|
||||
If Not UsuarioActual.TienePermisoProceso(130) Then
|
||||
TxtFolio.Enabled = False
|
||||
TxtSerie.Enabled = False
|
||||
End If
|
||||
|
||||
'PERMISO PARA MODIFICACIÓN DE FECHA AUN CON FACTURA
|
||||
TxtFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
|
||||
ImgFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
|
||||
CEFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
|
||||
|
||||
TxtSubTotal.Enabled = False
|
||||
TxtDescuento.Enabled = False
|
||||
TxtSubTotal2.Enabled = False
|
||||
TxtIVA.Enabled = False
|
||||
TxtTotal.Enabled = False
|
||||
DdlProveedor.Enabled = False
|
||||
|
||||
If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True : TxtSerie.Enabled = True
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(112) Then
|
||||
PermisoEdicionManual = True
|
||||
TxtSubTotal.Enabled = True
|
||||
TxtDescuento.Enabled = True
|
||||
TxtSubTotal2.Enabled = True
|
||||
TxtIVA.Enabled = True
|
||||
TxtTotal.Enabled = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(118) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Fac" Then
|
||||
VerVales.Visible = True
|
||||
End If
|
||||
|
||||
If TieneAnticiposXML Then 'si tiene anticipos, limpia los descuentos
|
||||
'LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
|
||||
TxtDescuento.Text = "0.00"
|
||||
LblAmortizacion.Text = Descuentos.FormatoNumero
|
||||
'limpia los descuentos
|
||||
For Each drr As DataRow In TmpDT.Rows
|
||||
'drr("Total") = drr("Total").ToString.ToDecimal + drr("Descuento").ToString.ToDecimal
|
||||
drr("Amortizacion") = drr("Descuento") 'pasamos el importe de descuento a amortizacion
|
||||
drr("Descuento") = 0.00
|
||||
Next
|
||||
Amortizaciones = Descuentos
|
||||
Descuentos = 0
|
||||
End If
|
||||
|
||||
Dim Msg As String = ""
|
||||
If Version = "3.3" Or Version = "4.0" Then
|
||||
If ObjeFacturas.GetFacturasComparacionXML(Version, Xml, UsuarioActual.CveEmpresa) Then
|
||||
TmpDT = ObjeFacturas.DtResultados
|
||||
TmpDT.Columns.Add("CveSATPSActualizado")
|
||||
SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL
|
||||
|
||||
If Not TmpDT.Columns.Contains("Amortizacion") Then
|
||||
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
|
||||
End If
|
||||
TmpDT.AcceptChanges()
|
||||
ValidacionesTotalesXml()
|
||||
Else
|
||||
'PRUEBA
|
||||
'http://rm/Compras/Compras.aspx?CveFactura=122518 Emp: 48
|
||||
|
||||
'tTotal = Math.Round(SubTotal2 + IVA - RetencionIVA - RetencionISR + IEPS + OtrosImpuestos, 2)
|
||||
HdnCompraSaldo.Value = Total.ToString
|
||||
CompraSaldo = Total
|
||||
Dim AjustaUltimoConcepto As Boolean = False
|
||||
AddPS2(False)
|
||||
|
||||
'AGREGA IEPS COMO CONCEPTO
|
||||
If TrasladoIEPS > 0 And UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero > 0 Then
|
||||
AgregarConceptoIEPS(TrasladoIEPS, UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero)
|
||||
' TrasladoIEPS = 0
|
||||
'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101
|
||||
Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
|
||||
For Each drr As DataRow In TmpDT.FiltraParametros("ClaveProdServ = '01010101'").Rows
|
||||
ProductosCodigoSATNoPermitidos.AppendFormat("{0}</br>", drr("PS"))
|
||||
Next
|
||||
|
||||
If TmpDT.MAX("RetISRPorcentaje").ToDecimal = 0.0125 Then RetISRResico = True
|
||||
If TmpDT.MAX("RetIVAPorcentaje").ToDecimal = 0.04 Then RetIVAFlete = True
|
||||
|
||||
If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
|
||||
Dim mensajeAdvertencia As String = String.Format("El XML que intenta registrar contiene partidas o artículos con código SAT ‘01010101’ el cual no es aceptado, hable con su proveedor para cancelar y/o refacturar un XML válido.<br/> Partidas o artículos con código ‘01010101’: </br></br>{0}", ProductosCodigoSATNoPermitidos.ToString)
|
||||
Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
|
||||
If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso Not UsuarioActual.CveUsuario.Contiene(1719, 1721) Then BtnGuardar.Enabled = False '' solo se activa para el usuario Sara.JAM
|
||||
BtnGuardar.ToolTip = "No se permite registrar facturas con conceptos con código '01010101'. Solicite al proveedor un nuevo comprobante."
|
||||
End If
|
||||
'en otro impuesto lo esta registrando en ajuste en automatico
|
||||
If OtrosImpuestos > 0 Then
|
||||
AjustaUltimoConcepto = True
|
||||
End If
|
||||
|
||||
If RFC = "CFE370814QI0" Then ' RFC de CFE, se hace un ajuste por diferencia para sacar el DAP
|
||||
'OtrosImpuestos = Total - (SubTotal2 + IVA)
|
||||
'este importe lo vamos a meter al gasto
|
||||
'AjustaImporteUltimoConcepto(OtrosImpuestos)
|
||||
OtrosImpuestos = 1
|
||||
AjustaUltimoConcepto = True
|
||||
'SubTotal2 = SubTotal
|
||||
End If
|
||||
|
||||
Dim SubTotalReal As Decimal = 0
|
||||
SubTotalReal = Math.Round(Total + RetencionISR + RetencionIVA - IVA + Descuentos - TrasladoIEPS, 2) ' NO se incluye otros impuestos para ajustar esa cifra
|
||||
Dim DiferenciaTotales As Decimal = SubTotalReal - Math.Round(SubTotalConceptos, 2)
|
||||
|
||||
If DiferenciaTotales <> 0 Then
|
||||
'Verificamos IEPS y Otros Impuestos
|
||||
'restricccion general, que si el subtotal de los conceptos no cuadra con Total + RetISR + RetIVA - IVA <> SubTotalConeptos, ajuste al final
|
||||
If TrasladoIEPS > 0 OrElse OtrosImpuestos > 0 OrElse Math.Abs(DiferenciaTotales) < 1 Then
|
||||
|
||||
'Condicion necesaria cuando hay IVA pero no hay diferencia
|
||||
If DiferenciaTotales <> 0 Then
|
||||
|
||||
If DiferenciaTotales < 50 OrElse AjustaUltimoConcepto = True Then
|
||||
Dim IA As Decimal = Total + RetencionISR + RetencionIVA - IVA - SubTotalConceptos - TrasladoIEPS + Descuentos
|
||||
AjustaImporteUltimoConcepto(IA, True)
|
||||
|
||||
ElseIf DiferenciaTotales > 50 Then
|
||||
PnlAjusteProductos.Visible = True
|
||||
Dim Porcentaje As Double = Math.Round((SubTotalConceptos - SubTotalReal) / SubTotalConceptos * 100, 2)
|
||||
TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero
|
||||
Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente <br>")
|
||||
ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
|
||||
|
||||
'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
|
||||
For Each Row As GridViewRow In GvPS.Rows
|
||||
Row.FCLinkButton("imgE").Visible = False
|
||||
Row.FCLinkButton("imgD").Visible = False
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
TrasladoIEPS = 0 : OtrosImpuestos = 0 : SubTotal2 = SubTotal
|
||||
Else
|
||||
PnlAjusteProductos.Visible = True
|
||||
Dim Porcentaje As Double = If(SubTotalConceptos > 0, Math.Round((SubTotalConceptos - SubTotalReal) / SubTotalConceptos * 100, 2), 0)
|
||||
TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero
|
||||
Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente <br>")
|
||||
ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
|
||||
|
||||
'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
|
||||
For Each Row As GridViewRow In GvPS.Rows
|
||||
Row.FCLinkButton("imgE").Visible = False
|
||||
Row.FCLinkButton("imgD").Visible = False
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
'Si no hay diferencias pero tenemos descuento, se ofrece la opcion para ajustar el gasto
|
||||
If Descuentos > 0 Then
|
||||
|
||||
'[IPP] PARCHE: Factura TELMEX para APH 12/ENERO/2018
|
||||
If CveFactura = 286290 Then
|
||||
|
||||
Else
|
||||
PnlAjusteProductos.Visible = True
|
||||
Dim Porcentaje As Double = Math.Round((Descuentos) / (SubTotalConceptos) * 100, 4)
|
||||
TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero(4)
|
||||
Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente <br>")
|
||||
ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
|
||||
|
||||
'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
|
||||
For Each Row As GridViewRow In GvPS.Rows
|
||||
Row.FCLinkButton("imgE").Visible = False
|
||||
Row.FCLinkButton("imgD").Visible = False
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
SubTotal2 = SubTotalReal - Descuentos
|
||||
|
||||
If Descuentos > 0 Then
|
||||
TrDescuento.Visible = True
|
||||
End If
|
||||
|
||||
If Msg <> "" Then
|
||||
Alert(Msg, TipoMensaje.MsgAdvertencia)
|
||||
BtnGuardar.Enabled = False
|
||||
End If
|
||||
'AJUSTAMOS SUBTOTAL EN CASO DE SER DIFERENTE AL SUBTOTAL2 DEL XML (TOTAL - IVA)
|
||||
If SubTotal2 <> SubTotal Then
|
||||
SubTotal = SubTotalConceptos
|
||||
End If
|
||||
|
||||
TxtSubTotal.Text = SubTotal.FormatoNumero
|
||||
TxtDescuento.Text = Descuentos.FormatoNumero
|
||||
TxtSubTotal2.Text = SubTotal2.FormatoNumero
|
||||
TxtIVA.Text = IVA.FormatoNumero
|
||||
TxtTotal.Text = Total.ToString.FormatoNumero
|
||||
|
||||
HfTotalCompra.Value = Total.ToString
|
||||
CompraSaldo = Total
|
||||
|
||||
CalculaTotalPorDevengar()
|
||||
TxtDocumentoImporteFE.Text = Total.ToString
|
||||
RVDocumentoImporte.MaximumValue = Math.Round(Total, 2).ToString
|
||||
RVDocumentoImporteFE.MaximumValue = RVDocumentoImporte.MaximumValue
|
||||
RVDocumentoImporteCaja.MaximumValue = RVDocumentoImporte.MaximumValue
|
||||
TxtDocumentoImporte.Text = Total.FormatoNumero
|
||||
TxtDocumentoImporteCaja.Text = Total.FormatoNumero
|
||||
TxtRetIVA.Text = RetencionIVA.FormatoNumero
|
||||
TxtRetISR.Text = RetencionISR.FormatoNumero
|
||||
TxtIEPS.Text = IEPS.FormatoNumero
|
||||
If IEPS > 0 Then TrIEPS.Visible = True
|
||||
If RetencionIVA > 0 Then TrRetIVA.Visible = True
|
||||
If RetencionISR > 0 Then TrRetISR.Visible = True
|
||||
TxtOtrosImpuestos.Text = OtrosImpuestos.FormatoNumero
|
||||
If OtrosImpuestos > 0 Then TrOtrosImpuestos.Visible = True
|
||||
|
||||
HFDiferenciaCompra.Value = TxtTotal.Text
|
||||
'ASIGNA VALORES ORIGINALES PARA GUARDAR
|
||||
AsignaValoresOriginales(SubTotal, SubTotal2, IVA, RetencionIVA, RetencionISR, Total)
|
||||
|
||||
End If
|
||||
TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
|
||||
|
||||
Dim drMon As DataRow = GlobalDTMonedas.FiltroPrimero(String.Format(" (Abreviatura LIKE '%{0}%' OR Moneda LIKE '%{0}%' )", Moneda))
|
||||
|
||||
|
||||
Dim SbValRet As New StringBuilder
|
||||
For Each concepto As XmlNode In nodeconceptos
|
||||
' Obtener la descripción del concepto
|
||||
Dim descripcion As String = ValorXML(concepto, "Descripcion")
|
||||
Dim importeValue As Decimal = Decimal.Parse(ValorXML(concepto, "Importe"))
|
||||
|
||||
' Seleccionar el nodo de Impuestos dentro de Concepto, si existe
|
||||
Dim impuestosNode As XmlNode = concepto.SelectSingleNode("cfdi:Impuestos", namespaces)
|
||||
|
||||
If Not impuestosNode Is Nothing Then
|
||||
' Seleccionar los nodos de Retencion dentro de Impuestos
|
||||
Dim retenciones As XmlNodeList = impuestosNode.SelectNodes("cfdi:Retenciones/cfdi:Retencion", namespaces)
|
||||
For Each retencion As XmlNode In retenciones
|
||||
' Obtener los valores de los atributos Base e Importe
|
||||
Dim baseValue As Decimal = Decimal.Parse(ValorXML(retencion, "Base"))
|
||||
Dim impuesto As String = ValorXML(retencion, "Impuesto")
|
||||
|
||||
If impuesto = "001" Then
|
||||
impuesto = "Retención ISR"
|
||||
ElseIf impuesto = "002" Then
|
||||
impuesto = "Retención IVA"
|
||||
ElseIf impuesto = "003" Then
|
||||
impuesto = "IEPS"
|
||||
End If
|
||||
|
||||
|
||||
' Validar si Base coincide con Importe
|
||||
If baseValue <> importeValue Then
|
||||
'SbValRet.Append($"La base e importe de la retención del impuesto {impuesto} no coinciden para {descripcion}. Base: {baseValue.ToString()}, Importe: {importeValue.ToString()} <br>")
|
||||
SbValRet.Append($"Producto: {descripcion} La base e importe del impuesto {impuesto} no coincide Base: {baseValue.ToString()}, Importe Producto: {importeValue.ToString()} <br>")
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
|
||||
If SbValRet.ToString.Trim.Length > 0 Then
|
||||
Alert(SbValRet.ToString, TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Else
|
||||
CargaConceptosXML(XMLDoc)
|
||||
End If
|
||||
|
||||
Select Case TipoComprobante
|
||||
Case "ingreso" : DdlTipoComprobante.SelectedValue = "Fac" : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC")) : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
|
||||
Case "egreso" : DdlTipoComprobante.SelectedValue = "NC" : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Fac")) : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) : ChkAplicaNotaCredito.Enabled = False
|
||||
Case "I"
|
||||
DdlTipoComprobante.SelectedValue = "Fac"
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
|
||||
DdlTipoCompra.Items.Remove(DdlTipoCompra.Items.FindByValue("6"))
|
||||
DdlTipoCompra.Items.Remove(DdlTipoCompra.Items.FindByValue("11"))
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then DdlTipoCompra.Items.Add(New ListItem("Recolección", "14"))
|
||||
Case "E"
|
||||
DdlTipoComprobante.SelectedValue = "NC"
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Fac"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
|
||||
ChkAplicaNotaCredito.Enabled = False
|
||||
|
||||
DdlTipoCompra.Items.Clear()
|
||||
DdlTipoCompra.Items.Add(New ListItem("Seleccione", "-1"))
|
||||
DdlTipoCompra.Items.Add(New ListItem("NC Con Productos", "6"))
|
||||
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
|
||||
DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
|
||||
DdlTipoCompra.Items.Add(New ListItem("Garantía", "12"))
|
||||
Case "T"
|
||||
DdlTipoCompra.Items.Clear()
|
||||
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
|
||||
DdlTipoComprobante.SelectedValue = "Fac"
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
|
||||
|
||||
End Select
|
||||
|
||||
'DIV ALIAS
|
||||
CargaPSAlias()
|
||||
|
||||
RFC = dr("RFCDe").ToString
|
||||
RFCProveedor = RFC
|
||||
TxtFecha.Text = dr("FechaFactura").ToString.ToDate.ToShortDateString
|
||||
TxtSerie.Text = dr("Serie").ToString
|
||||
TxtFolio.Text = dr("Folio").ToString
|
||||
DdlValidadaSAT.SelectedValue = If(dr("FueValidado").ToString.Contiene("Si", "1"), "Si", "No")
|
||||
DdlValidadaSAT.Enabled = False
|
||||
LblTipoFact.Text = dr("TipoFactura").ToString
|
||||
SerieVieja = dr("Serie").ToString
|
||||
LblMetodoPago.Text = MetodoPago
|
||||
|
||||
Dim SubTotal2, IVA, IEPS As Decimal
|
||||
IVA = TrasladoIVA
|
||||
|
||||
If Not UsuarioActual.TienePermisoProceso(130) Then
|
||||
TxtFolio.Enabled = False
|
||||
TxtSerie.Enabled = False
|
||||
End If
|
||||
|
||||
'PERMISO PARA MODIFICACIÓN DE FECHA AUN CON FACTURA
|
||||
TxtFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
|
||||
ImgFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
|
||||
CEFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
|
||||
|
||||
TxtSubTotal.Enabled = False
|
||||
TxtDescuento.Enabled = False
|
||||
TxtSubTotal2.Enabled = False
|
||||
TxtIVA.Enabled = False
|
||||
TxtTotal.Enabled = False
|
||||
DdlProveedor.Enabled = False
|
||||
|
||||
If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True : TxtSerie.Enabled = True
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(112) Then
|
||||
PermisoEdicionManual = True
|
||||
TxtSubTotal.Enabled = True
|
||||
TxtDescuento.Enabled = True
|
||||
TxtSubTotal2.Enabled = True
|
||||
TxtIVA.Enabled = True
|
||||
TxtTotal.Enabled = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(118) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Fac" Then
|
||||
VerVales.Visible = True
|
||||
End If
|
||||
|
||||
If TieneAnticiposXML Then 'si tiene anticipos, limpia los descuentos
|
||||
'LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
|
||||
TxtDescuento.Text = "0.00"
|
||||
LblAmortizacion.Text = Descuentos.FormatoNumero
|
||||
'limpia los descuentos
|
||||
For Each drr As DataRow In TmpDT.Rows
|
||||
'drr("Total") = drr("Total").ToString.ToDecimal + drr("Descuento").ToString.ToDecimal
|
||||
drr("Amortizacion") = drr("Descuento") 'pasamos el importe de descuento a amortizacion
|
||||
drr("Descuento") = 0.00
|
||||
Next
|
||||
Amortizaciones = Descuentos
|
||||
Descuentos = 0
|
||||
End If
|
||||
|
||||
Dim Msg As String = ""
|
||||
If Version = "3.3" Or Version = "4.0" Then
|
||||
|
||||
If Not TmpDT.Columns.Contains("Amortizacion") Then
|
||||
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
|
||||
End If
|
||||
TmpDT.AcceptChanges()
|
||||
ValidacionesTotalesXml()
|
||||
Else
|
||||
'PRUEBA
|
||||
'http://rm/Compras/Compras.aspx?CveFactura=122518 Emp: 48
|
||||
|
||||
'tTotal = Math.Round(SubTotal2 + IVA - RetencionIVA - RetencionISR + IEPS + OtrosImpuestos, 2)
|
||||
HdnCompraSaldo.Value = Total.ToString
|
||||
CompraSaldo = Total
|
||||
Dim AjustaUltimoConcepto As Boolean = False
|
||||
|
||||
'AGREGA IEPS COMO CONCEPTO
|
||||
If TrasladoIEPS > 0 And UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero > 0 Then
|
||||
AgregarConceptoIEPS(TrasladoIEPS, UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero)
|
||||
' TrasladoIEPS = 0
|
||||
End If
|
||||
'en otro impuesto lo esta registrando en ajuste en automatico
|
||||
If OtrosImpuestos > 0 Then
|
||||
AjustaUltimoConcepto = True
|
||||
End If
|
||||
|
||||
If RFC = "CFE370814QI0" Then ' RFC de CFE, se hace un ajuste por diferencia para sacar el DAP
|
||||
'OtrosImpuestos = Total - (SubTotal2 + IVA)
|
||||
'este importe lo vamos a meter al gasto
|
||||
'AjustaImporteUltimoConcepto(OtrosImpuestos)
|
||||
OtrosImpuestos = 1
|
||||
AjustaUltimoConcepto = True
|
||||
'SubTotal2 = SubTotal
|
||||
End If
|
||||
|
||||
Dim SubTotalReal As Decimal = 0
|
||||
SubTotalReal = Math.Round(Total + RetencionISR + RetencionIVA - IVA + Descuentos - TrasladoIEPS, 2) ' NO se incluye otros impuestos para ajustar esa cifra
|
||||
Dim DiferenciaTotales As Decimal = SubTotalReal - Math.Round(SubTotalConceptos, 2)
|
||||
|
||||
If DiferenciaTotales <> 0 Then
|
||||
'Verificamos IEPS y Otros Impuestos
|
||||
'restricccion general, que si el subtotal de los conceptos no cuadra con Total + RetISR + RetIVA - IVA <> SubTotalConeptos, ajuste al final
|
||||
If TrasladoIEPS > 0 OrElse OtrosImpuestos > 0 OrElse Math.Abs(DiferenciaTotales) < 1 Then
|
||||
|
||||
'Condicion necesaria cuando hay IVA pero no hay diferencia
|
||||
If DiferenciaTotales <> 0 Then
|
||||
|
||||
If DiferenciaTotales < 50 OrElse AjustaUltimoConcepto = True Then
|
||||
Dim IA As Decimal = Total + RetencionISR + RetencionIVA - IVA - SubTotalConceptos - TrasladoIEPS + Descuentos
|
||||
AjustaImporteUltimoConcepto(IA, True)
|
||||
|
||||
ElseIf DiferenciaTotales > 50 Then
|
||||
PnlAjusteProductos.Visible = True
|
||||
Dim Porcentaje As Double = Math.Round((SubTotalConceptos - SubTotalReal) / SubTotalConceptos * 100, 2)
|
||||
TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero
|
||||
Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente <br>")
|
||||
ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
|
||||
|
||||
'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
|
||||
For Each Row As GridViewRow In GvPS.Rows
|
||||
Row.FCLinkButton("imgE").Visible = False
|
||||
Row.FCLinkButton("imgD").Visible = False
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
TrasladoIEPS = 0 : OtrosImpuestos = 0 : SubTotal2 = SubTotal
|
||||
Else
|
||||
PnlAjusteProductos.Visible = True
|
||||
Dim Porcentaje As Double = If(SubTotalConceptos > 0, Math.Round((SubTotalConceptos - SubTotalReal) / SubTotalConceptos * 100, 2), 0)
|
||||
TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero
|
||||
Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente <br>")
|
||||
ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
|
||||
|
||||
'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
|
||||
For Each Row As GridViewRow In GvPS.Rows
|
||||
Row.FCLinkButton("imgE").Visible = False
|
||||
Row.FCLinkButton("imgD").Visible = False
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
'Si no hay diferencias pero tenemos descuento, se ofrece la opcion para ajustar el gasto
|
||||
If Descuentos > 0 Then
|
||||
|
||||
'[IPP] PARCHE: Factura TELMEX para APH 12/ENERO/2018
|
||||
If CveFactura = 286290 Then
|
||||
|
||||
Else
|
||||
PnlAjusteProductos.Visible = True
|
||||
Dim Porcentaje As Double = Math.Round((Descuentos) / (SubTotalConceptos) * 100, 4)
|
||||
TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero(4)
|
||||
Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente <br>")
|
||||
ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
|
||||
|
||||
'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
|
||||
For Each Row As GridViewRow In GvPS.Rows
|
||||
Row.FCLinkButton("imgE").Visible = False
|
||||
Row.FCLinkButton("imgD").Visible = False
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
SubTotal2 = SubTotalReal - Descuentos
|
||||
|
||||
If Descuentos > 0 Then
|
||||
TrDescuento.Visible = True
|
||||
End If
|
||||
|
||||
If Msg <> "" Then
|
||||
Alert(Msg, TipoMensaje.MsgAdvertencia)
|
||||
BtnGuardar.Enabled = False
|
||||
End If
|
||||
'AJUSTAMOS SUBTOTAL EN CASO DE SER DIFERENTE AL SUBTOTAL2 DEL XML (TOTAL - IVA)
|
||||
If SubTotal2 <> SubTotal Then
|
||||
SubTotal = SubTotalConceptos
|
||||
End If
|
||||
|
||||
TxtSubTotal.Text = SubTotal.FormatoNumero
|
||||
TxtDescuento.Text = Descuentos.FormatoNumero
|
||||
TxtSubTotal2.Text = SubTotal2.FormatoNumero
|
||||
TxtIVA.Text = IVA.FormatoNumero
|
||||
TxtTotal.Text = Total.ToString.FormatoNumero
|
||||
|
||||
HfTotalCompra.Value = Total.ToString
|
||||
CompraSaldo = Total
|
||||
|
||||
CalculaTotalPorDevengar()
|
||||
TxtDocumentoImporteFE.Text = Total.ToString
|
||||
RVDocumentoImporte.MaximumValue = Math.Round(Total, 2).ToString
|
||||
RVDocumentoImporteFE.MaximumValue = RVDocumentoImporte.MaximumValue
|
||||
RVDocumentoImporteCaja.MaximumValue = RVDocumentoImporte.MaximumValue
|
||||
TxtDocumentoImporte.Text = Total.FormatoNumero
|
||||
TxtDocumentoImporteCaja.Text = Total.FormatoNumero
|
||||
TxtRetIVA.Text = RetencionIVA.FormatoNumero
|
||||
TxtRetISR.Text = RetencionISR.FormatoNumero
|
||||
TxtIEPS.Text = IEPS.FormatoNumero
|
||||
If IEPS > 0 Then TrIEPS.Visible = True
|
||||
If RetencionIVA > 0 Then TrRetIVA.Visible = True
|
||||
If RetencionISR > 0 Then TrRetISR.Visible = True
|
||||
TxtOtrosImpuestos.Text = OtrosImpuestos.FormatoNumero
|
||||
If OtrosImpuestos > 0 Then TrOtrosImpuestos.Visible = True
|
||||
|
||||
HFDiferenciaCompra.Value = TxtTotal.Text
|
||||
'ASIGNA VALORES ORIGINALES PARA GUARDAR
|
||||
AsignaValoresOriginales(SubTotal, SubTotal2, IVA, RetencionIVA, RetencionISR, Total)
|
||||
|
||||
End If
|
||||
TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
|
||||
|
||||
Dim drMon As DataRow = GlobalDTMonedas.FiltroPrimero(String.Format(" (Abreviatura LIKE '%{0}%' OR Moneda LIKE '%{0}%' )", Moneda))
|
||||
|
||||
If drMon IsNot Nothing Then
|
||||
DdlMoneda.SelectedValue = drMon("CveMoneda").ToString
|
||||
CveMoneda = drMon("CveMoneda").ToString.ToEntero
|
||||
Else
|
||||
'sino busco en la tabla de alias
|
||||
drMon = GlobalDTMonedasAlias.FiltroPrimero(String.Format("MonedaAlias LIKE '%{0}%' ", Moneda))
|
||||
|
||||
If drMon IsNot Nothing Then
|
||||
DdlMoneda.SelectedValue = drMon("CveMoneda").ToString
|
||||
CveMoneda = drMon("CveMoneda").ToString.ToEntero
|
||||
Else
|
||||
'sino busco en la tabla de alias
|
||||
drMon = GlobalDTMonedasAlias.FiltroPrimero(String.Format("MonedaAlias LIKE '%{0}%' ", Moneda))
|
||||
|
||||
If drMon IsNot Nothing Then
|
||||
DdlMoneda.SelectedValue = drMon("CveMoneda").ToString
|
||||
CveMoneda = drMon("CveMoneda").ToString.ToEntero
|
||||
Else
|
||||
LblMoneda.Text = Moneda
|
||||
LblMoneda.ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlMoneda.SelectedValue.ToEntero > 1 Then
|
||||
If TipoCambio <= 10 Then
|
||||
TipoCambio = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
||||
End If
|
||||
|
||||
TxtFecha.Attributes.Remove("onblur")
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
TxtFecha.Attributes.Add("onblur", "CambiaFecha();CambiaFechaTC();")
|
||||
Else
|
||||
TxtFecha.Attributes.Add("onblur", "CambiaFechaTC();")
|
||||
End If
|
||||
End If
|
||||
|
||||
If TipoCambio > 0 And DdlMoneda.SelectedValue.ToEntero > 1 Then LblTC.Text = String.Format("TC: {0}", TipoCambio.ToString("N4"))
|
||||
|
||||
'DF - 10-04-17
|
||||
If UsuarioActual.TienePermisoProceso(187) Then
|
||||
TxtSerie.Enabled = True
|
||||
End If
|
||||
|
||||
If LblMetodoPago.Text = "" AndAlso TipoComprobante <> "T" Then
|
||||
Alert("El xml no contiene la etiqueta 'método de pago', favor de verificar la emisión con el proveedor.", TipoMensaje.MsgAdvertencia)
|
||||
BtnGuardar.Visible = False
|
||||
LblMoneda.Text = Moneda
|
||||
LblMoneda.ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
|
||||
If DdlMoneda.SelectedValue.ToEntero > 1 Then
|
||||
If TipoCambio <= 10 Then
|
||||
TipoCambio = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
|
||||
End If
|
||||
|
||||
TxtFecha.Attributes.Remove("onblur")
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
TxtFecha.Attributes.Add("onblur", "CambiaFecha();CambiaFechaTC();")
|
||||
Else
|
||||
TxtFecha.Attributes.Add("onblur", "CambiaFechaTC();")
|
||||
End If
|
||||
End If
|
||||
|
||||
If TipoCambio > 0 And DdlMoneda.SelectedValue.ToEntero > 1 Then LblTC.Text = String.Format("TC: {0}", TipoCambio.ToString("N4"))
|
||||
|
||||
'DF - 10-04-17
|
||||
If UsuarioActual.TienePermisoProceso(187) Then
|
||||
TxtSerie.Enabled = True
|
||||
End If
|
||||
|
||||
If LblMetodoPago.Text = "" AndAlso TipoComprobante <> "T" Then
|
||||
Alert("El xml no contiene la etiqueta 'método de pago', favor de verificar la emisión con el proveedor.", TipoMensaje.MsgAdvertencia)
|
||||
BtnGuardar.Visible = False
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Alert("No se Encontró la Factura", TipoMensaje.MsgAdvertencia)
|
||||
BtnGuardar.Visible = False
|
||||
End If
|
||||
@@ -3549,12 +3549,23 @@ Partial Class Compras_Compras
|
||||
ViewState("CveProveedor") = ObjProveedor.CveProveedor
|
||||
HdnCveProveedor.Value = ObjProveedor.CveProveedor.ToString
|
||||
TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
|
||||
RFCProveedor = ObjProveedor.RFC
|
||||
'comentado RMF.2024.05.21. en anticipos parciales, está bloquenado
|
||||
'If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 Then
|
||||
|
||||
CveRegimenFiscalProveedor = ObjProveedor.CveRegimenFiscal
|
||||
If CveFactura > 0 Then
|
||||
' Dim ImporteAnticipoComision As Decimal = 0
|
||||
' If ArrAnticipos.Count > 0 Then
|
||||
' For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
|
||||
' ImporteAnticipoComision += Ant.ImporteComision
|
||||
' Next
|
||||
' End If
|
||||
|
||||
If RetIVAOriginal > 0 Then
|
||||
' If (LblSaldoFactura.Text.ToDecimal - ImporteAnticipoComision) > 0 Then
|
||||
' Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If RetIVAOriginal > 0 Then
|
||||
Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal
|
||||
|
||||
If (CalRetIVAPor).RoundSQL(5) = 0.10666 OrElse (CalRetIVAPor).RoundSQL(5) = 0.05333 Then
|
||||
@@ -4193,24 +4204,9 @@ Partial Class Compras_Compras
|
||||
|
||||
'------------------ INICIA VALIDACIONES ------------------
|
||||
|
||||
|
||||
|
||||
|
||||
If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 Then
|
||||
|
||||
Dim ImporteAnticipoComision As Decimal = 0
|
||||
If ArrAnticipos.Count > 0 Then
|
||||
For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
|
||||
ImporteAnticipoComision += Ant.ImporteComision
|
||||
Next
|
||||
End If
|
||||
|
||||
If (LblSaldoFactura.Text.ToDecimal - ImporteAnticipoComision) > 0 Then
|
||||
Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 AndAlso LblSaldoFactura.Text.ToDecimal > 0 Then
|
||||
Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim CveSubProyectoPrincipal As Integer = AsignarSubProyectoPrincipal()
|
||||
@@ -13133,11 +13129,15 @@ Partial Class Compras_Compras
|
||||
Dim objcompras As New ClsCompras()
|
||||
If objcompras.GetCompraParaDevolucion(CveProveedor, UsuarioActual.CveEmpresa, SubTotal) Then
|
||||
DDLDevolucion.Items.Clear()
|
||||
DDLDevolucion.DataSource = objcompras.DtResultados
|
||||
DDLDevolucion.DataBind()
|
||||
Dim dtt As DataTable = objcompras.DtResultados
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then 'solo los últimos 3 meses
|
||||
dtt = dtt.FiltraParametros($"Fecha >= #{NowADS.AddMonths(-3).ToString("yyyy/MM/dd")}#")
|
||||
End If
|
||||
DDLDevolucion.DataSource = dtt
|
||||
DDLDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
objcompras.Dispose()
|
||||
DDLDevolucion.DataBind()
|
||||
UPDevolucion.Update()
|
||||
|
||||
End Sub
|
||||
@@ -13150,9 +13150,9 @@ Partial Class Compras_Compras
|
||||
Dim objcompras As New ClsCompras()
|
||||
If objcompras.GetCompraDetalleAlmacen(UsuarioActual.CveEmpresa, DDLDevolucion.SelectedValue.ToEntero) Then
|
||||
GVDevolucion.DataSource = objcompras.DtResultados
|
||||
GVDevolucion.DataBind()
|
||||
End If
|
||||
objcompras.Dispose()
|
||||
GVDevolucion.DataBind()
|
||||
Dim CveAlmacen As Integer = -1
|
||||
For Each GvRow As GridViewRow In GVDevolucion.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
@@ -20715,8 +20715,6 @@ Partial Class Compras_Compras
|
||||
Return True
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
|
||||
|
||||
Dim ObjCon As New ClsContratos
|
||||
@@ -20724,7 +20722,7 @@ Partial Class Compras_Compras
|
||||
Dim Autorizado As Double = 0
|
||||
Dim Ejercido As Double = 0
|
||||
|
||||
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, 1) Then
|
||||
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, TxtFecha.Text.ToDate.FirstDayOfMonth, TxtFecha.Text.ToDate.LastDayOfMonth, 1) Then
|
||||
|
||||
Dim FechaCompra As Date = TxtFecha.Text.ToDate
|
||||
|
||||
@@ -20733,27 +20731,8 @@ Partial Class Compras_Compras
|
||||
FechaCompra <= row.Field(Of Date)("FechaFin")
|
||||
Select row
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'Dim dataTable As New DataTable
|
||||
'Dim rowFilter As String = ""
|
||||
'Dim orderby As String = ""
|
||||
'Dim groupByColumns As String()() = {New String() {"SubProyecto", "CveSubProyecto", "Clasificacion", "CveClasificacion", "TipoGasto", "CveTipoGasto"}}
|
||||
'Dim sumColumns As String() = {"Total"}
|
||||
|
||||
|
||||
'Dim resultDataTable As DataTable = GroupByDT(TmpDT, rowFilter, orderby, groupByColumns, sumColumns)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If resultadosFiltrados.Count > 0 Then
|
||||
|
||||
|
||||
|
||||
''.TotalSum = Group.Sum(Function(r) r.Field(Of Decimal)("Total"))
|
||||
If Opcion = 1 Then
|
||||
|
||||
@@ -20786,29 +20765,8 @@ Partial Class Compras_Compras
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
|
||||
'Dim EnumAgrupado = (From row In TmpDT.AsEnumerable()
|
||||
' Group row By
|
||||
' SubProyecto = row.Field(Of String)("SubProyecto"),
|
||||
' CveSubProyecto = row.Field(Of Integer)("CveSubProyecto"),
|
||||
' Clasificacion = row.Field(Of String)("Clasificacion"),
|
||||
' CveClasificacion = row.Field(Of Integer)("CveClasificacion"),
|
||||
' TipoGasto = row.Field(Of String)("TipoGasto"),
|
||||
' CveTipoGasto = row.Field(Of Integer)("CveTipoGasto")
|
||||
' Into Group
|
||||
' Select New With {
|
||||
' .SubProyecto = SubProyecto,
|
||||
' .CveSubProyecto = CveSubProyecto,
|
||||
' .Clasificacion = Clasificacion,
|
||||
' .CveClasificacion = CveClasificacion,
|
||||
' .CveTipoGasto = CveTipoGasto,
|
||||
' .TipoGasto = TipoGasto,
|
||||
' .TotalSum = Group.Sum(Function(r) If(IsDBNull(r("Total")), 0D, Convert.ToDecimal(r("Total"))))
|
||||
' }).ToList()
|
||||
|
||||
Dim EnumAgrupado = (
|
||||
From row In TmpDT.AsEnumerable()
|
||||
Group row By
|
||||
@@ -20830,22 +20788,15 @@ Partial Class Compras_Compras
|
||||
}
|
||||
).ToList()
|
||||
|
||||
|
||||
For Each item In EnumAgrupado
|
||||
|
||||
|
||||
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = item.CveSubProyecto)
|
||||
|
||||
If tieneRegistrosConCveSubProyecto Then
|
||||
'Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
||||
' Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||
' row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
|
||||
' Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
|
||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados.AsEnumerable()
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||
If(row.IsNull("CveClasificacion"),
|
||||
0,
|
||||
If(row.IsNull("CveClasificacion"), 0,
|
||||
row.Field(Of Integer?)("CveClasificacion").GetValueOrDefault()) = item.CveClasificacion
|
||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
|
||||
@@ -20872,29 +20823,18 @@ Partial Class Compras_Compras
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Else
|
||||
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
End If
|
||||
|
||||
ObjCon.Dispose()
|
||||
|
||||
|
||||
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
|
||||
Return respuesta
|
||||
|
||||
End Function
|
||||
|
||||
@@ -310,8 +310,8 @@ Partial Class Contratos_RepPresupuestos
|
||||
If UsaComprometido Then
|
||||
Ejercido = DrPresupuesto("Comprometido").ToString.ToDecimal
|
||||
PorEjercer = Autorizado - Ejercido
|
||||
EjercidoPorcentaje = Ejercido / Autorizado * 100
|
||||
PorEjercerPorcentaje = PorEjercer / Autorizado * 100
|
||||
EjercidoPorcentaje = If(Autorizado > 0, Ejercido / Autorizado * 100, 0)
|
||||
PorEjercerPorcentaje = If(Autorizado > 0, PorEjercer / Autorizado * 100, 0)
|
||||
thComprometido.Visible = True
|
||||
GvDatos.Columns(2).Visible = True
|
||||
End If
|
||||
@@ -366,7 +366,7 @@ Partial Class Contratos_RepPresupuestos
|
||||
e.Row.Cells(1).Text = "-"
|
||||
End If
|
||||
If e.Row.DBCampo("Comprometido").ToDecimal = 0 Then
|
||||
e.Row.Cells(1).Text = "-"
|
||||
e.Row.Cells(2).Text = "-"
|
||||
End If
|
||||
If e.Row.DBCampo("Ejercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(3).Text = "-"
|
||||
|
||||
@@ -9081,59 +9081,50 @@ Partial Class OC_OC
|
||||
|
||||
Dim respuesta As Boolean = False
|
||||
|
||||
'If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
|
||||
|
||||
Dim ObjCon As New ClsContratos
|
||||
Dim CvePresupuesto As Integer = 0
|
||||
Dim Autorizado As Double = 0
|
||||
Dim Ejercido As Double = 0
|
||||
|
||||
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, 2) Then
|
||||
|
||||
Dim FechaCompra As Date = TxtFecha.Text.ToDate
|
||||
Dim Autorizado As Decimal = 0
|
||||
Dim Ejercido As Decimal = 0
|
||||
Dim FechaCompra As Date = TxtFecha.Text.ToDate
|
||||
|
||||
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, FechaCompra.FirstDayOfMonth, FechaCompra.LastDayOfMonth, 2) Then
|
||||
Dim ColumnaSaldo As String = "Saldo"
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then ColumnaSaldo = "SaldoComprometido"
|
||||
Dim resultadosFiltrados = From row In ObjCon.DtResultados.AsEnumerable()
|
||||
Where FechaCompra >= row.Field(Of Date)("FechaInicio") AndAlso
|
||||
FechaCompra <= row.Field(Of Date)("FechaFin")
|
||||
Select row
|
||||
|
||||
|
||||
If resultadosFiltrados.Count > 0 Then
|
||||
If ObjCon.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
If Opcion = 1 Then
|
||||
|
||||
|
||||
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = ValCveSubProyecto)
|
||||
|
||||
If tieneRegistrosConCveSubProyecto Then
|
||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = ValCveSubProyecto AndAlso
|
||||
row.Field(Of Integer)("CveClasificacion") = ValCveClasificacion
|
||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
Select row.Field(Of Decimal)(ColumnaSaldo)).Sum()
|
||||
If saldoTotal > 0 Then
|
||||
|
||||
Dim TotalAcumuladoTabla As Decimal = (DtDetalle.SUM("Total", $" CveSubProyecto = {ValCveSubProyecto} AND CveClasificacion = {ValCveClasificacion} "))
|
||||
Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte
|
||||
|
||||
If (Diferencia) < 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>. Se excede por <b>{ Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible en: <br/> Subproyecto:<b> {ValSubProyecto}</b> Clasificación:<b> {ValClasificacion}</b>. Se excede por <b>{ Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>.", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible en: <br/> Subproyecto:<b> {ValSubProyecto}</b> Clasificación:<b> {ValClasificacion}</b>.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
End If
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
Dim EnumAgrupado = (From row In DtDetalle.AsEnumerable()
|
||||
Group row By
|
||||
SubProyecto = row.Field(Of String)("SubProyecto"),
|
||||
@@ -9157,21 +9148,20 @@ Partial Class OC_OC
|
||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||
row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
|
||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
Select row.Field(Of Decimal)(ColumnaSaldo)).Sum()
|
||||
If saldoTotal > 0 Then
|
||||
|
||||
Dim Diferencia As Decimal = saldoTotal - item.TotalSum
|
||||
|
||||
If (Diferencia) < 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible en: <br/> Subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>.", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible en: <br/> Subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
End If
|
||||
@@ -9179,7 +9169,6 @@ Partial Class OC_OC
|
||||
respuesta = True
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
@@ -9190,16 +9179,10 @@ Partial Class OC_OC
|
||||
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
End If
|
||||
|
||||
ObjCon.Dispose()
|
||||
|
||||
|
||||
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
|
||||
Return respuesta
|
||||
|
||||
End Function
|
||||
|
||||
@@ -302,21 +302,27 @@ Partial Class Portal_PortalProveedor
|
||||
#Region "C A R G A - D A T O S"
|
||||
|
||||
Protected Sub CargaDatos()
|
||||
GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimero($"CveProveedor = {CveProveedor}")
|
||||
Dim ObjProveedor As New ClsCompProveedores()
|
||||
If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", 1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjProveedor.DtResultados.Rows.Count > 0 Then
|
||||
Dim drp As DataRow = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimero($"CveProveedor = {CveProveedor}")
|
||||
|
||||
'CxP
|
||||
LtlProveedor.Text = ObjProveedor.RazonSocial
|
||||
lblLimiteCredito.Text = ObjProveedor.LimiteCredito.ToString
|
||||
lblPlazoCobranza.Text = ObjProveedor.PlazoPago.ToString
|
||||
|
||||
Else
|
||||
Alert("Ocurrió un error al cargar los datos.", TipoMensaje.MsgError)
|
||||
End If
|
||||
If drp IsNot Nothing Then
|
||||
LtlProveedor.Text = drp("RazonSocial").ToString
|
||||
lblLimiteCredito.Text = drp("LimiteCredito").ToString.ToDecimal.FormatoNumero
|
||||
lblPlazoCobranza.Text = drp("PlazoPago").ToString
|
||||
End If
|
||||
ObjProveedor.Dispose()
|
||||
'Dim ObjProveedor As New ClsCompProveedores()
|
||||
'If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", 1, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjProveedor.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
' 'CxP
|
||||
' LtlProveedor.Text = ObjProveedor.RazonSocial
|
||||
' lblLimiteCredito.Text = ObjProveedor.LimiteCredito.ToString
|
||||
' lblPlazoCobranza.Text = ObjProveedor.PlazoPago.ToString
|
||||
|
||||
' Else
|
||||
' Alert("Ocurrió un error al cargar los datos.", TipoMensaje.MsgError)
|
||||
' End If
|
||||
'End If
|
||||
'ObjProveedor.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -357,9 +363,9 @@ Partial Class Portal_PortalProveedor
|
||||
|
||||
If ObjMovtos.GetCxPProveedor(CveProveedor, "-1", "-1", -1, -1, -1, -1, -1, -1, DdlProveedorSucursalCxCSucursal.SelectedValue.ToEntero, -1) Then
|
||||
|
||||
GvCxP.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "Moneda,OrdenVencimiento, FechaVencimiento")
|
||||
|
||||
'solo tomo los 10 ultimos mas el totalizador general
|
||||
GvCxP.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "Moneda,OrdenVencimiento, FechaVencimiento")
|
||||
|
||||
'solo tomo los 10 ultimos mas el totalizador general
|
||||
Dim dt As DataTable = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'")
|
||||
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
|
||||
@@ -27,7 +27,7 @@ Partial Class Sistemas_PopUpCambiaUsuarioEmpresa
|
||||
|
||||
'Dim DtEmp As DataTable = GlobalDTEmpresas.Copy
|
||||
Dim NombreEmp As String = UsuarioActual.Empresa.Empresa
|
||||
'''condición para ocultar los nombres de las empresas y ponerles "mi empresa de venta (xxx)"
|
||||
''condición para ocultar los nombres de las empresas y ponerles "mi empresa de venta (xxx)"
|
||||
''If UsuarioActual.CveUsuario = 100 Then
|
||||
|
||||
'' Dim customerRow() As Data.DataRow
|
||||
@@ -92,8 +92,25 @@ Partial Class Sistemas_PopUpCambiaUsuarioEmpresa
|
||||
tUsuario = gvr.DataKey("Usuario").ToString
|
||||
tContraseña = gvr.DataKey("Contraseña").ToString
|
||||
tCveEmpresa = gvr.DataKey("CveEmpresa").ToString.ToEntero
|
||||
Dim tGrupoEmpresa As String = ""
|
||||
Dim NombreCadena As String = "Conexion"
|
||||
|
||||
Dim ObjUsuario As New ClsSisUsuarios
|
||||
If Request.Url.Host.ToUpper().Contains("EMD".ToUpper()) Then tGrupoEmpresa = "EMD"
|
||||
If Request.Url.Host.ToUpper().Contains("BDH".ToUpper()) Then tGrupoEmpresa = "BDH"
|
||||
If Request.Url.Host.ToUpper().Contains("ECONOLLANTAS".ToUpper()) Then tGrupoEmpresa = "ECONOLLANTAS" : NombreCadena = "Conexion"
|
||||
If Request.Url.Host.ToUpper().Contains("JAM".ToUpper()) Then tGrupoEmpresa = "JAM"
|
||||
If Request.Url.Host.ToUpper().Contains("CITRUS".ToUpper()) Then tGrupoEmpresa = "CITRUS"
|
||||
If Request.Url.Host.ToUpper().Contains("KINO".ToUpper()) Then tGrupoEmpresa = "KINO"
|
||||
If Request.Url.Host.ToUpper().Contains("VSH".ToUpper()) Then tGrupoEmpresa = "VSH"
|
||||
If Request.Url.Host.ToUpper().Contains("AJAM".ToUpper()) Then tGrupoEmpresa = "AJAM"
|
||||
If Request.Url.Host.ToUpper().Contains("ALATEL".ToUpper()) Then tGrupoEmpresa = "ALATEL"
|
||||
If Request.Url.Host.ToUpper().Contains("SERVEC".ToUpper()) Then tGrupoEmpresa = "SERVEC"
|
||||
If Request.Url.Host.ToUpper().Contains("SMS".ToUpper()) Then tGrupoEmpresa = "SMS"
|
||||
If Request.Url.Host.ToUpper().Contains("VYA".ToUpper()) Then tGrupoEmpresa = "VYA"
|
||||
If Request.Url.Host.ToUpper().Contains("GRUPODIAZ".ToUpper()) Then tGrupoEmpresa = "GRUPODIAZ"
|
||||
If Request.Url.Host.ToUpper().Contains("FERRETERA".ToUpper()) Then tGrupoEmpresa = "FERRETERA"
|
||||
|
||||
Dim ObjUsuario As New ClsSisUsuarios(NombreCadena:=NombreCadena)
|
||||
Dim Usuario As Usuario
|
||||
'Dim UsuarioAsignaciones As Usuario
|
||||
|
||||
|
||||
@@ -59,10 +59,26 @@ Partial Class PopUpSeleccionarEmpresa
|
||||
|
||||
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
|
||||
|
||||
If gvr IsNot Nothing Then
|
||||
|
||||
Dim ObjUsuario As New ClsSisUsuarios
|
||||
Dim Usuario As Usuario = Nothing
|
||||
If gvr IsNot Nothing Then
|
||||
Dim tGrupoEmpresa As String = ""
|
||||
Dim NombreCadena As String = "Conexion"
|
||||
Dim Usuario As Usuario = Nothing
|
||||
If Request.Url.Host.ToUpper().Contains("EMD".ToUpper()) Then tGrupoEmpresa = "EMD"
|
||||
If Request.Url.Host.ToUpper().Contains("BDH".ToUpper()) Then tGrupoEmpresa = "BDH"
|
||||
If Request.Url.Host.ToUpper().Contains("ECONOLLANTAS".ToUpper()) Then tGrupoEmpresa = "ECONOLLANTAS" : NombreCadena = "Conexion"
|
||||
If Request.Url.Host.ToUpper().Contains("JAM".ToUpper()) Then tGrupoEmpresa = "JAM"
|
||||
If Request.Url.Host.ToUpper().Contains("CITRUS".ToUpper()) Then tGrupoEmpresa = "CITRUS"
|
||||
If Request.Url.Host.ToUpper().Contains("KINO".ToUpper()) Then tGrupoEmpresa = "KINO"
|
||||
If Request.Url.Host.ToUpper().Contains("VSH".ToUpper()) Then tGrupoEmpresa = "VSH"
|
||||
If Request.Url.Host.ToUpper().Contains("AJAM".ToUpper()) Then tGrupoEmpresa = "AJAM"
|
||||
If Request.Url.Host.ToUpper().Contains("ALATEL".ToUpper()) Then tGrupoEmpresa = "ALATEL"
|
||||
If Request.Url.Host.ToUpper().Contains("SERVEC".ToUpper()) Then tGrupoEmpresa = "SERVEC"
|
||||
If Request.Url.Host.ToUpper().Contains("SMS".ToUpper()) Then tGrupoEmpresa = "SMS"
|
||||
If Request.Url.Host.ToUpper().Contains("VYA".ToUpper()) Then tGrupoEmpresa = "VYA"
|
||||
If Request.Url.Host.ToUpper().Contains("GRUPODIAZ".ToUpper()) Then tGrupoEmpresa = "GRUPODIAZ"
|
||||
If Request.Url.Host.ToUpper().Contains("FERRETERA".ToUpper()) Then tGrupoEmpresa = "FERRETERA"
|
||||
|
||||
Dim ObjUsuario As New ClsSisUsuarios(NombreCadena:=NombreCadena)
|
||||
Usuario = ObjUsuario.ValidaUsuario(gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"), CveEmpresa:=gvr.DataKey("CveEmpresa").ToEntero)
|
||||
ObjUsuario.Dispose()
|
||||
|
||||
@@ -138,9 +154,25 @@ Partial Class PopUpSeleccionarEmpresa
|
||||
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
|
||||
|
||||
If gvr IsNot Nothing Then
|
||||
|
||||
Dim ObjUsuario As New ClsSisUsuarios
|
||||
Dim Usuario As Usuario = Nothing
|
||||
Dim tGrupoEmpresa As String = ""
|
||||
Dim NombreCadena As String = "Conexion"
|
||||
Dim Usuario As Usuario = Nothing
|
||||
If Request.Url.Host.ToUpper().Contains("EMD".ToUpper()) Then tGrupoEmpresa = "EMD"
|
||||
If Request.Url.Host.ToUpper().Contains("BDH".ToUpper()) Then tGrupoEmpresa = "BDH"
|
||||
If Request.Url.Host.ToUpper().Contains("ECONOLLANTAS".ToUpper()) Then tGrupoEmpresa = "ECONOLLANTAS" : NombreCadena = "Conexion"
|
||||
If Request.Url.Host.ToUpper().Contains("JAM".ToUpper()) Then tGrupoEmpresa = "JAM"
|
||||
If Request.Url.Host.ToUpper().Contains("CITRUS".ToUpper()) Then tGrupoEmpresa = "CITRUS"
|
||||
If Request.Url.Host.ToUpper().Contains("KINO".ToUpper()) Then tGrupoEmpresa = "KINO"
|
||||
If Request.Url.Host.ToUpper().Contains("VSH".ToUpper()) Then tGrupoEmpresa = "VSH"
|
||||
If Request.Url.Host.ToUpper().Contains("AJAM".ToUpper()) Then tGrupoEmpresa = "AJAM"
|
||||
If Request.Url.Host.ToUpper().Contains("ALATEL".ToUpper()) Then tGrupoEmpresa = "ALATEL"
|
||||
If Request.Url.Host.ToUpper().Contains("SERVEC".ToUpper()) Then tGrupoEmpresa = "SERVEC"
|
||||
If Request.Url.Host.ToUpper().Contains("SMS".ToUpper()) Then tGrupoEmpresa = "SMS"
|
||||
If Request.Url.Host.ToUpper().Contains("VYA".ToUpper()) Then tGrupoEmpresa = "VYA"
|
||||
If Request.Url.Host.ToUpper().Contains("GRUPODIAZ".ToUpper()) Then tGrupoEmpresa = "GRUPODIAZ"
|
||||
If Request.Url.Host.ToUpper().Contains("FERRETERA".ToUpper()) Then tGrupoEmpresa = "FERRETERA"
|
||||
|
||||
Dim ObjUsuario As New ClsSisUsuarios(NombreCadena:=NombreCadena)
|
||||
Usuario = ObjUsuario.ValidaUsuarioPortalProveedor(gvr.DataKey("CveProveedor").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
|
||||
|
||||
ObjUsuario.Dispose()
|
||||
|
||||
@@ -1384,8 +1384,10 @@ Partial Class Sistemas_UsuarioDetalle
|
||||
GlobalDTAlmacenUsuarios(-1, tCveEmpresa) = Nothing
|
||||
GlobalDTUsuarioResponsable(tCveEmpresa) = Nothing
|
||||
GlobalDTUsuarios(CveEmpresa:=tCveEmpresa) = Nothing
|
||||
GlobalDTUsuarios(CveEmpresa:=-1) = Nothing
|
||||
GlobalDTUsuarios(CveEmpresa:=tCveEmpresa) = Nothing
|
||||
|
||||
'si hay diferencia en la empresa asignada y la asociada.
|
||||
If tCveEmpresa <> DdlEmpresa.SelectedValue.ToEntero Then GlobalDTUsuarios(CveEmpresa:=DdlEmpresa.SelectedValue.ToEntero) = Nothing
|
||||
|
||||
'If ObjUsuarios.GetUsuariosEmpresas(-1, UsuarioActual.CveEmpresa) Then
|
||||
' Application("GlobalDTUsuarios") = ObjUsuarios.DtResultados
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
<div class="row">
|
||||
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
|
||||
<div runat="server" id="DivSubProyecto" class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
|
||||
<asp:ListBox ID="DdlSubProyectos" CssClass="select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Style="width: 100%" data-text="Todos" SelectionMode="Multiple"></asp:ListBox>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Inicio:
|
||||
|
||||
@@ -54,7 +54,7 @@ Partial Class Ventas_RepPS
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto)
|
||||
CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, LblSubProyecto)
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
|
||||
@@ -75,14 +75,15 @@ Partial Class Ventas_RepPS
|
||||
DivMarca.Visible = True
|
||||
LblMarca.Visible = True
|
||||
LblLinea.Visible = True
|
||||
DivLinea.Visible = True
|
||||
|
||||
Using ObjMarcas As New ClsProductosServicios
|
||||
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||
DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
|
||||
DdlMarcaPSDes.DataBind()
|
||||
End If
|
||||
End Using
|
||||
DivLinea.Visible = True
|
||||
|
||||
DdlMarcaPSDes.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
||||
'Using ObjMarcas As New ClsProductosServicios
|
||||
' If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||
' DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
|
||||
' DdlMarcaPSDes.DataBind()
|
||||
' End If
|
||||
'End Using
|
||||
End If
|
||||
|
||||
DdlLinea.DataSource = GlobalDTClasificacionesDetalle(UsuarioActual.CveEmpresa)
|
||||
@@ -95,7 +96,8 @@ Partial Class Ventas_RepPS
|
||||
Dim Clasificacion As String = If(DdlClasificacion.GetSelectedValuesM = "", "-1", DdlClasificacion.GetSelectedValuesM)
|
||||
Dim Linea As String = If(DdlLinea.GetSelectedValuesM = "", "-1", DdlLinea.GetSelectedValuesM)
|
||||
Dim Marca As String = If(DdlMarcaPSDes.GetSelectedValuesM = "", "-1", DdlMarcaPSDes.GetSelectedValuesM)
|
||||
Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero()
|
||||
'Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero()
|
||||
Dim CveSubProyectos As String = If(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM)
|
||||
Dim Grupo As Integer = DdlGrupo.SelectedValue.ToEntero()
|
||||
Dim CvePS As Integer = DdlPS.SelectedValue.ToEntero()
|
||||
Dim CveMoneda As Integer = -1
|
||||
@@ -106,7 +108,7 @@ Partial Class Ventas_RepPS
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
|
||||
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetRepPSEcono(CveSubProyecto, CvePS, FechaI, FechaF, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=Grupo, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico, Clasificacion:=Clasificacion, Linea:=Linea, Marca:=Marca, orden:=DdlOrden.SelectedValue.ToEntero()) Then
|
||||
If ObjVentas.GetRepPSEcono(CveSubProyectos, CvePS, FechaI, FechaF, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=Grupo, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico, Clasificacion:=Clasificacion, Linea:=Linea, Marca:=Marca, orden:=DdlOrden.SelectedValue.ToEntero()) Then
|
||||
DtReporte = ObjVentas.DtResultados.Copy()
|
||||
GvDatos.DataSource = DtReporte
|
||||
Else
|
||||
@@ -167,7 +169,7 @@ Partial Class Ventas_RepPS
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
|
||||
If DtReporte IsNot Nothing AndAlso DtReporte.Rows.Count > 0 Then
|
||||
Dim SbParametros As New StringBuilder
|
||||
SbParametros.AppendFormat("Sucursal:{0}", DdlSubProyecto.SelectedItem.Text)
|
||||
SbParametros.AppendFormat("Sucursal:{0}", DdlSubProyectos.GetSelectedText)
|
||||
SbParametros.AppendFormat(", Orden:{0}", DdlGrupo.SelectedItem.Text)
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
|
||||
|
||||
@@ -5576,7 +5576,6 @@ Partial Class Ventas
|
||||
HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString()
|
||||
End If
|
||||
|
||||
|
||||
TxtOrdenCompra.Text = DbRowVenta("OrdenCompra").ToString()
|
||||
TxtOrdenCompra.Enabled = False
|
||||
|
||||
@@ -12179,6 +12178,11 @@ Partial Class Ventas
|
||||
ObjFactura.Alfa1 = TxtAlfa1.Text.Trim
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
|
||||
ObjFactura.Medico = DdlMedico.SelectedItem.Text
|
||||
ObjFactura.Procedimiento = DdlProcedimiento.SelectedItem.Text
|
||||
End If
|
||||
|
||||
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
|
||||
If (ObjFactura.CveMoneda = 2 AndAlso ObjFactura.ConvertirPesos = True AndAlso ObjFactura.TipodeComprobante = "Ingresos" AndAlso RemisionesLista.Count > 0) Then
|
||||
Dim TotalCalculableImpuestos, TotalCalculableImpuestosIVA As Decimal
|
||||
@@ -25673,7 +25677,7 @@ Partial Class Ventas
|
||||
Dim SegundosRespuesta As Double = SWatch.ElapsedMilliseconds / 1000
|
||||
SegundosRespuesta = SegundosRespuesta.ToEntero
|
||||
|
||||
If SegundosRespuesta >= 5 Then
|
||||
If SegundosRespuesta >= 5 AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs") Then
|
||||
Alert($"Los servicios de cancelación del SAT presentan lentitud en la respuesta [{ SegundosRespuesta } s].", TipoMensaje.ToastAdventencia, "")
|
||||
End If
|
||||
|
||||
@@ -32535,11 +32539,11 @@ Partial Class Ventas
|
||||
|
||||
For Each Dr As DataRow In dtSeleccionadas.Rows
|
||||
|
||||
If Dr("Medico").ToString().Trim().Length > 0 Then
|
||||
If Dr("Medico").ToString.Trim.Length > 0 Then
|
||||
MensajeRemisionesMedicas.Append($"Dr. {Dr("Medico").ToString}{vbCrLf}")
|
||||
EsRemisionMedica = True
|
||||
End If
|
||||
If Dr("Medico").ToString().Trim().Length > 0 Then
|
||||
If Dr("Procedimiento").ToString.Trim.Length > 0 Then
|
||||
MensajeRemisionesMedicas.Append($"Procedimiento {Dr("Procedimiento")}{vbCrLf}")
|
||||
EsRemisionMedica = True
|
||||
End If
|
||||
@@ -32562,7 +32566,6 @@ Partial Class Ventas
|
||||
TxtObsFact.Text = If(MensajeRemisiones.ToString().Length > 0, MensajeRemisiones.ToString().Substring(0, MensajeRemisiones.ToString().Length - 2), "")
|
||||
End If
|
||||
|
||||
|
||||
TxtOrdenCompra.Text = If(ObsOC.ToString().Length > 0, ObsOC.ToString().Substring(0, ObsOC.ToString().Length - 2), "")
|
||||
TxtPedidoContrato.Text = If(ObsPedido.ToString().Length > 0, ObsPedido.ToString().Substring(0, ObsPedido.ToString().Length - 2), "")
|
||||
TxtObsAlmacen.Text = If(ObsInv.ToString().Length > 0, ObsInv.ToString().Substring(0, ObsInv.ToString().Length - 2), "")
|
||||
|
||||
Reference in New Issue
Block a user