--Merge Cotizacion

This commit is contained in:
2022-11-09 16:34:50 -07:00
49 changed files with 9565 additions and 9073 deletions

View File

@@ -505,7 +505,7 @@
<div class="form-group proveedoreespes">
<span class="whitoutcol linewhitsize proveedoreespes">F. Captura </span>
<div class="whitoutcol whitoutcol">
<asp:Literal ID="LitFechCaptura" runat="server"></asp:Literal>
<asp:Label ID="LitFechCaptura" runat="server"></asp:Label>
</div>
</div>
<div class="form-group proveedoreespes">
@@ -5925,12 +5925,9 @@
if (!isNaN(txtComision.value)) {
txtComisionImporte = ToDouble(txtComision.value);
}
}
var txtvalue = ToDouble(txt.value);
}
var txtvalue = ToDouble(txt.value);
if (txtComisionImporte != 0 && txtComisionImporte > txtvalue) {
@@ -5941,7 +5938,7 @@
return;
}
debugger;
if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) {
txtvalue = ToDouble(txtvalue / TCAnticipo);
} else if (CveMonedaAnticipo == 2 && CveMonedaOriginal == 1) {
@@ -5949,7 +5946,7 @@
}
var SaldoCompra = (TotalSaldo - FnSumaValoresAnt() + ToDouble(txtvalue)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2));
alert(txtvalue);
if (SaldoCompra < 0) txt.value = SaldoCompra - txtvalue;
//minimo entre saldocompra y el saldoanticipo
if (SaldoCompra < saldo) saldo = SaldoCompra;

View File

@@ -1769,7 +1769,7 @@ Partial Class Compras_Compras
If Validada And Not EnListadoEFOS Then
Try
XMLDoc.Load(Archivo)
XMLDoc.LoadXml(File.ReadAllText(Archivo).Replace("&lt;br&gt;", "").Replace("&lt;", ""))
Catch ex As Exception
Try
Dim oReader = New StreamReader(Archivo, Encoding.GetEncoding("ISO-8859-1"))
@@ -1820,13 +1820,21 @@ Partial Class Compras_Compras
Xml = Xml.Replace(Chr(13), "") 'salto de linea
Xml = Xml.Replace(Chr(10), "")
Xml = Xml.Replace("<br />", "") 'salto de linea html
Xml = Xml.Replace("&lt;br&gt;", "")
Xml = Xml.Replace("&lt;", "")
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
@@ -1939,6 +1947,11 @@ Partial Class Compras_Compras
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
@@ -2264,6 +2277,10 @@ Partial Class Compras_Compras
Private Sub ValidacionesTotalesXml()
If Not TmpDT.Columns.Contains("Amortizacion") Then
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
End If
Dim Msg As String = ""
Dim SubtotalTemp = TmpDT.SUM("Total") + Math.Round(TmpDT.SUM("Descuento") + Math.Round(TmpDT.SUM("Amortizacion")), 2)
Dim DescuentosTemp = TmpDT.SUM("Descuento")
@@ -2625,6 +2642,7 @@ Partial Class Compras_Compras
TxtObsFact.Text = dr("Observaciones").ToString
LblUsuarioCaptura.Text = dr("Usuario").ToString
LitFechCaptura.Text = dr("FechaIng").ToString.ToDate.ToShortDateString
LitFechCaptura.ToolTip = dr("FechaIng").ToString
LblRetIVA.Text = Math.Round((dr("RetIVA").ToString.ToDouble / TxtSubTotal2.Text.ToDouble) * 100, 4).FormatoNumero(3) + "%"
LblRetISR.Text = Math.Round((dr("RetISR").ToString.ToDouble / TxtSubTotal2.Text.ToDouble) * 100, 4).FormatoNumero(3)
If dr("TipoFactura").ToString <> "CFDi" Then LblTipoFact.Text = dr("TipoFactura").ToString : divTipoFactura.Visible = True
@@ -4757,7 +4775,7 @@ Partial Class Compras_Compras
'End If
'METODO DE PREPOLIZA DE ALMACEN
If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140, 141, 145, 152, 153, 154, 158, 159, 160, 161, 162, 163) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140, 141, 145, 152, 153, 154, 158, 159, 160, 161, 162, 163, 172, 173) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
If ImporteAlmacen > 0 Then
If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
@@ -8087,11 +8105,15 @@ Partial Class Compras_Compras
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Inventarios/RecepcionAlmacen.aspx?CveCompra={CveCompra}&ED=1"">Recibir mercancía de entrega directa.</a>")
End If
If Not TieneError AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
TieneError = True
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not TieneError AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
TieneError = True
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
End If
End If
If Not TieneError Then
ObjCompras.Commit()
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()

View File

