diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index d7c9a2928..911f89a07 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -4198,7 +4198,7 @@ Public Class ClsContabilidad
Return Retorno
End Function
- Public Function GetAnexoCatalagoCC(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, Divisor As Integer, Periodo As Integer) As Boolean
+ Public Function GetAnexoCatalagoCC(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, Divisor As Integer, Periodo As Integer, CveUsuario As Integer ) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_AnexoCatalogoCCGet")
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 4313f8638..83ede0055 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -761,7 +761,7 @@ Partial Class Bancos_IE
End If
InicializaSolicitudAnticipoOC()
- If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSSINFACT") AndAlso UsuarioActual.CveEmpresa = 119 Then
+ If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSSINFACT") AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then
RBL.Items.Add(New ListItem("Acreedores Diversos", "AC"))
End If
@@ -2677,8 +2677,8 @@ Partial Class Bancos_IE
Dim FolioFijo As Integer = 0
Dim tCveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero
- Dim tImporteMonedaExtranjera As Decimal = 0
- If tCveMoneda <> 1 Then tImporteMonedaExtranjera = TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal
+ Dim tImporteMonedaExtranjera As Decimal = TxtImporte.Text.ToDecimal
+ If tCveMoneda <> 1 Then tImporteMonedaExtranjera = (TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal).RoundSQL
Dim PagueseA = ""
If HdnCveCliente.Value.ToEntero > 0 Then
@@ -2786,7 +2786,7 @@ Partial Class Bancos_IE
Else
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta) Then
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE:=If(CveIEOtro < 0, CveIE, CveIEOtro), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE:=If(CveIEOtro < 0, CveIE, CveIEOtro), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=tImporteMonedaExtranjera, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) Then
MsgError = "no se pudo insertar el detalle de la póliza 2"
End If
Else
@@ -3583,7 +3583,10 @@ Partial Class Bancos_IE
importeMovimiento = TxtImporte.Text.ToDecimal
importeMX = importeMovimiento
-
+ If tCveMoneda > 1 Then
+ importeMovimiento = TxtImporte.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal
+ importeMX = importeMovimiento
+ End If
Case 46
@@ -3625,7 +3628,7 @@ Partial Class Bancos_IE
'MOVIMIENTOS EGRESOS
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=tImporteMonedaExtranjera, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then
If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
MsgError = "Detalle"
End If
diff --git a/Compras/eFacturas.aspx b/Compras/eFacturas.aspx
index f6675b947..74f71680a 100644
--- a/Compras/eFacturas.aspx
+++ b/Compras/eFacturas.aspx
@@ -66,6 +66,9 @@
Bitácora Facturas
+
+ Vinculación Masiva Complementos
+
@@ -374,7 +377,7 @@
diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb
index f59eed405..64b14396c 100644
--- a/Compras/eFacturas.aspx.vb
+++ b/Compras/eFacturas.aspx.vb
@@ -2770,23 +2770,7 @@ Partial Class Compras_eFacturas
Next
Next
- 'ImportePago
- 'For Each node As XmlNode In nodePago
- ' Dim Nrow As DataRow = DTDocumentosRelacionados.NewRow
-
- ' Nrow("Serie") = ValorXML(node, "Serie")
- ' Nrow("Folio") = ValorXML(node, "Folio").ToEntero
- ' Nrow("SerieFolio") = ValorXML(node, "Serie") & "-" & ValorXML(node, "Folio").ToEntero
- ' Nrow("IdDocumento") = ValorXML(node, "IdDocumento")
- ' Nrow("MonedaDR") = ValorXML(node, "MonedaDR")
- ' Nrow("MetodoDePagoDR") = ValorXML(node, "MetodoDePagoDR")
- ' Nrow("ImpPagado") = ValorXML(node, "ImpPagado").ToDecimal
- ' Nrow("Fecha") = FechaPago
-
- ' DTDocumentosRelacionados.Rows.Add(Nrow)
- ' StrUUID.AppendFormat("'{0}',", ValorXML(node, "IdDocumento").Replace("'", ""))
- 'Next
Dim ObjCompraFolios As New ClsCompras
If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa, OP:=2) Then
@@ -3031,12 +3015,10 @@ Partial Class Compras_eFacturas
If HdnCveIE.Value.ToEntero > 0 Then
-
For Each dRow As DataRow In DT_ComprasSinIE.Rows
objEventos.AddEventoBitacora($"Complemento { dRow("SerieFolioPago").ToString } vinculado manualmente a compra {dRow("SerieFolioCompra").ToString}", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=dRow("CveCompra").ToString.ToEntero)
Next
-
End If
@@ -3452,4 +3434,361 @@ Partial Class Compras_eFacturas
Alert("no se pudo procesar el archivo xml")
End If
End Sub
+
+
+ Private Sub VinculacionMasivaComplementos()
+
+ Dim CountVinculados As Integer = 0
+ Dim ValidadoSAT As Boolean = False
+ Dim VinculacionValida As Boolean = False
+
+ For Each gvRow As GridViewRow In GvPagos.Rows
+
+ Dim DTDocumentosRelacionados As New DataTable
+ Dim DTVinculacion As New DataTable
+
+ Dim ObjValidacion As New ClsValidaCFDi(gvRow.DataKey("UUID"), gvRow.DataKey("RFCDe"), gvRow.DataKey("RFCPara"), 0)
+
+ If ObjValidacion.EsValida > 0 Then
+
+ If ObjValidacion.EsValida = 2 Then
+ ValidadoSAT = False
+ Else
+ Dim ObjDatos As New ClsCompras
+ ValidadoSAT = ObjDatos.UpdateEstatus(ObjValidacion.EsValida, gvRow.DataKey("CveFactura").ToEntero)
+ ObjDatos.Dispose()
+ End If
+
+ Else
+ ValidadoSAT = False
+ End If
+ ObjValidacion.Dispose()
+
+ If Not ValidadoSAT Then
+ Continue For
+ End If
+
+ Dim sbSinIE As New StringBuilder
+
+ HdnCveIE.Value = ""
+ MSGComplemento = ""
+ ViculacionConPUE = False
+ ListaComprasPUE.Clear()
+ ComplementoConPUE = ""
+
+ DT_ComprasSinIE = New DataTable
+
+ Dim ListaComprasPUEInterna As New List(Of Integer)
+
+ Dim CveComplementoPagoCompra As Integer = gvRow.DataKey("CveComplementoPagoCompra").ToString.ToEntero
+
+ If CveComplementoPagoCompra > 0 Then
+ Continue For
+ End If
+
+ Dim SerieFolioIE As String = ""
+ Dim UUIDPago As String = ""
+ 'Dim ImportePago As Decimal = 0
+ Dim StrUUID As New StringBuilder
+ Dim Monto As Decimal = 0
+ Dim nodePagos As XmlNode = Nothing
+ Dim nodePagos2 As XmlNode = Nothing
+ Dim nodeComp As XmlNode = Nothing
+ Dim nodeaGral As XmlNode = Nothing
+ Dim nodeTFD As XmlNode = Nothing
+ Dim ImporteIES As Double = 0
+ Dim DiferenciaImportes As Double = 0
+ Dim TextoDiferenciaImporte As String = ""
+ Dim FechaPago As Date
+ Dim PagosCantidad As Integer = 0
+
+
+
+ Dim XMLDoc As New XmlDocument
+ Dim Archivo As String = String.Format("{0}Empresas\{1}\Compras\{2}\{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML"))
+ If IO.File.Exists(Archivo) Then
+
+
+ Dim SXML As String = File.ReadAllText(Archivo).Replace(vbLf, " ").Replace(vbCrLf, " ")
+
+ SXML = SXML.Trim((Convert.ToChar(0)))
+
+ XMLDoc.LoadXml(SXML)
+
+ Dim Xml As New StringBuilder
+ Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
+
+ namespaces.AddNamespace(XMLDoc.DocumentElement.Prefix, "http://www.sat.gob.mx/cfd/3")
+ namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
+ namespaces.AddNamespace("pago10", "http://www.sat.gob.mx/Pagos")
+ nodeComp = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", XMLDoc.DocumentElement.Prefix), namespaces)
+
+ nodeaGral = XMLDoc.SelectSingleNode(String.Format("//{0}:Comprobante", XMLDoc.DocumentElement.Prefix), namespaces)
+
+ nodeTFD = nodeComp.SelectSingleNode(String.Format("//{0}:TimbreFiscalDigital", "tfd"), namespaces)
+ nodePagos = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos/{0}:Pago", "pago10"), namespaces)
+ nodePagos2 = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos", "pago10"), namespaces)
+ 'Monto = ValorXML(nodePagos, "Monto").ToDecimal
+
+ Dim nodePago As XmlNodeList = nodePagos.SelectNodes(String.Format("//{0}:DoctoRelacionado", "pago10"), namespaces)
+
+ SeriePago = ValorXML(nodeaGral, "Serie")
+ FolioPago = ValorXML(nodeaGral, "Folio")
+
+ UUIDPago = ValorXML(nodeTFD, "UUID")
+ LblUUID.Text = UUIDPago
+
+
+ DTDocumentosRelacionados.Columns.Add("Serie")
+ DTDocumentosRelacionados.Columns.Add("SerieFolio")
+
+ DTDocumentosRelacionados.Columns.Add("IdDocumento")
+ DTDocumentosRelacionados.Columns.Add("Folio", GetType(Integer))
+ DTDocumentosRelacionados.Columns.Add("MonedaDR")
+ DTDocumentosRelacionados.Columns.Add("MetodoDePagoDR")
+ DTDocumentosRelacionados.Columns.Add("ImpPagado", GetType(Decimal))
+
+ DTDocumentosRelacionados.Columns.Add("CveFactura", GetType(Integer))
+ DTDocumentosRelacionados.Columns.Add("CveCompra", GetType(Integer))
+ DTDocumentosRelacionados.Columns.Add("CveIE", GetType(Integer))
+ DTDocumentosRelacionados.Columns.Add("Fecha", GetType(Date))
+
+ DTDocumentosRelacionados.Columns.Add("FolioPago")
+ DTDocumentosRelacionados.Columns.Add("ImportePago", GetType(Decimal))
+ DTDocumentosRelacionados.Columns.Add("FechaPago", GetType(Date))
+ DTDocumentosRelacionados.Columns.Add("CveMetodoPago", GetType(Integer))
+ DTDocumentosRelacionados.Columns.Add("SerieFolioCompra")
+
+
+
+ Dim nodePagosN As XmlNodeList
+ nodePagosN = nodeComp.SelectNodes(String.Format("//{0}:Pagos", "pago10"), namespaces)
+
+
+
+ For Each NodosPagos As XmlNode In nodePagosN
+ For Each innernode As XmlNode In NodosPagos
+
+ FechaPago = ValorXML(innernode, "FechaPago").ToDate
+ PagosCantidad = PagosCantidad + 1
+
+ For Each node As XmlNode In innernode
+
+ Dim Nrow As DataRow = DTDocumentosRelacionados.NewRow
+
+ Nrow("Serie") = ValorXML(node, "Serie")
+ Nrow("Folio") = ValorXML(node, "Folio").ToEntero
+ Nrow("SerieFolio") = ValorXML(node, "Serie") & "-" & ValorXML(node, "Folio").ToEntero
+ Nrow("IdDocumento") = ValorXML(node, "IdDocumento")
+ Nrow("MonedaDR") = ValorXML(node, "MonedaDR")
+ Nrow("MetodoDePagoDR") = ValorXML(node, "MetodoDePagoDR")
+
+ Monto = Monto + ValorXML(node, "ImpPagado").ToDecimal
+
+ Nrow("ImpPagado") = ValorXML(node, "ImpPagado").ToDecimal
+ Nrow("Fecha") = FechaPago
+
+ DTDocumentosRelacionados.Rows.Add(Nrow)
+ StrUUID.AppendFormat("'{0}',", ValorXML(node, "IdDocumento").Replace("'", ""))
+ Next
+
+ Next
+ Next
+
+
+
+ Dim ObjCompraFolios As New ClsCompras
+ If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa, OP:=2) Then
+ '
+ '.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
+ If ObjCompraFolios.DtResultados.Rows.Count > 0 Then
+ For Each drow As DataRow In ObjCompraFolios.DtResultados.Rows
+
+ For Each dRow2 As DataRow In DTDocumentosRelacionados.Rows
+
+ If dRow2("IdDocumento").ToString.ToUpper = drow("IdDocumento").ToString.ToUpper Then
+
+ dRow2("CveCompra") = drow("CveCompra").ToString.ToEntero
+ dRow2("CveFactura") = drow("CveFactura").ToString.ToEntero
+ dRow2("CveMetodoPago") = drow("CveMetodoPago").ToString.ToEntero
+ dRow2("SerieFolioCompra") = drow("SerieFolioCompra").ToString
+
+
+ If drow("CveIE").ToString.ToEntero > 0 Then
+
+ dRow2("CveIE") = drow("CveIE").ToString.ToEntero
+ dRow2("ImportePago") = drow("Importe").ToString.ToDecimal
+
+
+ End If
+
+ dRow2("FolioPago") = drow("FolioIE")
+ dRow2("FechaPago") = drow("FechaDocumento")
+
+
+
+
+ End If
+ Next
+ Next
+ End If
+ End If
+
+ ObjCompraFolios.Dispose()
+
+ 'GVPDocumentosRelacionadosPagos.DataSource = DTDocumentosRelacionados
+ 'GVPDocumentosRelacionadosPagos.DataBind()
+
+
+ For Each dRow2 As DataRow In DTDocumentosRelacionados.Rows
+ If dRow2("CveMetodoPago").ToString.ToEntero > 0 Then
+ If dRow2("CveMetodoPago").ToString.ToEntero = 1 Then
+ MSGComplemento = MSGComplemento & $" Compra {dRow2("SerieFolioCompra").ToString } bloqueado Tipo ""PUE"". "
+
+ ListaComprasPUEInterna.Add(dRow2("CveCompra").ToString.ToEntero)
+
+ ComplementoConPUE = $"{SeriePago}-{FolioPago}"
+
+ End If
+ End If
+ Next
+
+
+ DT_ComprasSinIE.Columns.Add("CveCompra", GetType(Integer))
+ DT_ComprasSinIE.Columns.Add("CveFactura", GetType(Integer))
+ DT_ComprasSinIE.Columns.Add("SerieFolioPago")
+ DT_ComprasSinIE.Columns.Add("SerieFolioCompra")
+
+ For Each dRow As DataRow In DTDocumentosRelacionados.Rows
+ Dim nRow As DataRow = DT_ComprasSinIE.NewRow
+ nRow("CveCompra") = dRow("CveCompra").ToString.ToEntero
+ ' nRow("CveFactura") = dRow("CveFactura").ToString.ToEntero
+ nRow("SerieFolioPago") = $"{SeriePago}-{FolioPago}"
+ nRow("SerieFolioCompra") = dRow("SerieFolioCompra").ToString
+
+ DT_ComprasSinIE.Rows.Add(nRow)
+
+
+ Next
+
+
+
+ Else
+ VinculacionValida = False
+ End If
+
+ CveFacturaPago = gvRow.DataKey("CveFactura").ToEntero
+ CveProveedor = gvRow.DataKey("CveProveedor").ToEntero
+ Dim ObjCompras As New ClsCompras
+
+
+ Dim TieneRegistros As Boolean = False
+
+ If ObjCompras.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
+ ' GvVincularPago.DataSource = ObjCompras.DtResultados
+ DTVinculacion = ObjCompras.DtResultados
+ If ObjCompras.DtResultados.Rows.Count > 0 Then
+ SerieFolioIE = ObjCompras.DtResultados.Rows(0)("SerieFolio").ToString
+ 'DivVincularPagoManualmente.Visible = False
+ VinculacionValida = True
+ TieneRegistros = True
+ Else
+ 'DivVincularPagoManualmente.Visible = True
+ VinculacionValida = False
+ End If
+ 'ImportePago = ObjCompras.DtResultados.SUMD("Monto")
+ Else
+ 'DivVincularPagoManualmente.Visible = False
+ VinculacionValida = False
+ End If
+
+
+ For Each dRow As DataRow In DTDocumentosRelacionados.Rows
+
+ Dim FechaDocumento As Date = dRow("FechaPago").ToString.ToDate
+ Dim FechaDoRecibo As Date = dRow("Fecha").ToString.ToDate
+ Dim CveIEDocumento As Integer = dRow("CveIE").ToString.ToEntero
+
+ If CveIEDocumento > 0 And FechaDocumento > New Date(1, 1, 1) Then
+
+ Dim FT1 As Date = FechaDocumento
+
+ If FechaDocumento <> New Date(1, 1, 1) Then
+ FT1 = FechaDocumento.AddDays(-6)
+ End If
+
+ Dim FT2 As Date = FechaDocumento.AddDays(7)
+
+ If Not (FechaDoRecibo >= FT1 And FechaDoRecibo < FT2) Then
+
+ VinculacionValida = False
+ 'MSGComplemento = MSGComplemento & " Existen mas de 3 días de diferencia entre la fecha del documento y la fecha de complemento. "
+ Exit For
+
+ End If
+
+ End If
+
+ Next
+
+ ObjCompras.Dispose()
+
+
+
+ If VinculacionValida Then
+
+ Dim TieneError = False
+ Dim ObjCompra As New ClsCompras
+ ObjCompra.IniciaTransacSQL()
+
+
+ For Each DTRow As DataRow In DTVinculacion.Rows
+
+ If Not ObjCompra.AddComplementoPago(DTRow("CveIE").ToString.ToEntero, DTRow("CveCompra").ToString.ToEntero, DTRow("Monto").ToString.ToDecimal, DTRow("CvePrePolizaDetalle").ToString.ToEntero, CveFacturaPago) > 0 Then
+ TieneError = True
+ End If
+
+
+ Next
+
+ If Not TieneError AndAlso Not ObjCompra.AddVincularPago(CveFacturaPago) Then
+ TieneError = True
+ Else
+ CountVinculados = CountVinculados + 1
+ End If
+
+
+ If Not TieneError Then
+ ObjCompra.Commit()
+ Else
+ ObjCompra.RollBack()
+ End If
+
+ ObjCompra.Dispose()
+
+
+
+ End If
+
+
+ Next
+
+
+ If CountVinculados > 0 Then
+
+ Alert($"Se vincularon {CountVinculados} complementos")
+ CargaDatos()
+
+ End If
+
+
+
+ End Sub
+
+
+ Protected Sub LnkVinculacionMasivaComplementos_Click(sender As Object, e As EventArgs)
+ VinculacionMasivaComplementos()
+ End Sub
+
+
End Class
\ No newline at end of file
diff --git a/Contabilidad2/RepAnexoCatalogoCC.aspx b/Contabilidad2/RepAnexoCatalogoCC.aspx
index 3f633936e..03e4cd9ec 100644
--- a/Contabilidad2/RepAnexoCatalogoCC.aspx
+++ b/Contabilidad2/RepAnexoCatalogoCC.aspx
@@ -1,4 +1,4 @@
-<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoCC.aspx.vb" Inherits="Contabilidad2_RepAnexoCatalogoCC" %>
+<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoCC.aspx.vb" Inherits="Contabilidad2_RepAnexoCatalogoCC" EnableEventValidation="false" %>
diff --git a/Contabilidad2/RepAnexoCatalogoCC.aspx.vb b/Contabilidad2/RepAnexoCatalogoCC.aspx.vb
index 2ea0fd95b..a41f8dcde 100644
--- a/Contabilidad2/RepAnexoCatalogoCC.aspx.vb
+++ b/Contabilidad2/RepAnexoCatalogoCC.aspx.vb
@@ -115,7 +115,7 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
Private Sub CargaDatos()
Dim Conta As New ClsContabilidad
- If Conta.GetAnexoCatalagoCC(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlDivisor.SelectedValue.ToEntero, DdlPeriodo.SelectedValue.ToEntero) Then
+ If Conta.GetAnexoCatalagoCC(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlDivisor.SelectedValue.ToEntero, DdlPeriodo.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
Dim DtHeaders As DataTable = Conta.DSResultados.Tables(0)
GvCC.DataSource = Conta.DSResultados.Tables(1)
diff --git a/Contabilidad2/RepEstadoResultadosHorizontal.aspx b/Contabilidad2/RepEstadoResultadosHorizontal.aspx
index 06612d679..ef097ec74 100644
--- a/Contabilidad2/RepEstadoResultadosHorizontal.aspx
+++ b/Contabilidad2/RepEstadoResultadosHorizontal.aspx
@@ -1,4 +1,4 @@
-<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoResultadosHorizontal.aspx.vb" Inherits="Contabilidad_RepEstadoResultadosHorizontal" %>
+<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoResultadosHorizontal.aspx.vb" Inherits="Contabilidad_RepEstadoResultadosHorizontal" EnableEventValidation="false" %>
diff --git a/Inventarios/Kardex.aspx b/Inventarios/Kardex.aspx
index 766adc971..c63c3d11e 100644
--- a/Inventarios/Kardex.aspx
+++ b/Inventarios/Kardex.aspx
@@ -506,7 +506,7 @@
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb
index 15a4aaa3e..7b4646f64 100644
--- a/Inventarios/TraspasoAlmacen.aspx.vb
+++ b/Inventarios/TraspasoAlmacen.aspx.vb
@@ -1451,6 +1451,7 @@ Partial Class Inventarios_TraspasoAlmacen
Else
RegistraScript("$('#DivTransitorio').hide(500);$('#DivGastoIndirecto').hide(500);$('#DivDocChofer').hide(500);")
End If
+ CargaAlmacenDestino()
SiguienteFolio(If(ChkTransitorio.Checked, 9, 8))
End Sub
@@ -2846,29 +2847,42 @@ Partial Class Inventarios_TraspasoAlmacen
DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
UpDatos.Update()
- Dim DrAlmO As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero).FiltroPrimero("")
- If DrAlmO("CveTipoAlmacen").ToString.ToEntero = 26 Then 'costeados
+ CargaAlmacenDestino()
- DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen IN (26) AND Estatus = 'Activo'")
- DdlAlmacenDestino.DataBind()
- DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ End If
+ End Sub
+
+ Private Sub CargaAlmacenDestino()
+
+ Dim DrAlmO As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero).FiltroPrimero("")
+ If DrAlmO("CveTipoAlmacen").ToString.ToEntero = 26 Then 'costeados
+
+ DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen IN (26) AND Estatus = 'Activo'")
+ DdlAlmacenDestino.DataBind()
+ DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ Else
+
+ Dim Str As String
+ If ChkTransitorio.Checked Then
+ Str = "" ' String.Format(" AND CveSubProyecto <> {0} ", DrAlmO("CveSubProyecto")) 'RMF. pueden haber almacen que esten dentro de lamisma sucursal, pero que requeiren transitorio
Else
-
- DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,24) AND Estatus = 'Activo'")
- DdlAlmacenDestino.DataBind()
- DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ Str = String.Format(" AND CveSubProyecto = {0} ", DrAlmO("CveSubProyecto"))
End If
+ DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveTipoAlmacen NOT IN (3,4,9,10,11,24) AND Estatus = 'Activo' {0} ", Str))
+ DdlAlmacenDestino.DataBind()
+ DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
End If
End Sub
Protected Sub DdlAlmacenDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacenDestino.SelectedIndexChanged
- If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").ToString.ToEntero = 21 Then
- ChkTransitorio.Checked = False
- ChkTransitorio.Enabled = False
- Else
- ChkTransitorio.Enabled = True
- End If
+ 'If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").ToString.ToEntero = 21 Then
+ ' ChkTransitorio.Checked = False
+ ' ChkTransitorio.Enabled = False
+ 'Else
+ ' ChkTransitorio.Enabled = True
+ 'End If
If DdlAlmacenDestino.SelectedValue.ToEntero > 0 Then
DdlSeccionAlmacenDestino.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestino.SelectedValue.ToEntero)
DdlSeccionAlmacenDestino.DataBind()