diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index a2f021adc..0f3579548 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -2225,6 +2225,7 @@ Namespace Modelos
Select Case ConceptoContable
Case 1 'Cliente
If Not ObjFactura.TipoDocto.Contiene("Egs", "Rem", "RNC") Then
+ If ObjFactura.CveMoneda > 1 Then ConceptoContable = 291
importeMovimiento = (ObjFactura.Total - TotalOtrosConceptos) * ValorMultiplicador
importeMX = importeMovimiento * tipoCambio * Multiplicador
FechaMovimiento = ObjFactura.FechaPago
@@ -3801,13 +3802,19 @@ Namespace Modelos
If factura.TipoDocto = "Rem" AndAlso factura.ServicioDomicilio Then
Dim CveMovimientoSalida As Integer = GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenServicioDomicilio, 8, factura.CveMoneda, factura.CveVenta, "Modelos/SD1")
If CveMovimientoSalida > 0 Then
-
If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD1", CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then
OcurrioError = True
End If
Else
OcurrioError = True
End If
+
+ If Not OcurrioError Then
+ If Not ObjInventario.ActualizarEsDevolucionVenta(factura.CveVenta, 2) Then
+ OcurrioError = True
+ End If
+ End If
+
End If
End If
@@ -4081,65 +4088,79 @@ Namespace Modelos
OcurrioError = True
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario. Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else
- Dim Mensaje As String = ""
- Dim i As Integer = 0
- Dim Cantidad As Double
- Dim CveUnidad As Integer
- Dim CveProducto As Integer
- Dim Existencia As Double
- 'Dim Pu As Double
- 'DtInv.Clone()
+ If CveMovimientoRelacionado > 0 Then
+ If ObjInventario.GetMovimientosDetalle(CveMovimientoRelacionado, UsuarioActual.CveEmpresa) Then
- Dim DtEquivalencias As DataTable
- For Each Dr As DataRow In DtInventario.Rows
- CveProducto = Dr("CvePS").ToString.ToEntero
- CveUnidad = Dr("CveUM").ToString.ToEntero
- Cantidad = Dr("Cantidad").ToString.ToDouble
+ For Each Dr As DataRow In ObjInventario.DtResultados.Rows
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
+ OcurrioError = True
+ ErrorList.Add("Ocurrió un Error al guardar los movimientos de entrada")
+ Exit For
+ End If
+ Next
- If Dr("CveTipoInvPS").ToString.ToEntero = 5 And Dr("Serie").ToString = "" Then
- OcurrioError = True
- ErrorList.Add("Se deben especificar las Series de los productos de almacén")
- Exit For
End If
+ Else
+ Dim Mensaje As String = ""
+ Dim i As Integer = 0
+ Dim Cantidad As Double
+ Dim CveUnidad As Integer
+ Dim CveProducto As Integer
+ Dim Existencia As Double
+ 'Dim Pu As Double
+ 'DtInv.Clone()
- If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso factura.TipoDocto.Contiene("Rem", "Ing") Then
- Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=factura.CveSubProyecto, CveVendedor:=factura.CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
- If Existencia < Cantidad Then
+ Dim DtEquivalencias As DataTable
+ For Each Dr As DataRow In DtInventario.Rows
+ CveProducto = Dr("CvePS").ToString.ToEntero
+ CveUnidad = Dr("CveUM").ToString.ToEntero
+ Cantidad = Dr("Cantidad").ToString.ToDouble
+
+ If Dr("CveTipoInvPS").ToString.ToEntero = 5 And Dr("Serie").ToString = "" Then
OcurrioError = True
- ErrorList.Add($"No cuenta con la cantidad suficiente en inventario del producto {Dr("CodigoPS")} .Cuenta con {Existencia.FormatoNumero(2)}.")
+ ErrorList.Add("Se deben especificar las Series de los productos de almacén")
Exit For
End If
- End If
- If UsuarioActual.CveEmpresa = 1 Then
- DtEquivalencias = New DataTable
- DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
- Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero
- Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'")
-
- 'SI LA UNIDAD ACTUAL NO ES LA BASE SACA PROPORCION (EQUIVALENTE)
- If CveUnidadBase <> CveUnidad Then
- ' LO QUE PUSE LO QUE VALE UNIDAD BASE LO QUE VALE UNIDAD SELECCIONADA
- Cantidad = Dr("Cantidad").ToString.ToDouble * drUMBase("Cantidad").ToString.ToDouble / DtEquivalencias.FiltraParametros(String.Format("CveUM = {0}", CveUnidad)).Rows(0)("Cantidad").ToString.ToDouble
- CveUnidad = CveUnidadBase
+ If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso factura.TipoDocto.Contiene("Rem", "Ing") Then
+ Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=factura.CveSubProyecto, CveVendedor:=factura.CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
+ If Existencia < Cantidad Then
+ OcurrioError = True
+ ErrorList.Add($"No cuenta con la cantidad suficiente en inventario del producto {Dr("CodigoPS")} .Cuenta con {Existencia.FormatoNumero(2)}.")
+ Exit For
+ End If
End If
- End If
- If CveProducto > 0 Then
- If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, 0, CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
+ If UsuarioActual.CveEmpresa = 1 Then
+ DtEquivalencias = New DataTable
+ DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
+ Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero
+ Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'")
+
+ 'SI LA UNIDAD ACTUAL NO ES LA BASE SACA PROPORCION (EQUIVALENTE)
+ If CveUnidadBase <> CveUnidad Then
+ ' LO QUE PUSE LO QUE VALE UNIDAD BASE LO QUE VALE UNIDAD SELECCIONADA
+ Cantidad = Dr("Cantidad").ToString.ToDouble * drUMBase("Cantidad").ToString.ToDouble / DtEquivalencias.FiltraParametros(String.Format("CveUM = {0}", CveUnidad)).Rows(0)("Cantidad").ToString.ToDouble
+ CveUnidad = CveUnidadBase
+ End If
+ End If
+
+ If CveProducto > 0 Then
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, 0, CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
+ OcurrioError = True
+ ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario. ")
+ Exit For
+ End If
+ Else
OcurrioError = True
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario. ")
Exit For
End If
- Else
- OcurrioError = True
- ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario. ")
- Exit For
- End If
- i = i + 1
- Next
+ i = i + 1
+ Next
+ End If
'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN
If MovimientoPrePoliza AndAlso Not OcurrioError Then
diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb
index 9a5f4a0c9..da8df25b1 100644
--- a/App_Code/Timbrado.vb
+++ b/App_Code/Timbrado.vb
@@ -2935,8 +2935,10 @@ Public Class Timbrado
comprobante.SubTotal = ObjCFDITimbre.Comprobante.Subtotal
If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then
- comprobante.DescuentoSpecified = True
- comprobante.Descuento = ObjCFDITimbre.Comprobante.Descuentos
+ If ObjCFDITimbre.Comprobante.Descuentos > 0 Then
+ comprobante.DescuentoSpecified = True
+ comprobante.Descuento = ObjCFDITimbre.Comprobante.Descuentos
+ End If
End If
comprobante.Moneda = ObjCFDITimbre.Comprobante.Moneda
comprobante.TipoCambio = ObjCFDITimbre.Comprobante.TipoCambio.ToDecimal
@@ -3876,23 +3878,21 @@ Public Class Timbrado
Else
- Dim Resultados = Newtonsoft.Json.Linq.JArray.Parse(resultadoTimbre.Detalle)
-
- If Resultados.Count > 0 Then
-
- If resultadoTimbre.Descripcion.Contains("RFC del receptor no existe") Then
-
- Retorno = $"El RFC { Resultados(0)("Value").ToString() } no existe en las bases de datos publicadas por el SAT, corrobore este dato con su cliente"
- MensajeErrorCFDI = $"El RFC { Resultados(0)("Value").ToString() } no existe en las bases de datos publicadas por el SAT, corrobore este dato con su cliente"
+ If String.IsNullOrEmpty(resultadoTimbre.Detalle) Then
+ Dim Resultados = Newtonsoft.Json.Linq.JArray.Parse(resultadoTimbre.Detalle)
+ If Resultados.Count > 0 Then
+ If resultadoTimbre.Descripcion.Contains("RFC del receptor no existe") Then
+ Retorno = $"El RFC { Resultados(0)("Value").ToString() } no existe en las bases de datos publicadas por el SAT, corrobore este dato con su cliente"
+ MensajeErrorCFDI = $"El RFC { Resultados(0)("Value").ToString() } no existe en las bases de datos publicadas por el SAT, corrobore este dato con su cliente"
+ Else
+ Retorno = Resultados(0)("Value").ToString()
+ MensajeErrorCFDI = Resultados(0)("Value").ToString()
+ End If
Else
-
- Retorno = Resultados(0)("Value").ToString()
- MensajeErrorCFDI = Resultados(0)("Value").ToString()
-
+ Retorno = resultadoTimbre.Detalle
+ MensajeErrorCFDI = resultadoTimbre.Detalle
End If
-
-
Else
Retorno = resultadoTimbre.Detalle
MensajeErrorCFDI = resultadoTimbre.Detalle
diff --git a/App_Code/Usuario.vb b/App_Code/Usuario.vb
index 6ae6e14d1..9dc49a3c8 100644
--- a/App_Code/Usuario.vb
+++ b/App_Code/Usuario.vb
@@ -62,7 +62,9 @@ Public Class Usuario
Public Property isLoginseted As Boolean = False
- Public Property SesionBloqueada As Boolean = False
+ Public Property SesionBloqueada As Boolean = False
+ Public Property ErrorDesbloqueo As Boolean = False
+ Public Property MsgErrorDesbloqueo As String = ""
Public ReadOnly Property FechaActualCliente As DateTime
Get
diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx
index cf37bb840..a47aae2e8 100644
--- a/Ashx/SIGFacturacion.ashx
+++ b/Ashx/SIGFacturacion.ashx
@@ -409,7 +409,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
'VALIDA PROMOCIONES Y EXISTENCIAS
Dim ObjVentas As New ClsVentas
- If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, ObjFactura.CveCliente, ObjFactura.CveVendedor, UsuarioActual.CveEmpresa) Then
+ If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, ObjFactura.CveCliente, ObjFactura.CveVendedor, 1, UsuarioActual.CveEmpresa) Then
ObjFactura.DtPromociones = ObjVentas.DtResultados.Copy()
End If
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 40a1431b5..7a06ef3a6 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -6960,8 +6960,31 @@ Partial Class Compras_Compras
Dim DTDistinct = DT.Copy
If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
+
+ For Each drowdis As DataRow In DTDistinct.Rows
+ If drowdis("CveTipoGasto").ToString = "" Then
+ drowdis("CveTipoGasto") = 0
+ End If
+ If drowdis("TipoGasto").ToString.Trim = "" Then
+ drowdis("TipoGasto") = "ND"
+
+ End If
+ Next
+
DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF, 0) <> 2", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"})
Else
+
+ For Each drowdis As DataRow In DTDistinct.Rows
+ If drowdis("CveTipoGasto").ToString = "" Then
+ drowdis("CveTipoGasto") = 0
+ End If
+ If drowdis("TipoGasto").ToString.Trim = "" Then
+ drowdis("TipoGasto") = "ND"
+
+ End If
+ Next
+ DTDistinct.AcceptChanges()
+
DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"})
End If
'RMF, si es concepto relacionado a flete o importacion, no debe de afectar al gasto
@@ -9802,7 +9825,7 @@ Partial Class Compras_Compras
Dim ObjInventario As New ClsInventarios(ObjCompra.IniciaTransacSQL)
Dim ObjContabilidad As New ClsContabilidad(ObjCompra.IniciaTransacSQL)
Dim ObjAF As New ClsAF(ObjCompra.IniciaTransacSQL)
- Dim ObjContaAC As ClsContPAQi = New ClsContPAQi(UsuarioActual.Empresa)
+ Dim ObjContaAC As ClsContPAQi '= New ClsContPAQi(UsuarioActual.Empresa)
Dim Retorno As Boolean = True
Dim CveEstatusFactura As Integer = HdnCveEstatusFactura.Value.ToEntero
@@ -17816,6 +17839,8 @@ Partial Class Compras_Compras
If UsuarioActual.Empresa.Tipo_CentroCosto <> 1 And UsuarioActual.Empresa.Tipo_CentroCosto <> 2 Then
DdlProyecto.SelectedValueExist(GvRow.DataKey("CveProyecto"))
+ Else
+ DdlProyecto.SelectedValueExist("-1")
End If
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 74a48f0ea..6bae061c3 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -4575,6 +4575,7 @@ Partial Class PopUpVerFactura
Dim ModeloAuto As String = RowAjuste("ModeloAuto").ToString
Dim MarcaAuto As String = RowAjuste("MarcaAuto").ToString
+ Dim CodigoTD As String = RowAjuste("CodigoTD").ToString
Dim MarcaPS As String = ""
Dim CveMarca As Integer = -1
@@ -4687,6 +4688,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Anio", Año))
params.Add(New ReportParameter("Comprobante", Comprobante))
+ params.Add(New ReportParameter("CodigoTD", CodigoTD))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb
index 8e2fedf24..f43caaa7a 100644
--- a/Compras/ReembolsosComprobaciones.aspx.vb
+++ b/Compras/ReembolsosComprobaciones.aspx.vb
@@ -712,7 +712,7 @@ Partial Class Compras_ReembolsosComprobaciones
If Not ChkReembolsarSinBancos.Checked AndAlso (Not HdnCheque.Value.ToEntero > 0 Or Not UsuarioActual.CveEmpresa.Contiene(119)) Then
'Si es caja chica metemos el concepto 30, si es funcionario metemos 29
- If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, ImporteMovto, Referencia, If(CveCajaChica > 0, 30, 29), ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEPago, CveIEDevolucion:=If(CveCajaChica > 0, DDlCheques.SelectedValue.ToEntero, -1), CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovto), ImporteMX:=ImporteMovto * tipoCambio, CveCuenta:=CveCuentaPersonal, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, Contabilizable:=If(CveCajaChica > 0 Or CvePersonal > 0, Not UsaSimplificacionCajaChica, True)) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, ImporteMovto, Referencia, If(CveCajaChica > 0, 30, 29), ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEPago, CveIEDevolucion:=If(CveCajaChica > 0, If(DDlCheques.SelectedValue.ToEntero = -1, CveIECajaChica, DDlCheques.SelectedValue.ToEntero), -1), CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovto), ImporteMX:=ImporteMovto * tipoCambio, CveCuenta:=CveCuentaPersonal, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, Contabilizable:=If(CveCajaChica > 0 Or CvePersonal > 0, Not UsaSimplificacionCajaChica, True)) Then
MsgError = "Detalle"
End If
End If
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb
index a358c4250..617ce1010 100644
--- a/Contabilidad/RegPrePolizaS.aspx.vb
+++ b/Contabilidad/RegPrePolizaS.aspx.vb
@@ -197,7 +197,7 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
- TipoPlantilla = 0
+ TipoPlantilla = -1
If IfNull(Request("Tipo"), "").ToString = "Ing" Then
TipoPlantilla = 1
LblEncabezado.Text = "Otros Ingresos"
diff --git a/Contratos/ContratoAvance.aspx b/Contratos/ContratoAvance.aspx
index fdccdf370..2a42ad29a 100644
--- a/Contratos/ContratoAvance.aspx
+++ b/Contratos/ContratoAvance.aspx
@@ -8,8 +8,8 @@
width:100%;
}
.txtimporte{
- background: transparent;
- border: none;
+ /*background: transparent;*/
+ /*border: none;*/
}
.txtcant,.txtimporte,
@@ -183,14 +183,22 @@
-
+
-
+
+
+
+
+
+
+
+
+
@@ -254,115 +262,6 @@
-<%--
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-