@@ -1236,17 +1236,20 @@ Partial Class PopUpVerFactura
Dim Path As String = String.Format("{0}{2}\Pag\{1}.{2}", UsuarioActual.Empresa.Ruta, UrlParametros("SERIEFOLIO"), UrlParametros("EXT").ToString)
Dim Archivo As New System.IO.FileInfo(Path)
If UrlParametros("EXT").ToString.ToUpper = "PDF" Then
If UrlParametros("CVECOMPLEMENTOPAGO").ToString.ToEntero > 0 Then
Dim CveIE As Integer = -1
If UrlParametros("CVEIE") IsNot Nothing Then
CveIE = UrlParametros("CVEIE").ToString.ToEntero
If Not Archivo.Exists Then
If UrlParametros("EXT").ToString.ToUpper = "PDF" Then
If UrlParametros("CVECOMPLEMENTOPAGO").ToString.ToEntero > 0 Then
Dim CveIE As Integer = -1
If UrlParametros("CVEIE") IsNot Nothing Then
CveIE = UrlParametros("CVEIE").ToString.ToEntero
End If
PDFReciboDePagos(-1, CveIE, UrlParametros("CVECOMPLEMENTOPAGO").ToString.ToEntero, False) 'genero el documento de no existir
End If
PDFReciboDePagos(-1, CveIE, UrlParametros("CVECOMPLEMENTOPAGO").ToString.ToEntero, False) 'genero el documento de no existir
End If
Archivo = Nothing
End If
Archivo = Nothing
End If
If UrlParametros("SERIEFOLIO") IsNot Nothing AndAlso UrlParametros("SERIEFOLIO").ToString <> "" AndAlso UrlParametros("EXT").ToString <> "" Then

View File

@@ -3101,7 +3101,7 @@
<asp:Literal ID="LtlEventoBitacora" runat="server" Text='<%# Eval("Descripcion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<asp:TemplateField HeaderStyle-Width="30px">
<HeaderTemplate>Archivo</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkArchivo" Visible="false" runat="server" CssClass="Texto" OnClick="DownloadFile">

View File

@@ -2173,64 +2173,7 @@ Partial Class Compras_eFacturas
Return Fact
End Function
Private Function GuardaArchivoXML(Archivo As String) As Modelos.eFactura
' , Destino As String, Temporal As String
Dim Retorno As Modelos.eFactura = Nothing
If File.Exists(Archivo) Then
Dim NombreArchivo As String = Path.GetFileName(Archivo)
Dim invalidChars As Char() = Path.GetInvalidFileNameChars()
Dim invalidString As String = Regex.Escape(New String(invalidChars))
Dim valid As String = Regex.Replace(NombreArchivo, (Convert.ToString("[") & invalidString) + "]", "")
NombreArchivo = valid
Try
Dim XMLDoc As New XmlDocument()
XMLDoc.Load(Archivo)
Retorno = CargaDatosXML(XMLDoc)
Catch exx As XmlException
Retorno = Nothing
'Dim texto As Dynamic = File.ReadAllText(Archivo)
Dim txt_utf8 As New UTF8Encoding()
'REEMPLAZA CARACTERES ESPECIALES Y VUELVE A LEER EL DOCUMENTO
'texto = RemoveIllegalXMLCharacters(texto)
' SE RENOMBRA EL ARCHIVO, PERO SE QUITO POR SI NO COINCIDE EL PDF CON EL NOMBRE
'Archivo = Archivo.ToUpper.Replace(".XML", "-2.XML")
'NombreArchivo = IO.Path.GetFileName(Archivo)
'File.WriteAllText(Archivo, texto)
' Dim xmltr As New XmlTextReader(New MemoryStream(RemoveIllegalXMLCharacters(texto)))
Dim XMLDoc As New XmlDocument()
Try
XMLDoc.Load(Archivo)
Retorno = CargaDatosXML(XMLDoc)
Catch ex As Exception
Retorno = Nothing
End Try
Catch ex As Exception
Retorno = Nothing
End Try
'si se cargaron todos los datos
If Retorno IsNot Nothing AndAlso Not String.IsNullOrEmpty(Retorno.TFDUUID) Then
'XML
Retorno.ArchivoXML = NombreArchivo
End If
End If
Return Retorno
End Function
Private Sub CargaImpuestosXML(XMLDoc As XmlDocument)
Dim Prefijo As String = If(String.IsNullOrEmpty(XMLDoc.DocumentElement.Prefix), "cfd", XMLDoc.DocumentElement.Prefix)
Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3"
@@ -3338,7 +3281,7 @@ Partial Class Compras_eFacturas
Dim SXML As String = File.ReadAllText(Archivo).Replace(vbLf, " ").Replace(vbCrLf, " ")
SXML = SXML.Replace("o;?", "")
SXML = SXML.Trim((Convert.ToChar(0)))
XMLDoc.LoadXml(SXML)
@@ -4508,7 +4451,7 @@ Partial Class Compras_eFacturas
Dim SXML As String = File.ReadAllText(Archivo).Replace(vbLf, " ").Replace(vbCrLf, " ")
SXML = SXML.Replace("o;?", "")
SXML = SXML.Trim((Convert.ToChar(0)))
XMLDoc.LoadXml(SXML)