Transportes Mejoras
This commit is contained in:
@@ -4481,6 +4481,10 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ValidaFechaDeAlamacen() Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(538) = "1" Then
|
||||
@@ -7803,6 +7807,54 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ValidaFechaDeAlamacen() As Boolean
|
||||
Dim respuesta As Boolean = False
|
||||
|
||||
|
||||
|
||||
Dim objInventario As New ClsInventarios
|
||||
Dim MovimientosError As Boolean = False
|
||||
|
||||
'Dim SB As New StringBuilder
|
||||
'Dim FechaCompra As DateTime = TxtFecha.Text.ToDate
|
||||
'FechaCompra
|
||||
Dim FechaMinima As DateTime = TxtFecha.Text.ToDate
|
||||
|
||||
If DtInv IsNot Nothing Then
|
||||
For Each Dr As DataRow In TmpDT.Rows
|
||||
|
||||
Dim CveTipoPS As Integer = Dr("CveTipoPS").ToString.ToEntero
|
||||
|
||||
If CveTipoPS = 2 Then
|
||||
If objInventario.GetValidaFechaAlmacen(CveEmpresa:=UsuarioActual.CveEmpresa, CveAlmacen:=ddlAlmacenAdd.SelectedValue.ToEntero, CvePS:=Dr("CvePS").ToString.ToEntero) Then
|
||||
|
||||
If objInventario.DtResultados IsNot Nothing AndAlso objInventario.DtResultados.Rows.Count > 0 Then
|
||||
Dim FechamoMovimiento As DateTime = objInventario.DtResultados(0)("FechaMovto").ToString.ToDate
|
||||
If FechamoMovimiento > FechaMinima Then
|
||||
FechaMinima = FechamoMovimiento
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
objInventario.Dispose()
|
||||
|
||||
If FechaMinima > TxtFecha.Text.ToDate Then
|
||||
Alert($"Los productos tienen movientos, la fecha minima que se puede aplicar es {FechaMinima.ToString("dd/MM/yyyy HH:mm")}", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Else
|
||||
respuesta = True
|
||||
End If
|
||||
|
||||
Return respuesta
|
||||
|
||||
End Function
|
||||
|
||||
Private Function GeneraStrinDoctosRelacionados() As String
|
||||
|
||||
Dim DoctosRelacionados As String = "-1"
|
||||
|
||||
@@ -107,6 +107,32 @@ Partial Class PopUpVerFactura
|
||||
ImprimeFormatoCartaPorteTimbrado(Request("CVETIMBRE").ToString.ToEntero)
|
||||
End If
|
||||
|
||||
If Request("ArchivoContrato") IsNot Nothing AndAlso Request("ArchivoContrato") IsNot Nothing Then
|
||||
|
||||
Dim ArchivoContrato As String = Decripta(Request("ArchivoContrato"))
|
||||
Dim File As New FileInfo(ArchivoContrato)
|
||||
|
||||
If File.Exists Then 'set appropriate headers
|
||||
|
||||
Response.Clear()
|
||||
Response.ClearHeaders()
|
||||
Response.ClearContent()
|
||||
Response.AddHeader("Content-Disposition", "inline; filename=" & $"{File.Name}")
|
||||
Response.AddHeader("Content-Length", File.Length.ToString())
|
||||
'Response.ContentType = "text/plain"
|
||||
Response.ContentType = "application/octet-stream"
|
||||
Response.Flush()
|
||||
' Response.TransmitFile(File.FullName)
|
||||
Response.WriteFile(File.FullName)
|
||||
Response.End()
|
||||
|
||||
Else
|
||||
|
||||
Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()")
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
If Request("RFC") IsNot Nothing AndAlso Request("File") IsNot Nothing Then
|
||||
Dim Path As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, Request("RFC"), Request("File"))
|
||||
Dim Archivo As New System.IO.FileInfo(Path)
|
||||
|
||||
@@ -9036,16 +9036,23 @@ Namespace ADS.eFacturas
|
||||
Try
|
||||
Dim listaDS As New List(Of ReportDataSource)
|
||||
Dim rdsTotales As New ReportDataSource()
|
||||
Dim ltotales As New List(Of utilValores)()
|
||||
'Dim ltotales As New List(Of utilValores)()
|
||||
|
||||
Dim DTTotales As New DataTable
|
||||
DTTotales.TableName = "DTTotales"
|
||||
DTTotales.Columns.Add("Nombre")
|
||||
DTTotales.Columns.Add("Valor")
|
||||
|
||||
ltotales.Add(New utilValores("Subtotal", objxml.comprobante.SubTotal.ToString("N2")))
|
||||
Dim nRowSubtotales As DataRow = DTTotales.NewRow
|
||||
nRowSubtotales("Nombre") = "Subtotal"
|
||||
nRowSubtotales("Valor") = objxml.comprobante.SubTotal.ToString("N2")
|
||||
DTTotales.Rows.Add(nRowSubtotales)
|
||||
|
||||
If objxml.comprobante.Descuento > 0 Then
|
||||
ltotales.Add(New utilValores("Descuento", objxml.comprobante.Descuento.ToString("N2")))
|
||||
Dim nRowDescuento As DataRow = DTTotales.NewRow
|
||||
nRowDescuento("Nombre") = "Descuento"
|
||||
nRowDescuento("Valor") = objxml.comprobante.Descuento.ToString("N2")
|
||||
DTTotales.Rows.Add(nRowDescuento)
|
||||
End If
|
||||
|
||||
For Each item As CFDIImpuesto In objxml.Impuestos
|
||||
@@ -9053,8 +9060,6 @@ Namespace ADS.eFacturas
|
||||
If item.Importe > 0 Then
|
||||
Dim TasaOCuota As Decimal = 0
|
||||
Decimal.TryParse(item.TasaOCuota, TasaOCuota)
|
||||
ltotales.Add(New utilValores($"Impuestos {item.Tipo} {item.ImpuestoTexto} {(If(item.TipoFactor = "Tasa", (TasaOCuota * 100).ToString("N4"), item.TasaOCuota))} {(If(item.TipoFactor = "Tasa", "%", ""))}", item.Importe.ToString("N2")))
|
||||
|
||||
nRow("Nombre") = $"Impuestos {item.Tipo} {item.ImpuestoTexto} {(If(item.TipoFactor = "Tasa", (TasaOCuota * 100).ToString("N4"), item.TasaOCuota))} {(If(item.TipoFactor = "Tasa", "%", ""))}"
|
||||
nRow("Valor") = item.Importe.ToString("N2")
|
||||
DTTotales.Rows.Add(nRow)
|
||||
@@ -9062,7 +9067,11 @@ Namespace ADS.eFacturas
|
||||
End If
|
||||
Next
|
||||
|
||||
ltotales.Add(New utilValores("Total", objxml.comprobante.Total.ToString("N2")))
|
||||
Dim nRowTotal As DataRow = DTTotales.NewRow
|
||||
nRowTotal("Nombre") = "Subtotal"
|
||||
nRowTotal("Valor") = objxml.comprobante.Total.ToString("N2")
|
||||
DTTotales.Rows.Add(nRowTotal)
|
||||
|
||||
rdsTotales.Name = "dsTotales"
|
||||
rdsTotales.Value = DTTotales 'ltotales.ToDataTable
|
||||
listaDS.Add(rdsTotales)
|
||||
|
||||
Reference in New Issue
Block a user