Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -66,6 +66,9 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkBitacotaFacturas" runat="server" OnClick="LnkBitacotaFacturas_Click"><i class="fa fa-book" ></i> Bitácora Facturas</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkVinculacionMasivaComplementos" runat="server" OnClick="LnkVinculacionMasivaComplementos_Click" Visible ="true" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea realizar la vinculación masiva de complementos?" data-btn-ok-label="si"><i class="fa fa-tasks" ></i> Vinculación Masiva Complementos</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkPdf"/>
|
||||
@@ -374,7 +377,7 @@
|
||||
<div>
|
||||
<asp:LinkButton ID="LnkOP" runat="server" AlternateText="Omitir" ToolTip="Omitir Factura" CommandArgument='<%# Eval("CveFactura") %>' Visible='<%# Eval("CveCompra").ToString = "" AndAlso Eval("CveFactura").ToString <> "" AndAlso Eval("FueValidado").ToString <> "3" %>'
|
||||
CssClass="btn btn-circle btn-sm grey-cascade" CausesValidation="False" CommandName="Omitir" OnClientClick="javascript:return confirm('¿Está seguro que desea omitir la factura?');">
|
||||
<i class='fa fa-eye-slash fa-2x'></i>
|
||||
<i class='fa fa-eye-slash fa-2x'></i>
|
||||
</asp:LinkButton>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
|
||||
@@ -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
|
||||
@@ -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" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -506,7 +506,7 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlSerieTitle" Text="Series con Existencias" runat="server"> </asp:Literal></h4>
|
||||
<asp:Literal ID="LtlSerieTitle" Text="Series Disponibles" runat="server"> </asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row" style="width:100%">
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user