diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index 996e1641c..966e36d81 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -6292,6 +6292,34 @@ Public Class ClsInventarios
Return Retorno
End Function
+
+#Region " K P I "
+
+
+ Public Function GetVerComportamiento(CvePS As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveAlmacenes As String) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Inv_VerComportamientoGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@FechaI", SqlDbType.Date).Value = FechaI
+ .Add("@FechaF", SqlDbType.Date).Value = FechaF
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveAlmacenes", SqlDbType.VarChar).Value = CveAlmacenes
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al consultar el comportamiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+#End Region
+
#Region " IDisposable Support "
' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
@@ -6322,6 +6350,8 @@ Public Class ClsInventarios
End Sub
+
+
#End Region
End Class
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index f8ce9cbce..8dfb1d23d 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -2844,6 +2844,28 @@ Public Class ClsPaginas
End Set
End Property
+ Public Shared Property GlobalDTVtaCobranzaTurnos(CveEmpresa As Integer, Optional CveCobranzaTurno As Integer = -1) As DataTable
+ Get
+ Dim AppNombre As String = $"GlobalDTVtaCobranzaTurnos-{CveEmpresa}"
+ If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ Dim ObjVentas As New ClsVentas
+ If ObjVentas.GetCobranzaTurnoEstatus(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjVentas.DtResultados
+ ObjVentas.Dispose()
+ End If
+ If CveCobranzaTurno <> -1 Then
+ Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCobranzaTurno = {CveCobranzaTurno}", "", DataViewRowState.CurrentRows)
+ GlobalDTVtaCobranzaTurnos = Dv.ToTable
+ Dv.Dispose()
+ Else
+ GlobalDTVtaCobranzaTurnos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
+ End If
+ End Get
+ Set(value As DataTable)
+ Dim AppNombre As String = $"GlobalDTVtaCobranzaTurnos-{CveEmpresa}"
+ HttpContext.Current.Application(AppNombre) = value
+ End Set
+ End Property
+
Public Shared Property GlobalDTVtaComplementoCFDI() As DataTable
Get
Dim AppNombre As String = "GlobalDTVtaComplementoCFDI"
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 336f2ff0b..767ffd089 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -455,7 +455,7 @@ Public Class ClsVentas
Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False, Optional CveLineaAdicional As Integer = -1, Optional DescripcionVenta As String = "",
Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1, Optional RequiereOS As Boolean = False,
Optional FechaParaSurtir As DateTime = MinFecha, Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional EsFacturaGlobal As Boolean = False, Optional CveSATPeriodicidad As Integer = -1, Optional CveSATMes As Integer = -1, Optional SATAnio As Integer = -1, Optional CveMotivoDevolucion As Integer = -1,
- Optional Addenda As String = "") As Boolean
+ Optional CveCobranzaEstatusTurno As Integer = -1, Optional Addenda As String = "") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_VentasAdd")
@@ -570,6 +570,7 @@ Public Class ClsVentas
.Add("@SATAnio", SqlDbType.Int).Value = SATAnio
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
.Add("@CveMotivoDevolucion", SqlDbType.Int).Value = CveMotivoDevolucion
+ .Add("@CveCobranzaEstatusTurno", SqlDbType.Int).Value = CveCobranzaEstatusTurno
.Add("@Addenda", SqlDbType.VarChar).Value = Addenda
End With
'SqlTypes.SqlDateTime.Null
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index bebe8fb29..c876401d5 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -6137,7 +6137,8 @@
txt.value = SaldoCompra - txtvalue;
}
}
-
+
+ debugger;
let saldoVal = saldo;
if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) {
saldoVal = ToDouble(saldo / TCAnticipo)
@@ -6145,7 +6146,9 @@
saldoVal = ToDouble(saldo * TCAnticipo)
}
- if (saldoVal > SaldoCompra ) {
+ //(Math.round(saldoVal * 100) / 100);
+
+ if ((Math.round(saldoVal * 100) / 100) > SaldoCompra ) {
saldo = SaldoCompra;
if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) {
saldoVal = ToDouble(saldo / TCAnticipo);
@@ -6160,7 +6163,8 @@
chk.checked = true;
} else {
chk.checked = false;
- }
+ }
+
if (ToDouble(txtvalue) > saldoVal) {
txt.value = FormatoNumero(saldo, 2);
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 3b98dd2bf..9c813819a 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -401,6 +401,7 @@ Partial Class Compras_Compras
Public Property CvePersonal As Integer
Public Property CveCompra As Integer
Public Property CvePrePoliza As Integer
+ Public Property Fecha As Date
End Class
Private Property ArrAnticipos As ArrayList
Get
@@ -1427,7 +1428,7 @@ Partial Class Compras_Compras
End If
Next
- If HayDifIEPS Then Alert("El porcentaje de IEPS del producto no coincide con el especificado.", TipoMensaje.MsgAdvertencia)
+ 'If HayDifIEPS Then Alert("El porcentaje de IEPS del producto no coincide con el especificado.", TipoMensaje.MsgAdvertencia)
If UsuarioActual.Empresa.Funcionalidad(562).ToEntero > 0 Then CargaGastosServicios(UsuarioActual.Empresa.Funcionalidad(562).ToEntero)
@@ -1985,13 +1986,14 @@ Partial Class Compras_Compras
End If
End If
Next
- If EmisorRegimenFiscal = "626" AndAlso Not RetISRResico Then
+
+ If EmisorRegimenFiscal = "626" AndAlso Not RetISRResico AndAlso EmisorRFC.Length = 13 AndAlso UsuarioActual.CveEmpresa.Contiene(119, 158) Then 'solo para personas físicas
SbValRet.Append(" La factura no tiene especificado una retención de ISR, ya que el proveedor es Resico.
")
BtnGuardar.Enabled = False
End If
If SbValRet.ToString.Trim.Length > 0 Then
- Alert(SbValRet.ToString, TipoMensaje.MsgAdvertencia)
+ Alert("El porcentaje de IEPS del producto no coincide con el especificado.
" & SbValRet.ToString, TipoMensaje.MsgAdvertencia)
End If
Else
@@ -3698,12 +3700,26 @@ Partial Class Compras_Compras
ObjProveedor.Dispose()
End Sub
- Private Sub CargaAnticipos(CveProveedor As Integer, Optional FiltroTipo As String = "-1")
+ Private Sub CargaAnticipos(CveProveedor As Integer, Optional FiltroTipo As String = "-1", Optional PagarDolaresEnPesos As Boolean = False)
+
Dim ObjMovtos As New ClsMovimientos()
+
+ DivPagarConPesos.Visible = False
+ If DdlMoneda.SelectedValue.ToEntero = 2 Then
+ DivPagarConPesos.Visible = True
+ End If
+
If ObjMovtos.GetAnticiposProveedor(CveProveedor, -1, CveMoneda:=-1, SelectTop:=-1, TipoDocto:=FiltroTipo) AndAlso ObjMovtos.DtResultados.Rows.Count > 0 Then
Dim CveMoneda As Integer = If(ChkPagarConPesos.Checked, 1, If(ChkPagarConDolares.Checked, 2, DdlMoneda.SelectedValue.ToEntero))
If DdlMoneda.SelectedValue.ToEntero = 1 AndAlso CveCompra > 0 Then DivPagarConDolares.Visible = True Else If CveCompra > 0 Then DivPagarConPesos.Visible = True
- GVAnticipos.DataSource = ObjMovtos.DtResultados.FiltraParametros($"Tipo = 'Act' AND CveMoneda = {CveMoneda}")
+
+ If PagarDolaresEnPesos Then
+ GVAnticipos.DataSource = ObjMovtos.DtResultados.FiltraParametros($"Tipo = 'Act' CveMoneda = 1")
+ Else
+ GVAnticipos.DataSource = ObjMovtos.DtResultados.FiltraParametros($"Tipo = 'Act' AND CveMoneda = {CveMoneda}")
+ End If
+
+
If ObjMovtos.DtResultados.FiltraParametros("Saldo > 0").Rows.Count > 0 Then
BtnAceptarAnticipos.Enabled = True
If DdlTipoComprobante.SelectedValue = "Fac" Then ImgAnticiposPendientes.Visible = True
@@ -7324,6 +7340,17 @@ Partial Class Compras_Compras
Pago.ImportePago = importeMovimiento + ImporComisionAnticipo
Pago.CveIE = Ant.CveIE
Pago.TCPago = Ant.TCCompra
+
+ If Pago.CveMonedaPago = 1 AndAlso CompraActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos
+ Pago.TCPago = 1 ' TxtTC.Text.ToDecimal
+ Pago.TCCambioMoneda = Ant.TCCompra 'GlobalTipoCambio(Now).ToDecimal
+
+ If Ant.TCCompra = 1 Then
+ Pago.TCCambioMoneda = 1 / GlobalTipoCambio(Ant.Fecha).ToDecimal
+ End If
+
+ End If
+
Pago.CveMonedaPago = If(Ant.TCCompra > 1, 2, 1)
Pago.OtroGastoIngreso = -ImporComisionAnticipo
ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjConta)
@@ -8029,10 +8056,10 @@ Partial Class Compras_Compras
If (TmpDT.Rows(IndiceUltimo)("IVA").ToString.ToDecimal + DiferenciaIVas) < 0 Then
- Dim AjusteteDividido As Decimal = Math.Abs(DiferenciaIVas) / CantidadRegistroConIVA
+ Dim AjusteteDividido As Decimal = DiferenciaIVas / CantidadRegistroConIVA
For Each dRow As DataRow In TmpDT.Rows
- dRow("IVA") = dRow("IVA").ToString.ToDecimal - AjusteteDividido
+ dRow("IVA") = dRow("IVA").ToString.ToDecimal + AjusteteDividido
Next
Else
@@ -8555,7 +8582,7 @@ Partial Class Compras_Compras
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then
- ArrAnticipos.Add(New Anticipos With {.CvePrePoliza = gvr.DataKey("CvePrePoliza").ToEntero, .CveIE = gvr.DataKey("CveIE").ToString.ToEntero, .CveCompra = gvr.DataKey("CveCompra").ToEntero, .Importe = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, .ImporteComision = gvr.FCTextBox("TxtComision").Text.ToDecimal, .TCCompra = gvr.DataKey("TCCompra").ToDecimal, .TipoMovto = gvr.DataKey("TipoDocto")})
+ ArrAnticipos.Add(New Anticipos With {.CvePrePoliza = gvr.DataKey("CvePrePoliza").ToEntero, .CveIE = gvr.DataKey("CveIE").ToString.ToEntero, .CveCompra = gvr.DataKey("CveCompra").ToEntero, .Importe = gvr.FCTextBox("TxtAnticipo").Text.ToDecimal, .ImporteComision = gvr.FCTextBox("TxtComision").Text.ToDecimal, .TCCompra = gvr.DataKey("TCCompra").ToDecimal, .TipoMovto = gvr.DataKey("TipoDocto"), .Fecha = gvr.DataKey("Fecha").ToDate})
End If
Next
diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb
index f95f0a88a..606b30b43 100644
--- a/Compras/eFacturas.aspx.vb
+++ b/Compras/eFacturas.aspx.vb
@@ -1584,58 +1584,73 @@ Partial Class Compras_eFacturas
Dim FiInfo As New FileInfo(comprmido)
- Using stream As Stream = System.IO.File.OpenRead(FiInfo.FullName)
- Try
- Dim reader = ReaderFactory.Open(stream)
+ Try
+ Using stream As Stream = System.IO.File.OpenRead(FiInfo.FullName)
+ Try
+ Dim reader = ReaderFactory.Open(stream)
- Dim Multiparte As Boolean = False
- If Path.GetExtension(FiInfo.FullName.ToUpper()) = ".RAR" And FiInfo.FullName.ToUpper().Contains(".PART") Then
- 'SI ES .RAR, PUEDE SER MULTI PART Y PUEDE TRONAR
- Using archive As RarArchive = RarArchive.Open(FiInfo.FullName)
- If archive.IsMultipartVolume() Then
- Multiparte = True
- End If
- End Using
- End If
-
- Dim PdfList As New List(Of String)
- If Not Multiparte Then
- 'puede tronar si el archivo es multiparte
- While reader.MoveToNextEntry()
- If Not reader.Entry.IsDirectory Then
- 'Si es un archivo XML, lo leo y lo guardo
-
- Dim nombreArchivo As String = ""
-
- If reader.Entry.FilePath.Contains("/") Then
- nombreArchivo = reader.Entry.FilePath.Substring(reader.Entry.FilePath.LastIndexOf("/") + 1)
- Else
- nombreArchivo = reader.Entry.FilePath
+ Dim Multiparte As Boolean = False
+ If Path.GetExtension(FiInfo.FullName.ToUpper()) = ".RAR" And FiInfo.FullName.ToUpper().Contains(".PART") Then
+ 'SI ES .RAR, PUEDE SER MULTI PART Y PUEDE TRONAR
+ Using archive As RarArchive = RarArchive.Open(FiInfo.FullName)
+ If archive.IsMultipartVolume() Then
+ Multiparte = True
End If
+ End Using
+ End If
- If Path.GetExtension(reader.Entry.FilePath.ToUpper()) = ".XML" Then
- reader.WriteEntryToDirectory(String.Format("{0}Temp\Facturas", UsuarioActual.Empresa.Ruta), ExtractOptions.None Or ExtractOptions.Overwrite)
- ListXML.Add(String.Format("{0}Temp\Facturas\{1}", UsuarioActual.Empresa.Ruta, nombreArchivo))
+ Dim PdfList As New List(Of String)
+ If Not Multiparte Then
+ 'puede tronar si el archivo es multiparte
+ While reader.MoveToNextEntry()
+ If Not reader.Entry.IsDirectory Then
+ 'Si es un archivo XML, lo leo y lo guardo
+
+ Dim nombreArchivo As String = ""
+
+ If reader.Entry.FilePath.Contains("/") Then
+ nombreArchivo = reader.Entry.FilePath.Substring(reader.Entry.FilePath.LastIndexOf("/") + 1)
+ Else
+ nombreArchivo = reader.Entry.FilePath
+ End If
+
+ If Path.GetExtension(reader.Entry.FilePath.ToUpper()) = ".XML" Then
+ reader.WriteEntryToDirectory(String.Format("{0}Temp\Facturas", UsuarioActual.Empresa.Ruta), ExtractOptions.None Or ExtractOptions.Overwrite)
+ ListXML.Add(String.Format("{0}Temp\Facturas\{1}", UsuarioActual.Empresa.Ruta, nombreArchivo))
+ End If
+ If Path.GetExtension(reader.Entry.FilePath.ToUpper()) = ".PDF" Then
+ 'este sale de un error al leer el pdf, como lo estoy recorriendo de una vez lo guardo y lo vinculo, si la coincidencia es por nombre o número de folio
+ 'string RFCEmisor = BuscaFactura(System.IO.Path.GetFileNameWithoutExtension(reader.Entry.FilePath).ToUpper(), Arreglo, True);
+ 'if (!string.IsNullOrEmpty(RFCEmisor))
+ ' {
+ 'If Not Directory.Exists(String.Format("{0}{1}", Temporal, RFCEmisor)) Then Directory.CreateDirectory(String.Format("{0}{1}", Temporal, RFCEmisor))
+
+ 'reader.WriteEntryToDirectory(String.Format("{0}{1}", Temporal, ""), ExtractOptions.None Or ExtractOptions.Overwrite)
+ reader.WriteEntryToDirectory(String.Format("{0}{1}", String.Format("{0}Temp\Facturas", UsuarioActual.Empresa.Ruta), ""), ExtractOptions.None Or ExtractOptions.Overwrite)
+ ListPDF.Add(String.Format("{0}Temp\Facturas\{1}", UsuarioActual.Empresa.Ruta, nombreArchivo))
+
+ End If
End If
- If Path.GetExtension(reader.Entry.FilePath.ToUpper()) = ".PDF" Then
- 'este sale de un error al leer el pdf, como lo estoy recorriendo de una vez lo guardo y lo vinculo, si la coincidencia es por nombre o número de folio
- 'string RFCEmisor = BuscaFactura(System.IO.Path.GetFileNameWithoutExtension(reader.Entry.FilePath).ToUpper(), Arreglo, True);
- 'if (!string.IsNullOrEmpty(RFCEmisor))
- ' {
- 'If Not Directory.Exists(String.Format("{0}{1}", Temporal, RFCEmisor)) Then Directory.CreateDirectory(String.Format("{0}{1}", Temporal, RFCEmisor))
+ End While
+ End If
+ Catch ex As Exception
+ GuardaLogAD("'ERROR :" & ex.Message, eFacturasLog)
+ End Try
+ End Using
+ Catch ex As Exception
+ If UsuarioActual.CveRol = 1 Then
+ Alert($"Error al procesar archivo: {FiInfo.FullName} Error:{ex.Message} stackTrace: {ex.StackTrace}", TipoMensaje.MsgAdvertencia)
+ GuardaLogAD($"Error al procesar archivo: {FiInfo.FullName} Error:{ex.Message} stackTrace: {ex.StackTrace}")
+ Else
+ Alert("Se presento un error al procesar las solcictudes. comuniquese con soporte tecnico.", TipoMensaje.MsgAdvertencia)
+ GuardaLogAD($"Error al procesar archivo: {FiInfo.FullName} Error:{ex.Message} stackTrace: {ex.StackTrace}")
+ End If
+
+ Exit Sub
+ End Try
+
- 'reader.WriteEntryToDirectory(String.Format("{0}{1}", Temporal, ""), ExtractOptions.None Or ExtractOptions.Overwrite)
- reader.WriteEntryToDirectory(String.Format("{0}{1}", String.Format("{0}Temp\Facturas", UsuarioActual.Empresa.Ruta), ""), ExtractOptions.None Or ExtractOptions.Overwrite)
- ListPDF.Add(String.Format("{0}Temp\Facturas\{1}", UsuarioActual.Empresa.Ruta, nombreArchivo))
- End If
- End If
- End While
- End If
- Catch ex As Exception
- GuardaLogAD("'ERROR :" & ex.Message, eFacturasLog)
- End Try
- End Using
Next
@@ -1726,6 +1741,7 @@ Partial Class Compras_eFacturas
For Each s As String In ListComprimidos
Try
File.Delete(s)
+ GuardaLogAD("")
Catch ex As Exception
End Try
Next
@@ -2853,11 +2869,14 @@ Partial Class Compras_eFacturas
Dim TipoMensaje As ModExtensiones.TipoMensaje = ModExtensiones.TipoMensaje.MsgInformacion
- Dim ListComprimidos As New List(Of String)
- Dim ListXML As New List(Of String)
- Dim ListPDF As New List(Of String)
+
For Each GvRow As GridViewRow In GVSolicitudesPendientes.Rows
+
+ Dim ListComprimidos As New List(Of String)
+ Dim ListXML As New List(Of String)
+ Dim ListPDF As New List(Of String)
+
Dim CveSolicitudActual As Integer = GvRow.DataKey("CveSolicitud").ToEntero()
Dim idSolicitud As String = GvRow.DataKey("idSolicitud").Trim()
Dim CveTipoSolicitud As Integer = GvRow.DataKey("CveTipoSolicitud").ToEntero()
@@ -2872,6 +2891,7 @@ Partial Class Compras_eFacturas
Dim ResultadoSolicitudOK As Boolean = False
Dim api As New GeneralesAPIeFacturas(If(EsProduccion, "http://localhost:4001/", "http://localhost:60281/"))
+
Dim Verificar As Boolean = True
If idSolicitud.Length = 0 Then
@@ -2938,6 +2958,7 @@ Partial Class Compras_eFacturas
If File.Exists(destFile) Then
ListComprimidos.Add(destFile)
+ 'GuardaLogAD($"eFacturas Solicitudes SAT Archivo copiado a {destFile}")
Else
sbArchivosFaltantes.AppendFormat("
Folio: {0} Archivo: {1}", Folio, fileName)
End If
diff --git a/Empresas/141/Formatos/Cotizacion.rdlc b/Empresas/141/Formatos/Cotizacion.rdlc
index cfa5d036f..a3d62ba51 100644
--- a/Empresas/141/Formatos/Cotizacion.rdlc
+++ b/Empresas/141/Formatos/Cotizacion.rdlc
@@ -3533,6 +3533,8 @@
String
+ true
+ true
ReportParameter1
diff --git a/Empresas/186/Formatos/Salidas.rdlc b/Empresas/186/Formatos/Salidas.rdlc
index f81d514f8..4caa30b19 100644
--- a/Empresas/186/Formatos/Salidas.rdlc
+++ b/Empresas/186/Formatos/Salidas.rdlc
@@ -85,7 +85,10 @@
2.06786cm
- 9.78709cm
+ 7.28712cm
+
+
+ 2.5cm
1.78414cm
@@ -282,6 +285,52 @@
+
+
+
+ true
+ true
+
+
+
+
+ Serie
+
+
+
+
+
+
+ Textbox3
+
+
+
+ Black
+
+ 1pt
+
+
+ Black
+
+ 1pt
+
+ #9cc3e5
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
@@ -504,6 +553,34 @@
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!SerieLote.Value
+
+
+
+
+
+
+ SerieLote
+
+
+
+
@@ -577,6 +654,7 @@
+
@@ -593,7 +671,7 @@
0.17639cm
0.07701cm
0.83488cm
- 19.71019cm
+ 19.71022cm
@@ -604,10 +682,10 @@
0.58708in