diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb
index b1aa67145..2aad60555 100644
--- a/App_Code/CFDITimbre.vb
+++ b/App_Code/CFDITimbre.vb
@@ -842,6 +842,7 @@ End Class
Public Class CFDICartaPorte
Public Property TranspInternac As String = "No"
Public Property EntradaSalidaMercancia As String = ""
+ Public Property PaisOrigenDestino As String = ""
Public Property ViaEntradaSalida As String = ""
Public Property RegimenAduanero As String = ""
Public Property RegistroISTMO As String = ""
diff --git a/App_Code/CalendarEvent.vb b/App_Code/CalendarEvent.vb
index f5f94aaee..db77a2884 100644
--- a/App_Code/CalendarEvent.vb
+++ b/App_Code/CalendarEvent.vb
@@ -7,6 +7,7 @@ Public Class CalendarEvent
Public Property description As String
Public Property start As String
Public Property [end] As String
+ Public Property FechaFinal As String
Public Property allDay As Boolean
Public Property CveEventoEstatus As Integer
Public Property cveagendatipo As String
@@ -36,6 +37,7 @@ Public Class CalendarEvent
Public Property CvePersonal As Integer
Public Property CvePersonal2 As Integer
Public Property CveCliente As Integer
+ Public Property NombreComercial As String
Public Property CveProveedor As Integer
Public Property CveOS As Integer
Public Property CveOSDetalle As Integer
diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb
index 9e1e30aa8..40d578ba6 100644
--- a/App_Code/ClsBancos.vb
+++ b/App_Code/ClsBancos.vb
@@ -133,6 +133,7 @@ Public Class ClsBancos
Public Property UsaTarjeta As Boolean
Public Property TieneTerminal As Boolean
Public Property CveCuentaPadre As Integer
+ Public Property CveSubProyecto As Integer
#End Region
@@ -418,10 +419,10 @@ Public Class ClsBancos
Me.UsaTarjeta = If(Data.Rows(0)("UsaTarjeta").ToString = "True", True, False)
Me.TieneTerminal = If(Data.Rows(0)("TieneTerminal").ToString = "True", True, False)
Me.CveCuentaPadre = Data.Rows(0)("CveCuentaPadre").ToString.ToEntero
+ Me.CveSubProyecto = Data.Rows(0)("CveSubProyecto").ToString.ToEntero
End If
-
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar las Cuentas de los Bancos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
@@ -452,7 +453,8 @@ Public Class ClsBancos
Public Function AddBancosCuentas(CveBanco As Integer, CveTipoCuenta As Integer, NumCuenta As String, CLABE As String, CveMoneda As Integer, DiaCorte As Integer, FInicial As Integer, FActual As Integer, FFinal As Integer,
LimiteCredito As Double, FormatoCheque As String, CveUsuario As Integer, CveEmpresa As Integer, ConvenioPagoElectronico As String,
- UsaLayout As Boolean, UsaTarjeta As Boolean, Optional SaldoInicial As Double = 0, Optional UsaLayoutGrupos As Boolean = False, Optional TieneTerminal As Boolean = False, Optional CveCuentaPadre As Integer = Nothing) As Boolean
+ UsaLayout As Boolean, UsaTarjeta As Boolean, Optional SaldoInicial As Double = 0, Optional UsaLayoutGrupos As Boolean = False, Optional TieneTerminal As Boolean = False,
+ Optional CveCuentaPadre As Integer = Nothing, Optional CveSubProyecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Banc_BancosCuentasAdd")
@@ -479,7 +481,7 @@ Public Class ClsBancos
.Add("@UsaLayoutGrupos", SqlDbType.Bit).Value = UsaLayoutGrupos
.Add("@TieneTerminal", SqlDbType.Bit).Value = TieneTerminal
.Add("@CveCuentaPadre", SqlDbType.Int).Value = CveCuentaPadre
-
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
End With
@@ -502,7 +504,8 @@ Public Class ClsBancos
Public Function UpdateBancosCuentas(CveBanco As Integer, CveTipoCuenta As Integer, NumCuenta As String, CLABE As String, CveMoneda As Integer, DiaCorte As Integer, FInicial As Integer, FActual As Integer, FFinal As Integer,
LimiteCredito As Double, FormatoCheque As String, Estatus As Boolean, CveCuenta As Integer, ConvenioPagoElectronico As String,
- UsaLayout As Boolean, UsaTarjeta As Boolean, Optional UsaLayoutGrupos As Boolean = False, Optional TieneTerminal As Boolean = False, Optional CveCuentaPadre As Integer = Nothing) As Boolean
+ UsaLayout As Boolean, UsaTarjeta As Boolean, Optional UsaLayoutGrupos As Boolean = False, Optional TieneTerminal As Boolean = False,
+ Optional CveCuentaPadre As Integer = Nothing, Optional CveSubProyecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Banc_BancosCuentasUpdate")
@@ -527,7 +530,7 @@ Public Class ClsBancos
.Add("@UsaLayoutGrupos", SqlDbType.Bit).Value = UsaLayoutGrupos
.Add("@TieneTerminal", SqlDbType.Bit).Value = TieneTerminal
.Add("@CveCuentaPadre", SqlDbType.Int).Value = CveCuentaPadre
-
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
End With
@@ -1099,7 +1102,7 @@ Public Class ClsBancos
Dim Timbrado As New Timbrado
Dim CFDIVersion As String = "4.0"
- If GetComplementoPagosImpuestos(CveIE, UsuarioActual.CveEmpresa) Then
+ If GetComplementoPagosImpuestos(CveIE, UsuarioActual.CveEmpresa, CvePrePoliza:=CvePrePoliza) Then
dttpagosimpuestos = DtResultados
End If
@@ -1386,7 +1389,7 @@ Public Class ClsBancos
Return Retorno
End Function
- Public Function GetComplementoPagosImpuestos(CveIE As Integer, CveEmpresa As Integer) As Boolean
+ Public Function GetComplementoPagosImpuestos(CveIE As Integer, CveEmpresa As Integer, Optional CvePrePoliza As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Banc_ComplementoPagoImpuestosGet")
@@ -1394,6 +1397,7 @@ Public Class ClsBancos
With SqlAdapter.SelectCommand.Parameters
.Add("@CveIE", SqlDbType.Int).Value = CveIE
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
End With
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb
index fb2c585bf..5c81d9f0c 100644
--- a/App_Code/ClsClasificaciones.vb
+++ b/App_Code/ClsClasificaciones.vb
@@ -421,6 +421,59 @@ Public Class ClsClasificaciones
Return Retorno
End Function
+ Public Function UpdateClasificacionFranquicia(CveClasificacion As Integer, Clasificacion As String, CveEmpresaActual As Integer, CveEmpresaFranquicia As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Vta_ClasificacionFranquiciaUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@Clasificacion", SqlDbType.VarChar).Value = Clasificacion
+ .Add("@CveEmpresaActual", SqlDbType.Int).Value = CveEmpresaActual
+ .Add("@CveEmpresaFranquicia", SqlDbType.Int).Value = CveEmpresaFranquicia
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("La clasificación no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al intentar actualizar los datos de la clasificación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al intentar Actualizar los datos de la clasificación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+ End Function
+
+ Public Function RemoveClasificacionFranquicia(CveClasificacion As Integer, CveEmpresaActual As Integer, CveEmpresaFranquicia As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Vta_ClasificacionFranquiciaRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@CveEmpresaActual", SqlDbType.Int).Value = CveEmpresaActual
+ .Add("@CveEmpresaFranquicia", SqlDbType.Int).Value = CveEmpresaFranquicia
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("La clasificación no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al intentar actualizar los datos de la clasificación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al intentar Actualizar los datos de la clasificación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+ End Function
+
'Public Function UpdateClasificacionCunetas(CveClasificacion As Integer, CveCuentaContableIngreso As Integer, CveCuentaContableGasto As Integer, CveEmpresa As Object) As Boolean
'End Function
diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb
index 5764b4f20..0ae7b54da 100644
--- a/App_Code/ClsClientes.vb
+++ b/App_Code/ClsClientes.vb
@@ -159,6 +159,7 @@ Public Class ClsClientes
Public Property RepresentanteLegal As String
Public Property CveAlmacenAsignado As Integer = -1
Public Property CveAlmacenAlterno As Integer = -1
+ Public Property CveAlmacenConsignacion As Integer = -1
Public Property UsaProductoAlterno As Boolean = False
@@ -409,6 +410,8 @@ Public Class ClsClientes
_RepresentanteLegal = Data(0)("RepresentanteLegal").ToString
_CveAlmacenAsignado = Data(0)("CveAlmacenAsignado").ToString.ToEntero
_CveAlmacenAlterno = Data(0)("CveAlmacenAlterno").ToString.ToEntero
+ _CveAlmacenConsignacion = Data(0)("CveAlmacenConsignacion").ToString.ToEntero
+
_UsaProductoAlterno = CBool(Data(0)("UsaProductoAlterno"))
End If
@@ -527,7 +530,7 @@ Public Class ClsClientes
Optional CveMotivoTraslado As Integer = 0, Optional NumRegIdTrib As String = "", Optional ComExtEstado As String = "-1", Optional ComExtMunicipio As String = "-1", Optional ComExtColonia As String = "-1", Optional RequiereOC As Boolean = False,
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0,
Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False,
- Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False) As Boolean
+ Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False) As Boolean
Dim Retorno As Boolean = False
@@ -657,6 +660,7 @@ Public Class ClsClientes
.Add("@Genero", SqlDbType.Bit).Value = Genero
.Add("@CveAlmacenAsignado", SqlDbType.Int).Value = CveAlmacenAsignado
.Add("@CveAlmacenAlterno", SqlDbType.Int).Value = CveAlmacenAlterno
+ .Add("@CveAlmacenConsignacion", SqlDbType.Int).Value = CveAlmacenConsignacion
.Add("@UsaProductoAlterno", SqlDbType.Bit).Value = UsaProductoAlterno
End With
Try
@@ -703,7 +707,7 @@ Public Class ClsClientes
Optional ApellidoPaternoPF As String = "-1", Optional ApellidoMaternoPF As String = "-1", Optional NombresPF As String = "-1", Optional RequiereOC As Boolean = False,
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1",
Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional NoDesglosaIVA As Boolean = False, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False,
- Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False) As Boolean
+ Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional UsaProductoAlterno As Boolean = False) As Boolean
Dim Retorno As Boolean = False
@@ -842,6 +846,7 @@ Public Class ClsClientes
.Add("@ComExtCP", SqlDbType.VarChar).Value = ComExtCP
.Add("@Genero", SqlDbType.Bit).Value = Genero
.Add("@CveAlmacenAsignado", SqlDbType.Int).Value = CveAlmacenAsignado
+ .Add("@CveAlmacenConsignacion", SqlDbType.Int).Value = CveAlmacenConsignacion
.Add("@CveAlmacenAlterno", SqlDbType.Int).Value = CveAlmacenAlterno
.Add("@UsaProductoAlterno", SqlDbType.Bit).Value = UsaProductoAlterno
@@ -984,9 +989,12 @@ Public Class ClsClientes
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_SucursalClienteGet")
- SqlAdapter.SelectCommand.Parameters.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- SqlAdapter.SelectCommand.Parameters.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
- SqlAdapter.SelectCommand.Parameters.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
Try
SqlAdapter.Fill(Data)
Retorno = True
@@ -1001,10 +1009,13 @@ Public Class ClsClientes
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ClientesSucursalesGet")
- SqlAdapter.SelectCommand.Parameters.Add("@RFC", SqlDbType.VarChar).Value = RFC
- SqlAdapter.SelectCommand.Parameters.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- SqlAdapter.SelectCommand.Parameters.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- SqlAdapter.SelectCommand.Parameters.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@RFC", SqlDbType.VarChar).Value = RFC
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
+ End With
+
Try
SqlAdapter.Fill(Data)
Retorno = True
@@ -1052,7 +1063,7 @@ Public Class ClsClientes
'End Function
Public Function AddSucursal(CveCliente As Integer, Sucursal As String, CveUsuario As Integer, Ciudad As String, Colonia As String, CP As String, Direccion As String, Estado As String, Localidad As String, Pais As String, NoExt As String, NoInt As String, Telefono As String, Correo As String, CorreoCotizacion As String, Contacto As String, CveVendedor As Integer, NumCtaPago As String, CveMetodoPago As Integer,
LimiteCredito As Decimal, CveResponsableSucursal As Integer, CveUsoCFDI As Integer, CveFormaPago33 As Integer, CveMetodoPago33 As Integer, Optional LT As String = "0", Optional LG As String = "0", Optional RFC As String = "",
- Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1) As Boolean
+ Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_SucursalClienteAdd")
@@ -1088,6 +1099,7 @@ Public Class ClsClientes
.Add("@RFC", SqlDbType.VarChar).Value = RFC
.Add("@CveAlmacenAsignado", SqlDbType.Int).Value = CveAlmacenAsignado
+ .Add("@CveAlmacenConsignacion", SqlDbType.Int).Value = CveAlmacenConsignacion
.Add("@CveAlmacenAlterno", SqlDbType.Int).Value = CveAlmacenAlterno
End With
@@ -1109,7 +1121,7 @@ Public Class ClsClientes
End Function
Public Function UpdateSucursal(Sucursal As String, Estatus As Boolean, CveCliente As Integer, CveClienteSucursal As Integer, Ciudad As String, Colonia As String, CP As String, Direccion As String, Estado As String, Localidad As String, Pais As String, NoExt As String, NoInt As String, Telefono As String, Correo As String, CorreoCotizacion As String, Contacto As String, CveVendedor As Integer, NumCtaPago As String, CveMetodoPago As Integer,
LimiteCredito As Decimal, CveResponsableSucursal As Integer, CveUsoCFDI33 As Integer, CveFormaPago33 As Integer, CveMetodoPago33 As Integer, Optional LT As String = "0", Optional LG As String = "0", Optional RFC As String = "-1",
- Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1) As Boolean
+ Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_SucursalClienteUpdate")
@@ -1142,12 +1154,12 @@ Public Class ClsClientes
.Add("@CveFormaPago33", SqlDbType.Int).Value = CveFormaPago33
.Add("@CveMetodoPago33", SqlDbType.Int).Value = CveMetodoPago33
-
.Add("@LT", SqlDbType.VarChar).Value = LT
.Add("@LG", SqlDbType.VarChar).Value = LG
.Add("@RFC", SqlDbType.VarChar).Value = RFC
.Add("@CveAlmacenAsignado", SqlDbType.Int).Value = CveAlmacenAsignado
+ .Add("@CveAlmacenConsignacion", SqlDbType.Int).Value = CveAlmacenConsignacion
.Add("@CveAlmacenAlterno", SqlDbType.Int).Value = CveAlmacenAlterno
End With
diff --git a/App_Code/ClsCompProveedores.vb b/App_Code/ClsCompProveedores.vb
index d30f714a2..23044581c 100644
--- a/App_Code/ClsCompProveedores.vb
+++ b/App_Code/ClsCompProveedores.vb
@@ -524,6 +524,29 @@ Public Class ClsCompProveedores
Return Retorno
End Function
+ Public Function UpdateProveedorLimiteCredito(CveProveedor As Integer, LimiteCredito As Decimal, PlazoPago As Integer, UsaLimiteCredito As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Comp_ProveedorLimiteCreditoUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ .Add("@LimiteCredito", SqlDbType.Money).Value = LimiteCredito
+ .Add("@PlazoPago", SqlDbType.Int).Value = PlazoPago
+ .Add("@UsaLimiteCredito", SqlDbType.Bit).Value = UsaLimiteCredito
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al Actualizar el limite de crédito del Proveedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
Public Function UpdateProveedorPagoElectronico(EstatusPagoElectronico As Boolean, CveUsuario As Integer, CveProveedor As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_ProveedorUpdatePagoElectronico")
diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb
index 83ee9fe20..4f4417e6d 100644
--- a/App_Code/ClsCompras.vb
+++ b/App_Code/ClsCompras.vb
@@ -1792,7 +1792,7 @@ Public Class ClsCompras
StrSQL.Append(" INSERT INTO Comp_Facturas (Serie, Folio, FechaFactura, NombreProveedor, RFCDe, Total, UUID, RFCPara, XML, PDF, FueValidado, CveEmpresa, TipoFactura,Version, TipoComprobante) ")
StrSQL.Append(" VALUES (@Serie, @Folio, @FechaFactura, @NombreProveedor, @RFCDe, @Total, @UUID, @RFCPara, @XML, @PDF, @FueValidado, @CveEmpresa, @PreFijo, @Version,@TipodeComprobante); ")
StrSQL.Append(" SET @Retorno = 1; ")
- StrSQL.Append(" SET @CveFactura = IDENT_CURRENT('Comp_Facturas'); ")
+ StrSQL.Append(" SET @CveFactura = SCOPE_IDENTITY(); ")
StrSQL.Append(" UPDATE Comp_Facturas SET XML = CONCAT(@CveFactura,'.xml'), PDF = CONCAT(@CveFactura ,'.pdf') WHERE CveFactura = @CveFactura; ")
StrSQL.Append(" END ")
StrSQL.Append(" ELSE BEGIN SET @CveFactura = @tTotal; END ")
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 9afc08dcc..e9fd6f6d5 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -1004,11 +1004,13 @@ Public Class ClsContabilidad
If ex1.Message.Contains("50015;") Then
OnError("No se puede registrar una póliza en un ejercicio Cerrado", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
ElseIf ex1.Message.Contains("50024; La Cuenta no fue detectada") Then
- Dim dtt As DataTable = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable)
+ Dim dr As Data.DataRow = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimero("")
Dim StrMsg As String = ""
- If dtt IsNot Nothing Then
+ If dr IsNot Nothing Then
+ If CveConceptoContable <> dr("CveConceptoContable").ToString.ToEntero Then 'si el concepto pareja no es principal, lo obtengo
+ dr = ClsPaginas.GlobalDTContaConceptosContables(dr("CveParejaContable").ToString.ToEntero).FiltroPrimero("")
+ End If
Dim tCveEmp As Integer = CType(HttpContext.Current.Session("UsuarioSIG"), Usuario).CveEmpresa
- Dim dr As Data.DataRow = dtt.FiltroPrimero("")
If dr IsNot Nothing Then
StrMsg = dr("ConceptoContable").ToString
If dr("AplicaClasificacion").ToString = "True" Then
@@ -4603,7 +4605,7 @@ Public Class ClsContabilidad
Public Function AddCuenta(CvePadre As Integer, Codigo As String, Nombre As String, Tipo As String, CtaMayor As Integer, CveMoneda As Integer, Optional DigAgrupador As Integer = -1,
Optional CveAgrupadorSAT As Integer = -1, Optional NomIdioma As String = "", Optional CveEmpresaParam As Integer = -1, Optional CveConceptoAdmin As Integer = -1,
Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CveClasificacion As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1,
- Optional CveBancoCuenta As Integer = -1, Optional IdCompaq As Integer = -1) As Integer
+ Optional CveBancoCuenta As Integer = -1, Optional IdCompaq As Integer = -1, Optional CodigoVinculacion As String = "") As Integer
Dim Retorno As Integer = 0
DataAdapter("PA_Conta_CuentasAdd")
@@ -4625,6 +4627,7 @@ Public Class ClsContabilidad
.Add("@PorcentajeImpuesto", SqlDbType.Money).Value = PorcentajeImpuesto
.Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta
.Add("@IdCompaq", SqlDbType.Int).Value = IdCompaq
+ .Add("@CodigoVinculacion", SqlDbType.VarChar).Value = CodigoVinculacion
'.Add("@CveCuenta", SqlDbType.Int).Value = 0
'.Add("@Error", SqlDbType.VarChar).Value = ""
diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb
index a5899031b..3c0f7b656 100644
--- a/App_Code/ClsContratos.vb
+++ b/App_Code/ClsContratos.vb
@@ -3246,7 +3246,7 @@ Public Class ClsContratos
Return Retorno
End Function
- Public Function GetPresupuestosRepDetalleCompras(CveProyecto As Integer, CveSubProyecto As Integer, CveAgrupador As Integer, CveTipoGasto As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean
+ Public Function GetPresupuestosRepDetalleCompras(CveProyecto As Integer, CveSubProyecto As Integer, CveAgrupador As Integer, CveTipoGasto As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveUsuario As Integer, Optional Comprometido As Boolean = False) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Con_PresupuestosRepDetalleCompra")
@@ -3259,6 +3259,7 @@ Public Class ClsContratos
.Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario
+ .Add("@Comprometido", SqlDbType.Bit).Value = Comprometido
End With
Try
diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb
index ef9e785c4..0792aa609 100644
--- a/App_Code/ClsGenerales.vb
+++ b/App_Code/ClsGenerales.vb
@@ -76,7 +76,7 @@ Public Class ClsGenerales
If TransaccionCompartida Is Nothing Then
SqlConexion = New SqlConnection
- SqlConexion.ConnectionString = ClsPaginas.UsuarioActualRutaDB
+ SqlConexion.ConnectionString = ClsPaginas.UsuarioActualRutaDB
Try
SqlConexion.Open()
Catch ex As Exception
@@ -4160,14 +4160,15 @@ Public Class ClsGenerales
End Function
- Public Function GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer) As Boolean
+ Public Function GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer, Optional ValidaEntrega As Boolean = False) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_EntregaAlmacenRutaDetalleGet")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
+ .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
+ .Add("@ValidaEntrega", SqlDbType.Bit).Value = ValidaEntrega
End With
Try
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index e1327629c..cb986fc36 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -78,6 +78,7 @@ Public Class ClsInventarios
Public Property CveVenta As Integer
Public Property TipoEstatus As Integer
Public Property EsDevolucionVenta As Integer
+ Public Property CantidadVenta As Decimal
Public Property CvePersonal As Integer
Public Property NombreCompleto As String
Public Property NombreCapturo As String
@@ -1608,6 +1609,7 @@ Public Class ClsInventarios
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@CveAlmacenes", SqlDbType.VarChar).Value = CveAlmacenes
+
End With
Try
@@ -1626,7 +1628,8 @@ Public Class ClsInventarios
End Function
Public Function GetKardexPSNavegacion(Entrada As Boolean, Salida As Boolean, CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveTiposAlmacen As String, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer,
- Optional CveAlmacenes As String = "-1", Optional Siguiente As Boolean = True, Optional CodigoInicio As String = "-1", Optional CodigoFin As String = "-1") As Boolean
+ Optional CveAlmacenes As String = "-1", Optional Siguiente As Boolean = True, Optional CodigoInicio As String = "-1", Optional CodigoFin As String = "-1", Optional CveMarca As Integer = -1,
+ Optional CveProveedor As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1647,6 +1650,8 @@ Public Class ClsInventarios
.Add("@Siguiente", SqlDbType.Bit).Value = Siguiente
.Add("@CodigoInicio", SqlDbType.VarChar).Value = CodigoInicio
.Add("@CodigoFin", SqlDbType.VarChar).Value = CodigoFin
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
End With
@@ -3572,8 +3577,9 @@ Public Class ClsInventarios
If Data IsNot Nothing AndAlso Data.Rows.Count = 1 Then
Dim dr As DataRow = Data.Rows(0)
- TipoEstatus = dr("TipoEstatus").ToString.ToEntero
- EsDevolucionVenta = dr("EsVentaDevolucion").ToString.ToEntero
+ TipoEstatus = dr("TipoEstatus").ToString().ToEntero
+ EsDevolucionVenta = dr("EsVentaDevolucion").ToString().ToEntero
+ CantidadVenta = dr("CantidadVenta").ToString().ToDecimal()
Retorno = True
End If
@@ -4463,6 +4469,25 @@ Public Class ClsInventarios
Return Retorno
End Function
+ Public Function UpdateOSEstatusInventario(CveOS As Integer, Estatus As Boolean, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OS_OSEstatusInventarioUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveOS", SqlDbType.Int).Value = CveOS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el estatus de OS.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
#End Region
#Region " INVENTARIOS - SOLICITUD DE TRASPASOS "
diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb
index 90618ea70..4fe89fa64 100644
--- a/App_Code/ClsMovimientos.vb
+++ b/App_Code/ClsMovimientos.vb
@@ -777,6 +777,7 @@ Public Class ClsMovimientos
End With
Try
+ SqlAdapter.SelectCommand.CommandTimeout = 0
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
@@ -1393,6 +1394,7 @@ Public Class ClsMovimientos
End With
Try
+ SqlAdapter.SelectCommand.CommandTimeout = 0
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb
index 18cdb0f79..fcb9f0653 100644
--- a/App_Code/ClsNominas.vb
+++ b/App_Code/ClsNominas.vb
@@ -2297,6 +2297,23 @@ Public Class ClsNominas
Return Retorno
End Function
+ Public Function UpdatePeriodoEnvioPrenomina(CvePeriodo As Integer, CveEmpresa As Integer, PreAsistenciaEnviada As Boolean) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Nom_PeriodoEnvioPrenominaUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@PreAsistenciaEnviada", SqlDbType.Int).Value = PreAsistenciaEnviada
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el envio de Pre asistencia del periodo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+ End Function
+
Public Function RemovePeriodo(CvePeriodo As Integer) As Boolean
Dim Retorno As Boolean = False
diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb
index 0e19ccc6d..43dadaa3d 100644
--- a/App_Code/ClsOIEventos.vb
+++ b/App_Code/ClsOIEventos.vb
@@ -87,6 +87,7 @@ Public Class ClsOIEventos
End Property
#Region "Propiedades de la tabla OI_Eventos"
Public Property CveEvento As Integer
+ Public Property CveIndicador As Integer
Public Property CveTipoEvento As Integer
Public Property Folio As Integer
Public Property TipoEvento As String
@@ -153,11 +154,11 @@ Public Class ClsOIEventos
#End Region
#End Region
- Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
+ Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing, Optional UsuarioActual As Usuario = Nothing)
If TransaccionCompartida Is Nothing Then
SqlConexion = New SqlConnection
- SqlConexion.ConnectionString = ClsPaginas.UsuarioActualRutaDB
+ SqlConexion.ConnectionString = If(UsuarioActual IsNot Nothing, UsuarioActual.RutaDB, ClsPaginas.UsuarioActualRutaDB)
Try
SqlConexion.Open()
Catch ex As Exception
@@ -965,7 +966,7 @@ Public Class ClsOIEventos
Optional CveOS As Integer = -1, Optional CveOC As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveProveedor As Integer = -1,
Optional CveCompra As Integer = -1, Optional CveVenta As Integer = -1, Optional CveContrato As Integer = -1, Optional CveSubProyecto As Integer = -1,
Optional CveMovimientoAlmacen As Integer = -1, Optional CorreoExterno As String = "", Optional CveTableroLista As Integer = -1, Optional Lugar As String = "",
- Optional Asistencia As String = "", Optional Duracion As String = "", Optional CveAcercamiento As Integer = -1) As Boolean
+ Optional Asistencia As String = "", Optional Duracion As String = "", Optional CveAcercamiento As Integer = -1, Optional CveIndicador As Integer = -1) As Boolean
Dim retorno As Boolean = False
Dim xmlMiembros As System.Xml.Linq.XDocument = Nothing
@@ -1028,6 +1029,7 @@ Public Class ClsOIEventos
.Add("@Lugar", SqlDbType.VarChar).Value = Lugar
.Add("@CveTableroLista", SqlDbType.VarChar).Value = CveTableroLista
.Add("@CveAcercamiento", SqlDbType.VarChar).Value = CveAcercamiento
+ .Add("@CveIndicador", SqlDbType.VarChar).Value = CveIndicador
'.Add("@mailPara", SqlDbType.VarChar).Direction = ParameterDirection.Output
@@ -3216,8 +3218,66 @@ Public Class ClsOIEventos
Return Retorno
End Function
+
#End Region
+
+
+#Region "I N D I C A D O R E S "
+
+#End Region
+
+ Public Function AddIndicador(Indicador As Integer, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ CveIndicador = -1
+
+ DataAdapter("PA_Dir_IndicadorAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Indicador", SqlDbType.Int).Value = Indicador
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveIndicador", SqlDbType.Int).Direction = ParameterDirection.Output
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ CveIndicador = SqlAdapter.SelectCommand.Parameters("@CveIndicador").Value.ToString().ToEntero()
+ If CveIndicador > 0 Then
+ Retorno = True
+ End If
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar el indicador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdateIndicador(CveIndicador As Integer, Valor As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Dir_IndicadorUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveIndicador", SqlDbType.Int).Value = CveIndicador
+ .Add("@Valor", SqlDbType.Int).Value = Valor
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el indicador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
#End Region
' IDisposable
diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb
index 1263b38d9..376513ad8 100644
--- a/App_Code/ClsOS.vb
+++ b/App_Code/ClsOS.vb
@@ -458,12 +458,12 @@ Public Class ClsOS
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "ClsOSOrdenesServicios"
- 'Reporte de Ventas
+ 'Reporte de Ventas
Public Function GetRepOrdenesServicio(FechaI As Date, FechaF As Date, FechaTerminado As String, CveCliente As Integer, CveSubProyecto As Integer, CveUsuarioRecibio As Integer, CveTecnico As Integer,
CveEstatusOrdenServicio As Integer, CveEmpresa As Integer, Optional Opcion As Integer = -1, Optional CveUsuarioAsignado As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -492,12 +492,32 @@ Public Class ClsOS
OnError("Ocurrió un error al obtener el Reporte de Ordenes de Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
+ Return Retorno
+ End Function
+
+ Public Function GetRepOSEstatus(CveOS As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OS_OSEstatusRepGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveOS", SqlDbType.Int).Value = CveOS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el Reporte de estatus de OS.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
Return Retorno
End Function
Public Function GetRepOrdenesServicioMedicasRep(FechaI As Date, FechaF As Date, CveCliente As Integer, CveVendedor As Integer, CveEstatusOrdenServicio As Integer, CveUsuarioAtendio As Integer, CveSubProyecto As Integer, CveEmpresa As Integer,
- Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveEspecialidad As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean
+ Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveEspecialidad As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional CveUsuario As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OS_OrdenesServiciosMedicasRepGet")
@@ -516,6 +536,7 @@ Public Class ClsOS
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
.Add("@CveEspecialidad", SqlDbType.Int).Value = CveEspecialidad
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index ae4459a62..277b6fbf5 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -1965,7 +1965,7 @@ Public Class ClsPaginas
End Set
End Property
- Property GlobalDTGralCartaPorteConfigAutoTransportes() As DataTable
+ Property GlobalDTGralCartaPorteConfigAutoTransportes As DataTable
Get
Dim AppNombre As String = "GetCartaPorteConfigAutoTransportes"
If Application(AppNombre) Is Nothing Then
@@ -5966,8 +5966,6 @@ Public Class ClsPaginas
Dim PermisoSCTR2 As String = ""
Dim ConfATR1 As String = ""
Dim ConfATR2 As String = ""
-
-
Dim ObjInv As New ClsGenerales
If ObjInv.GetGralTimbre(CveTimbre, "-1", MinFecha, MaxFecha, -1, UsuarioActual.CveEmpresa, -1) Then
@@ -5984,7 +5982,6 @@ Public Class ClsPaginas
ConfATR1 = Dr("ConfATR1").ToString
ConfATR2 = Dr("ConfATR2").ToString
End If
-
End If
End If
End If
@@ -6078,22 +6075,6 @@ Public Class ClsPaginas
Dim VersionCCP As String = ""
Dim PrefijoCCP As String = ""
- 'Try
-
- ' 'XDocument doc = XDocument.Parse(Xml);
- ' 'String Version = doc.Descendants("cartaporte30:CartaPorte").First().Attribute("version").Value;
-
- ' Dim NodoVersionCCP As XmlNode = XMLDoc.Descendants("cartaporte30:CartaPorte")
- ' If NodoVersionCCP IsNot Nothing Then
- ' VersionCCP = ValorXML(NodoVersionCCP, "version")
- ' Else
- ' VersionCCP = "2.0"
- ' End If
- 'Catch ex As Exception
-
- 'End Try
-
-
If Version = "3.3" Then
cfdVer = "http://www.sat.gob.mx/cfd/3"
Else ' se considera que es la version 4.0
@@ -6160,6 +6141,9 @@ Public Class ClsPaginas
Dim nodeCartaPorte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:CartaPorte", PrefijoCCP), namespaces)
If nodeCartaPorte IsNot Nothing Then
TransporteInternacional = ValorXML(nodeCartaPorte, "TranspInternac", "")
+ Dim CveTransporte As String = ValorXML(nodeCartaPorte, "ViaEntradaSalida", "")
+ 'Dim nodeFiguraTransporte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:FiguraTransporte", "cartaporte20"), namespaces)
+ If CveTransporte <> "" Then MedioTransporte = String.Format("{0} - {1}", CveTransporte, HtTransporte(CveTransporte).ToString())
End If
Dim nodeAutotransporteFederal As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:Autotransporte", PrefijoCCP), namespaces)
@@ -6202,12 +6186,6 @@ Public Class ClsPaginas
End If
End If
- 'Dim nodeFiguraTransporte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:FiguraTransporte", "cartaporte20"), namespaces)
- 'If nodeFiguraTransporte IsNot Nothing Then
- ' Dim CveTransporte As String = ValorXML(nodeFiguraTransporte, "TipoFigura", "")
- ' MedioTransporte = String.Format("{0} - {1}", CveTransporte, HtTransporte(CveTransporte).ToString())
- 'End If
-
Dim nodeMercancias As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Mercancia", PrefijoCCP), namespaces)
For Each node As XmlNode In nodeMercancias
Dim Row As DataRow = DtMercancias.NewRow
@@ -6293,8 +6271,6 @@ Public Class ClsPaginas
End If
Row("Direccion") = String.Format("{0} Col.{1},{2},{3}. CP {4}", calle, Colonia, Municipio, Estado, CP)
End If
-
-
DtUbicaciones.Rows.Add(Row)
Next
@@ -6438,11 +6414,6 @@ Public Class ClsPaginas
params.Add(New ReportParameter("ConfATR2", ConfATR2))
End If
-
-
- ' [@CertificadoContribuyente]
- '[@CadenaOriginal]
-
Dim lrds As New List(Of ReportDataSource)
Dim rds As New ReportDataSource
@@ -6482,7 +6453,6 @@ Public Class ClsPaginas
retorno.DataSources.AddRange(lrds)
End If
-
End If
Catch ex As Exception
OnError("Ocurrió un error al generar el pdf de la carta porte", ex)
@@ -7145,7 +7115,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("CveVenta", Vta.CveVenta.ToString))
End If
'COMPU DN DIFUSA
- If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 137, 132, 144, 177) Then
+ If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 137, 132, 144, 177, 186) Then
Dim FirmaVendedor As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", UsuarioActual.Empresa.Ruta, Vta.CveVendedor))
params.Add(New ReportParameter("FirmaVendedor", If(FirmaVendedor.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", UsuarioActual.CveEmpresa, Vta.CveVendedor))).AbsoluteUri, "")))
params.Add(New ReportParameter("Entrega", Vta.Entrega))
@@ -8831,7 +8801,7 @@ Public Class ClsPaginas
If File.Exists($"{UsuarioActual.Empresa.Ruta}Formatos\ReciboDePago.rdlc") Then
rutaArchivo = $"{UsuarioActual.Empresa.Ruta}Formatos\ReciboDePago.rdlc"
Else
- rutaArchivo = " \Empresas\Grales\Formatos\ReciboDePago.rdlc"
+ rutaArchivo = "\Empresas\Grales\Formatos\ReciboDePago.rdlc"
End If
If Not Directory.Exists($"{UsuarioActual.Empresa.Ruta}\PDF\Pag\") Then Directory.CreateDirectory($"{UsuarioActual.Empresa.Ruta}\PDF\Pag\")
Dim ArchivoPDF As New System.IO.FileInfo($"{Ruta}PDF\Pag\{Serie}-{Folio}.pdf")
@@ -8843,7 +8813,7 @@ Public Class ClsPaginas
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
End Try
Else
- File.WriteAllBytes($"{UsuarioActual.Empresa.Ruta}\PDF\Pag\{SerieFolio}.pdf", StreamPDF(rutaArchivo, lrds, params, "Pago", "PDF"))
+ File.WriteAllBytes($"{UsuarioActual.Empresa.Ruta}PDF\Pag\{SerieFolio}.pdf", StreamPDF(rutaArchivo, lrds, params, "Pago", "PDF"))
End If
If imprimir Then
ImprimirPDF(rutaArchivo, lrds, params, SerieFolio, "PDF")
@@ -10493,6 +10463,7 @@ Public Class ClsPaginas
PaginaDict.Add("/OS/Asignaciones.aspx".ToUpper(), 125)
PaginaDict.Add("/OS/RepServicioDomicilio.aspx".ToUpper(), 1330)
PaginaDict.Add("/OS/RepOSMedicas.aspx".ToUpper(), 1345)
+ PaginaDict.Add("/OS/RepOSEstatus.aspx".ToUpper(), 1349)
#End Region
#Region "OC"
PaginaDict.Add("/OC/OC.aspx".ToUpper(), 155)
@@ -10547,6 +10518,7 @@ Public Class ClsPaginas
PaginaDict.Add("/OI/CatDocumentoSubCategoria.aspx".ToUpper(), -1)
PaginaDict.Add("/OI/Documentos.aspx".ToUpper(), -1)
PaginaDict.Add("/OI/DocumentoDetalle.aspx".ToUpper(), -1)
+ PaginaDict.Add("/OI/RepIndicadoresEMD.aspx".ToUpper(), 1348)
#End Region
#Region "Planeacion"
PaginaDict.Add("/Planeacion/CatSucursales.aspx".ToUpper(), 17)
@@ -10698,7 +10670,6 @@ Public Class ClsPaginas
PaginaDict.Add("/Sistemas/CatProcesos.aspx".ToUpper(), 69)
PaginaDict.Add("/Sistemas/CatParametros.aspx".ToUpper(), 143)
PaginaDict.Add("/Sistemas/PopUpCargaCertificados.aspx".ToUpper(), 144)
- PaginaDict.Add("/Sistemas/CatNotificaciones.aspx".ToUpper(), 146)
PaginaDict.Add("/Sistemas/EmpresasModulos.aspx".ToUpper(), 346)
PaginaDict.Add("/Sistemas/CatSesiones.aspx".ToUpper(), 374)
PaginaDict.Add("/Sistemas/CatFuncionalidades.aspx".ToUpper(), 568)
@@ -10817,10 +10788,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Ventas/CatEspecialidadesSubEspecialidades.aspx".ToUpper(), 1346)
PaginaDict.Add("/Ventas/FacturacionGlobal.aspx".ToUpper(), 546)
PaginaDict.Add("/Ventas/RepComisionesSMS.aspx".ToUpper(), 1347)
-
-
-
-
+ PaginaDict.Add("/Ventas/RepVencimientosCredito.aspx".ToUpper(), 146)
diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb
index c9290bf53..259de04bf 100644
--- a/App_Code/ClsRH.vb
+++ b/App_Code/ClsRH.vb
@@ -2054,12 +2054,10 @@ Public Class ClsRH
.Add("@NetoPeriodo", SqlDbType.Money).Value = NetoPeriodo
.Add("@TipoSangre", SqlDbType.VarChar).Value = TipoSangre
.Add("@AreaGeografica", SqlDbType.VarChar).Value = AreaGeografica
-
.Add("@CveSubTipoPeriodo", SqlDbType.Int).Value = CveSubTipoPeriodo
- .Add("@ErrorMostrarADS", SqlDbType.VarChar).Direction = ParameterDirection.Output
-
- .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.Output
+ '.Add("@ErrorMostrarADS", SqlDbType.VarChar, 50).Direction = ParameterDirection.Output
+ .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With
@@ -2789,12 +2787,12 @@ Public Class ClsRH
End Function
- Public Function AddPreAsistencia(CvePersonal As Integer, Fecha As Date, CveAsistenciasInasistencias As Integer, PorcentajePago As Double, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Public Function AddPreAsistencia(CvePersonal As Integer, Fecha As Date, CveAsistenciasInasistencias As Integer, PorcentajePago As Double, CveUsuario As Integer, CveEmpresa As Integer, Optional HorasDobles As Decimal = 0,
+ Optional HorasTriples As Decimal = 0, Optional CveMotivoHoraExtra As Integer = -1, Optional Observacion As String = "") As Boolean
Dim Retorno As Boolean = False
- Data = New DataTable
- 'SqlAdapter = New SqlDataAdapter("PA_RH_PersonalAsistenciasAddUpd", SqlConexion)
- 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
+ Data = New DataTable
+
SqlDataAdapter("PA_RH_PersonalPreAsistenciasAddUpd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
@@ -2803,6 +2801,10 @@ Public Class ClsRH
.Add("@PorcentajePago", SqlDbType.Float).Value = PorcentajePago
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@HorasDobles", SqlDbType.Money).Value = HorasDobles
+ .Add("@HorasTriples", SqlDbType.Money).Value = HorasTriples
+ .Add("@CveMotivoHoraExtra", SqlDbType.Int).Value = CveMotivoHoraExtra
+ .Add("@Observacion", SqlDbType.VarChar).Value = Observacion
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With
@@ -6704,7 +6706,7 @@ Public Class ClsRH
End Function
- Public Function PreAsistenciaRegistrosGet(InicioPeriodo As Date, FinPeriodo As Date, CveTurno As Integer, CveEmpresa As Integer) As Boolean
+ Public Function PreAsistenciaRegistrosGet(InicioPeriodo As Date, FinPeriodo As Date, CveTurno As Integer, CveEmpresa As Integer, IncluyePreAsistencia As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorPreasistenciaRegistrosGet")
@@ -6714,6 +6716,7 @@ Public Class ClsRH
.Add("@FinPeriodo", SqlDbType.Date).Value = FinPeriodo
.Add("@CveTurno", SqlDbType.Int).Value = CveTurno
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@IncluyePreAsistencia", SqlDbType.Bit).Value = IncluyePreAsistencia
End With
Try
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index ff6047d0b..844dbb8db 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -76,11 +76,12 @@ Public Class ClsVentas
SqlTransacc.Rollback()
End Sub
- Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
+ Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing, Optional UsuarioActual As Usuario = Nothing)
If TransaccionCompartida Is Nothing Then
SqlConexion = New SqlConnection
- SqlConexion.ConnectionString = ClsPaginas.UsuarioActualRutaDB
+ SqlConexion.ConnectionString = If(UsuarioActual IsNot Nothing, UsuarioActual.RutaDB, ClsPaginas.UsuarioActualRutaDB)
+
Try
SqlConexion.Open()
Catch ex As Exception
@@ -595,7 +596,7 @@ Public Class ClsVentas
Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Decimal = -1,
Optional RetISR As Decimal = -1, Optional Kilometraje As Decimal = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1,
Optional RequiereOS As Boolean = False, Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional FechaParaSurtir As DateTime = MinFecha,
- Optional Paciente As String = "-1", Optional Episodio As String = "-1") As Boolean
+ Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional CveCondicionEntrega As Integer = -1, Optional FolioRemision As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUpdate")
@@ -634,6 +635,8 @@ Public Class ClsVentas
.Add("@FechaParaSurtir", SqlDbType.DateTime).Value = FechaParaSurtir
.Add("@Paciente", SqlDbType.VarChar).Value = Paciente
.Add("@Episodio", SqlDbType.VarChar).Value = Episodio
+ .Add("@CveCondicionEntrega", SqlDbType.Int).Value = CveCondicionEntrega
+ .Add("@FolioRemision", SqlDbType.VarChar).Value = FolioRemision
End With
Try
@@ -732,6 +735,22 @@ Public Class ClsVentas
Return Retorno
End Function
+ Public Function UpdateVentaTicketImpreso(CveVenta As Integer, Num2 As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_VentasTicketImpresoUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
+ .Add("@Num2", SqlDbType.Int).Value = Num2
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el estatus de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+ End Function
+
Public Function UpdateFechaVencimientoVenta(CveVenta As Integer, FechaVencimiento As Date) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasFechaVencimientoUpdate")
@@ -5964,6 +5983,30 @@ Public Class ClsVentas
End Function
+ Public Function GetLineasAdicionalesVencimientos(CveCliente As Integer, TipoLinea As Integer, FechaInicio As Date, FechaFin As Date, CveMoneda As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_LineasAdicionalesVencimientosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@TipoLinea", SqlDbType.Int).Value = TipoLinea
+ .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error obtener las lineas de adicionales.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+
+ End Function
+
+
Public Function CambioClientesVendedor(CveCliente As Integer, CveVendedor As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -6178,7 +6221,8 @@ Public Class ClsVentas
End Function
Public Function AddMedico(Nombre As String, Apellidos As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, Estatus As Boolean, CveUsuario As Integer,
- CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Optional CveMedicoSubEspecialidad As Integer = -1, Optional CveVendedor As Integer = -1) As Integer
+ CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Optional CveMedicoSubEspecialidad As Integer = -1,
+ Optional CveVendedor As Integer = -1, Optional CvePeriodoPago As Integer = 1) As Integer
Dim Retorno As Boolean = False
CveMedicoNuevo = -1
@@ -6199,6 +6243,7 @@ Public Class ClsVentas
.Add("@Celular", SqlDbType.VarChar).Value = Celular
.Add("@CveMedicoSubEspecialidad", SqlDbType.Int).Value = CveMedicoSubEspecialidad
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
+ .Add("@CvePeriodoPago", SqlDbType.Int).Value = CvePeriodoPago
.Add("@CveMedicoNuevo", SqlDbType.Int).Direction = ParameterDirection.Output
End With
@@ -6215,7 +6260,8 @@ Public Class ClsVentas
End Function
Public Function UpdateMedico(CveMedico As Integer, Nombre As String, Apellidos As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, Estatus As Boolean, CveUsuario As Integer,
- CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Optional CveMedicoSubEspecialidad As Integer = -1, Optional CveVendedor As Integer = -1) As Boolean
+ CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Optional CveMedicoSubEspecialidad As Integer = -1,
+ Optional CveVendedor As Integer = -1, Optional CvePeriodoPago As Integer = 1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_MedicosUpdate")
@@ -6240,6 +6286,7 @@ Public Class ClsVentas
'.Add("@Consultorio", SqlDbType.VarChar).Value = Consultorio
.Add("@CveMedicoSubEspecialidad", SqlDbType.Int).Value = CveMedicoSubEspecialidad
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
+ .Add("@CvePeriodoPago", SqlDbType.Int).Value = CvePeriodoPago
'.Add("@Torre", SqlDbType.VarChar).Value = Torre
@@ -6721,7 +6768,8 @@ Public Class ClsVentas
End Function
- Public Function GetProcedimientoProducto(CveProcedimiento As Integer, Estatus As Integer, CveEmpresa As Integer, CveCliente As Integer, CveSubProyecto As Integer) As Boolean
+ Public Function GetProcedimientoProducto(CveProcedimiento As Integer, Estatus As Integer, CveEmpresa As Integer, CveCliente As Integer, CveSubProyecto As Integer,
+ Optional CveClienteSucursal As Integer = -1, Optional CveTipoVenta As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ProcedimientosProductosGet")
@@ -6732,6 +6780,8 @@ Public Class ClsVentas
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
+ .Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta
End With
Try
SqlAdapter.Fill(Data)
@@ -6808,7 +6858,7 @@ Public Class ClsVentas
End Function
- Public Function AddUpdateComisionesMedicas(CvePS As Integer, CveEmpresa As Integer, ComisionMedico As Decimal, ComisionVendedor As Decimal, ComisionTecnico As Decimal) As Boolean
+ Public Function AddUpdateComisionesMedicas(CvePS As Integer, CveEmpresa As Integer, ComisionMedico As Decimal, ComisionVendedor As Decimal, ComisionTecnico As Decimal, ComisionGerente As Decimal) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ComisionesMedicasAddUpdate")
@@ -6819,6 +6869,7 @@ Public Class ClsVentas
.Add("@ComisionMedico", SqlDbType.Money).Value = ComisionMedico
.Add("@ComisionVendedor", SqlDbType.Money).Value = ComisionVendedor
.Add("@ComisionTecnico", SqlDbType.Money).Value = ComisionTecnico
+ .Add("@ComisionGerente", SqlDbType.Money).Value = ComisionGerente
End With
Try
@@ -6832,7 +6883,7 @@ Public Class ClsVentas
End Function
- Public Function GetComisionesMedicasRep(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CveSubProyecto As Integer, CveProcedimiento As Integer, CveMedico As Integer, CveVendedor As Integer, CveUsuario As Integer, CveTipoVenta As Integer) As Boolean
+ Public Function GetComisionesMedicasRep(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CveSubProyecto As Integer, CveProcedimiento As Integer, CveMedico As Integer, CveVendedor As Integer, CveUsuario As Integer, CveTipoVenta As Integer, Opcion As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ComisionesMedicasRepGet")
@@ -6847,6 +6898,7 @@ Public Class ClsVentas
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta
+ .Add("@Opcion", SqlDbType.Int).Value = Opcion
End With
@@ -6912,7 +6964,7 @@ Public Class ClsVentas
#End Region
- Public Function GetVentasMedicasIndicadoresRep(Grupo As Integer, FechaI As Date, FechaF As Date, CveCliente As Integer, CveMedico As Integer, CveProcedimiento As Integer, CveEmpresa As Integer) As Boolean
+ Public Function GetVentasMedicasIndicadoresRep(Grupo As Integer, FechaI As Date, FechaF As Date, CveCliente As Integer, CveMedico As Integer, CveProcedimiento As Integer, CveEmpresa As Integer, CveVendedor As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasMedicasIndicadoresRepGet")
@@ -6924,6 +6976,7 @@ Public Class ClsVentas
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
End With
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb
index 28c10e7e6..60c6dc724 100644
--- a/App_Code/Timbrado.vb
+++ b/App_Code/Timbrado.vb
@@ -355,9 +355,7 @@ Public Class Timbrado
Dim UsuarioServicio As String = If(CvePACCancelacion = 2, Empresa.RFC, "rene.molina@adsistemas.mx")
Dim ClaveServicio As String = If(CvePACCancelacion = 2, Empresa.RFC.ToLower, "rene2018")
Dim Clave As String = Empresa.ContraseñaKey
- Dim UrlServicio As String = "" ' Produccion
-
- UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL"
+ Dim UrlServicio As String = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL" ' Produccion
If Not Empresa.FacturaProduccion Then
ArchivoLLave = $"{Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.key"
@@ -365,7 +363,6 @@ Public Class Timbrado
UsuarioServicio = "UserTest"
ClaveServicio = "1234567890"
- 'UrlServicio = "http://juancalderon-001-site6.ftempurl.com/cancelacion.asmx?WSDL"
End If
#Region "Valida"
If Not File.Exists(ArchivoCertificado) Then
@@ -1714,8 +1711,19 @@ Public Class Timbrado
Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte
Dim ComCartaPorte As ProfactCartaPorte.CartaPorte = New ProfactCartaPorte.CartaPorte
ComCartaPorte.TranspInternac = CType([Enum].Parse(GetType(ProfactCartaPorte.CartaPorteTranspInternac), Carta.TranspInternac), ProfactCartaPorte.CartaPorteTranspInternac)
- ComCartaPorte.EntradaSalidaMercSpecified = False
- ComCartaPorte.ViaEntradaSalidaSpecified = False
+
+ ComCartaPorte.RegimenAduaneroSpecified = Carta.RegimenAduanero <> ""
+ If Carta.RegimenAduanero <> "" Then ComCartaPorte.RegimenAduanero = ProfactCartaPorte.c_RegimenAduanero.EXD
+
+ ComCartaPorte.EntradaSalidaMercSpecified = Carta.EntradaSalidaMercancia <> ""
+ If Carta.EntradaSalidaMercancia <> "" Then ComCartaPorte.EntradaSalidaMerc = ProfactCartaPorte.CartaPorteEntradaSalidaMerc.Salida
+
+ ComCartaPorte.ViaEntradaSalidaSpecified = Carta.ViaEntradaSalida <> ""
+ If Carta.ViaEntradaSalida <> "" Then ComCartaPorte.ViaEntradaSalida = ProfactCartaPorte.c_CveTransporte.Item01
+
+ ComCartaPorte.PaisOrigenDestinoSpecified = Carta.PaisOrigenDestino <> ""
+ If Carta.PaisOrigenDestino <> "" Then ComCartaPorte.PaisOrigenDestino = ProfactCartaPorte.c_Pais.USA
+
ComCartaPorte.TotalDistRecSpecified = True
ComCartaPorte.TotalDistRec = Carta.TotalDistanciaRecorrida
@@ -1797,6 +1805,11 @@ Public Class Timbrado
ComCartaPorte.Mercancias.Mercancia(i).MonedaSpecified = False
ComCartaPorte.Mercancias.Mercancia(i).FraccionArancelariaSpecified = False
If concep.UUIDComercioExt <> "" Then ComCartaPorte.Mercancias.Mercancia(i).UUIDComercioExt = concep.UUIDComercioExt
+ If concep.TipoMateria <> "" Then
+ ComCartaPorte.Mercancias.Mercancia(i).TipoMateriaSpecified = True
+ ComCartaPorte.Mercancias.Mercancia(i).TipoMateria = ProfactCartaPorte.c_TipoMateria.Item01
+ If concep.TipoMateria = "05" Then ComCartaPorte.Mercancias.Mercancia(i).DescripcionMateria = concep.TipoMateriaDescripcion
+ End If
If concep.SectorCOFEPRIS <> "" Then
'ComCartaPorte.Mercancias.Mercancia(i).SectorCOFEPRIS = concep.SectorCOFEPRIS
@@ -2270,7 +2283,7 @@ Public Class Timbrado
Dim sbMsgLog As New StringBuilder
sbMsgLog.Append(xmlPrevio)
sbMsgLog.Append("------------")
- For Each msg As JProperty In Resultados
+ For Each msg As JObject In Resultados
sbMsg.AppendFormat("{0}. ", msg("Value"))
sbMsgLog.AppendFormat("{0}-{1} ", msg("Key"), msg("Value"))
Next
@@ -2448,7 +2461,7 @@ Public Class Timbrado
cfdi.Ine11(Ventas.ComplementoINE.INETipoProceso, "", "")
cfdi.IneEntidad(Ventas.ComplementoINE.INEEntidad, Ventas.ComplementoINE.INETipoComite)
- 'If Ventas.ComplementoINE.INEIdContabilidad > 0 Then cfdi.IneContabilidad(Ventas.ComplementoINE.INEIdContabilidad)
+ If Ventas.ComplementoINE.INEIdContabilidad > 0 Then cfdi.IneContabilidad(Ventas.ComplementoINE.INEIdContabilidad)
End Select
End If
@@ -2540,7 +2553,7 @@ concep.DescripcionesEspecificas.NumeroSerie)
Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte
''DATOS GENERALES
- cfdi.CartaPorte30("", Carta.TranspInternac, Carta.RegimenAduanero, Carta.EntradaSalidaMercancia, "", Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida, Carta.RegistroISTMO, Carta.UbicacionPoloOrigen, Carta.UbicacionPoloDestino)
+ cfdi.CartaPorte30("", Carta.TranspInternac, Carta.RegimenAduanero, Carta.EntradaSalidaMercancia, Carta.PaisOrigenDestino, Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida, Carta.RegistroISTMO, Carta.UbicacionPoloOrigen, Carta.UbicacionPoloDestino)
'UBICACIONES
If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then
@@ -2561,7 +2574,7 @@ concep.DescripcionesEspecificas.NumeroSerie)
cfdi.CartaPorte30Mercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, If(concep.ClaveMaterialPeligroso <> "", concep.Embalaje, ""), If(concep.ClaveMaterialPeligroso <> "", concep.DescripEmbalaje, ""),
concep.SectorCOFEPRIS, concep.NombreIngredienteActivo, concep.NomQuimico, concep.DenominacionGenericaProd, concep.DenominacionDistintivaProd, concep.Fabricante, concep.FechaCaducidad, concep.LoteMedicamento, concep.FormaFarmaceutica, concep.CondicionesEspTransp, concep.RegistroSanitarioFolioAutorizacion,
If(Carta.TranspInternac <> "No", concep.PermisoImportacion, ""), If(Carta.TranspInternac <> "No", concep.FolioImpoVUCEM, ""), concep.NumCAS, If(Carta.TranspInternac <> "No", concep.RazonSocialEmpImp, ""), concep.NumRegSanPlagCOFEPRIS, concep.DatosFabricante, concep.DatosFormulador, concep.DatosMaquilador, concep.UsoAutorizado,
- concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
+ concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt, concep.TipoMateria, If(concep.TipoMateria = "05", concep.TipoMateriaDescripcion, ""))
For Each transp As CFDICartaPorteMercanciaTransporta In concep.MercanciasCantidadTransporta
cfdi.CartaPorte30CantidadTransporta(transp.Cantidad, transp.IDOrigen, transp.IDDestino, transp.CvesTransportes)
Next
diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb
index dd3934601..c03537ec2 100644
--- a/App_Code/Timbres.vb
+++ b/App_Code/Timbres.vb
@@ -105,6 +105,7 @@ Public Class Timbres
Dim CartaPorte As New CFDICartaPorte
CartaPorte.TranspInternac = "No"
+ CartaPorte.RegimenAduanero = ""
CartaPorte.EntradaSalidaMercancia = ""
CartaPorte.ViaEntradaSalida = ""
@@ -125,6 +126,16 @@ Public Class Timbres
Dim DtMovimientos As DataTable = Nothing
Dim drT As DataRow = ObjGrales.DtResultados.Rows(0)
+ CartaPorte.TranspInternac = drT("TranspInternacional").ToString
+
+ If CartaPorte.TranspInternac = "Sí" Then
+ CartaPorte.RegimenAduanero = drT("RegimenAduanero").ToString
+ CartaPorte.EntradaSalidaMercancia = drT("EntradaSalidaMercancia").ToString
+ CartaPorte.ViaEntradaSalida = drT("ViaEntradaSalida").ToString
+ CartaPorte.PaisOrigenDestino = drT("DirDesClaveSATPais").ToString
+ End If
+
+
Timbre.Receptor.RFC = drT("EmpresaRFC").ToString
Timbre.Receptor.Nombre = drT("EmpresaNombre").ToString
Timbre.Receptor.DomicilioFiscalReceptor = drT("DomicilioFiscalReceptor").ToString
diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb
index 854ab6997..5bb948f6b 100644
--- a/App_Code/modExtensiones.vb
+++ b/App_Code/modExtensiones.vb
@@ -681,6 +681,49 @@ Namespace Extensiones
directorioNew.Clear()
Return retorno
End Function
+
+
+ Public Function FilesCopy(oldName As String, newName As String, newDirectorio As String, Optional Sobreescribir As Boolean = False, Optional ConcatenarDirectorioBase As Boolean = True) As Boolean
+ Dim retorno As Boolean = True
+ Dim directorioOld As New StringBuilder
+ Dim directorioNew As New StringBuilder
+ directorioOld.AppendFormat("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, oldName)
+ If newName = "" Then
+ newName = oldName
+ Else
+ newName = String.Format("{0}{1}", newName, System.IO.Path.GetExtension(directorioOld.ToString()))
+ End If
+
+ 'SI VA A LA CARPETA DE EMPRESAS TIENE QUE TOMAR LA RUTA DE EMPRESAS
+ If ConcatenarDirectorioBase Then
+ If newDirectorio.Contains("Empresas") Then
+ directorioNew.AppendFormat("{0}{1}\", ModExtensiones.DirectorioBaseEmpresas, newDirectorio)
+ Else
+ directorioNew.AppendFormat("{0}{1}\", AppDomain.CurrentDomain.BaseDirectory, newDirectorio)
+ End If
+ Else
+ 'SI YA TIENE EL DIRECTORIO COMPLETO NO CONCANTENA EL DIRECTORIO
+ directorioNew.AppendFormat("{0}\", newDirectorio)
+ End If
+
+
+ If Not Directory.Exists(directorioNew.ToString) Then
+ Directory.CreateDirectory(directorioNew.ToString)
+ End If
+
+ directorioNew.Append(newName)
+ Try
+ My.Computer.FileSystem.CopyFile(directorioOld.ToString, directorioNew.ToString, Sobreescribir)
+
+ Catch ex As Exception
+ Alert("", String.Format("{0} code[FilesMove]", ex.Message), TipoMensaje.MsgAdvertencia)
+ retorno = False
+ End Try
+ directorioOld.Clear()
+ directorioNew.Clear()
+ Return retorno
+ End Function
+
Public Function DirectoryExistsCreate(ByRef NombreDirectorio As String) As Boolean
diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx
index 0513bd853..9777b70b6 100644
--- a/Ashx/CargaEventos.ashx
+++ b/Ashx/CargaEventos.ashx
@@ -461,9 +461,11 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.title = dr("DescripcionContrato").ToString
cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime)
cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime))
+ cevent.FechaFinal = String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)
cevent.allDay = False
cevent.NombreAcercamiento = dr("Ubicacion").ToString
cevent.CveCliente = dr("CveCliente").ToString.ToEntero
+ cevent.NombreComercial = dr("NombreComercial").ToString
cevent.CvePersonal = dr("CveChofer").ToString.ToEntero
cevent.CvePersonal2 = dr("CveChofer2").ToString.ToEntero
cevent.CveEventoEstatus = dr("CveContratosEstatus").ToString.ToEntero
@@ -530,6 +532,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime))
cevent.allDay = False
cevent.CveCliente = dr("CveCliente").ToString.ToEntero
+ cevent.NombreComercial = dr("NombreComercial").ToString
cevent.NombreAcercamiento = dr("Ubicacion").ToString
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.CvePersonal = dr("CveChofer").ToString.ToEntero
diff --git a/Ashx/E119.ashx b/Ashx/E119.ashx
index a774331de..a14a437ef 100644
--- a/Ashx/E119.ashx
+++ b/Ashx/E119.ashx
@@ -9,7 +9,7 @@ Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Imports Extensiones
-Public Class E119 : Implements IHttpHandler
+Public Class E119 : Implements IHttpHandler, System.Web.SessionState.IRequiresSessionState
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
@@ -59,6 +59,7 @@ Public Class E119 : Implements IHttpHandler
Dim Contrasenia As String = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa)
UsuarioActual.CveEmpresa = CveEmpresa
+ HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
CreaObjetoEmpresa(UsuarioActual)
End If
End If
@@ -79,7 +80,7 @@ Public Class E119 : Implements IHttpHandler
End If
UsuarioActual.Empresa = ObjEmpresa.Empresa
- If UsuarioActual.Empresa.RutaDB = "" Then UsuarioActual.Empresa.RutaDB = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
+
End If
ObjEmpresa.Dispose()
End Sub
@@ -267,7 +268,7 @@ Public Class E119 : Implements IHttpHandler
End If
Dim Productos As JArray = Nothing
-
+ Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Using ObjInventario As New ClsInventarios
If ObjInventario.GetJAM_APIs(1, CveClasificacion:=CveClasificacion.ToEntero()) AndAlso ObjInventario.DtResultados IsNot Nothing Then
Productos = JArray.Parse(ObjInventario.DtResultados.FiltroPrimeroValor("JsonTexto"))
@@ -302,6 +303,7 @@ Public Class E119 : Implements IHttpHandler
Dim TieneError As Boolean = False
Dim Clasificaciones As JArray = Nothing
+ Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Try
'Clasificaciones = JArray.Parse(ClsPaginas.GlobalDTClasificaciones(CveEmpresa).FiltraParametros("", DistinctColumns:={"CveClasificacion", "Clasificacion"}).DataTableToJSONIPP())
diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx
index d173221f0..4c914b2eb 100644
--- a/Ashx/E141.ashx
+++ b/Ashx/E141.ashx
@@ -10,7 +10,7 @@ Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Imports Extensiones
-Public Class E141 : Implements IHttpHandler
+Public Class E141 : Implements IHttpHandler, System.Web.SessionState.IRequiresSessionState
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
@@ -69,6 +69,7 @@ Public Class E141 : Implements IHttpHandler
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa)
UsuarioActual.CveEmpresa = CveEmpresa
+ HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
CreaObjetoEmpresa(UsuarioActual)
End If
End If
@@ -459,7 +460,7 @@ Public Class E141 : Implements IHttpHandler
Dim data As New JArray
Dim DtSucursalesExistencias As DataTable = Nothing
-
+ Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Using ObjInv As New ClsInventarios
If ObjInv.GetExistenciasSucursales(JsonRequest("products").ToString(), CveEmpresa) Then
DtSucursalesExistencias = ObjInv.DtResultados.Copy()
@@ -1671,6 +1672,21 @@ Public Class E141 : Implements IHttpHandler
Return JsonConvert.SerializeObject(respuesta)
End If
+
+ Dim UsuarioActual As Usuario = Nothing
+ Dim ObjUsuarios As New ClsSisUsuarios
+ If ObjUsuarios.GetUsuarios(100) Then
+ If ObjUsuarios.DtResultados.Rows.Count > 0 Then
+ Dim Usuario As String = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
+ Dim Contrasenia As String = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
+ UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa)
+ UsuarioActual.CveEmpresa = CveEmpresa
+ HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
+ CreaObjetoEmpresa(UsuarioActual)
+ End If
+ End If
+ ObjUsuarios.Dispose()
+
Using ObjPS As New ClsProductosServicios()
If ObjPS.GetExistenciasEmpresa(Codigo, CveEmpresa) Then
Dim ArrayPS As New JArray
@@ -1964,6 +1980,7 @@ Public Class E141 : Implements IHttpHandler
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
+ Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Dim DtPS As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
'OBTERNER PRECIOS DE PUBLICO GENERAL
@@ -2054,6 +2071,7 @@ Public Class E141 : Implements IHttpHandler
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
+ Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Dim DtPS As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
'OBTERNER PRECIOS DE PUBLICO GENERAL
@@ -2101,7 +2119,7 @@ Public Class E141 : Implements IHttpHandler
Retorno = True
Return Retorno
End If
-
+ Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Dim DtPS As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
'OBTERNER PRECIOS DE PUBLICO GENERAL
@@ -2191,7 +2209,7 @@ Public Class E141 : Implements IHttpHandler
Dim payload = New JObject()
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
-
+ Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Dim DtPS As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
If ObjPS.GetExistenciasEmpresa("-1", CveEmpresa) Then
@@ -2231,6 +2249,7 @@ Public Class E141 : Implements IHttpHandler
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
Dim DtVendedores As DataTable = Nothing
+ Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Using ObjPS As New ClsProductosServicios
'OBTERNER PRECIOS DE PUBLICO GENERAL
If ObjPS.GetVendedoresModificados(CveEmpresa, If(Todos, -1, 1)) Then
diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx
index fdf93a213..498665467 100644
--- a/Ashx/SIGWeb.ashx
+++ b/Ashx/SIGWeb.ashx
@@ -940,6 +940,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
MostrarTodosAlmacenes = True
End If
+ If (usuario.Empresa.Funcionalidad(578) = "1") AndAlso Pagina.Contiene("ventas/ventas") Then 'sms
+ MostrarTodosAlmacenes = True
+ End If
+
Dim objInv As New ClsInventarios
Try
If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa, CveMarca, MostrarTodosAlmacenes:=MostrarTodosAlmacenes, CveAlmacen:=CveAlmacen) Then
diff --git a/Ashx/TareasProgramadas.ashx b/Ashx/TareasProgramadas.ashx
index 38dde9ef3..706130f8d 100644
--- a/Ashx/TareasProgramadas.ashx
+++ b/Ashx/TareasProgramadas.ashx
@@ -353,7 +353,8 @@ Public Class TareasProgramadas : Implements IHttpHandler
Dim Usuario As String = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
Dim Contrasenia As String = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa)
- UsuarioActual.CveEmpresa = CveEmpresa
+ UsuarioActual.CveEmpresa = CveEmpresa
+ HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
CreaObjetoEmpresa(UsuarioActual)
End If
End If
diff --git a/Bancos/CuentasBancariasDetalle.aspx b/Bancos/CuentasBancariasDetalle.aspx
index e14ad0fb8..a5bf33e69 100644
--- a/Bancos/CuentasBancariasDetalle.aspx
+++ b/Bancos/CuentasBancariasDetalle.aspx
@@ -160,6 +160,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
Estatus:
diff --git a/Bancos/CuentasBancariasDetalle.aspx.vb b/Bancos/CuentasBancariasDetalle.aspx.vb
index f6a001b2e..2a64a3b22 100644
--- a/Bancos/CuentasBancariasDetalle.aspx.vb
+++ b/Bancos/CuentasBancariasDetalle.aspx.vb
@@ -121,8 +121,11 @@ Partial Class Bancos_CuentasBancariasDetalle
Private Sub CargarBanco()
DdlBanco.DataSource = GlobalDTBancos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlBanco.DataBind()
-
- DdlBanco.Items.Add(New ListItem("Empresa", "0"))
+ DdlBanco.Items.Add(New ListItem("Empresa", "0"))
+
+ DdlSubProyectos.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
+ DdlSubProyectos.DataBind()
+ DdlSubProyectos.Items.Insert(0, New ListItem("-", "-1"))
End Sub
Private Sub CargarMoneda()
DdlMoneda.DataSource = GlobalDTMonedas
@@ -227,10 +230,10 @@ Partial Class Bancos_CuentasBancariasDetalle
TxtLimiteCredito.Text = ObjCuentasBancariasDetalle.LimiteCredito.ToString
DdlTipoCuenta.SelectedValue = ObjCuentasBancariasDetalle.CveTipoCuenta.ToString
+ DdlSubProyectos.SelectedValueExist(ObjCuentasBancariasDetalle.CveSubProyecto.ToString)
DdlTipoCuenta_SelectedIndexChanged(DdlTipoCuenta, EventArgs.Empty)
-
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
DDlCuentaContable.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaConta.ToString)
DdlCuentaContableComplementaria.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaContaComplementaria.ToString)
@@ -289,7 +292,8 @@ Partial Class Bancos_CuentasBancariasDetalle
If ObjCuentasBancariasDetalle.AddBancosCuentas(DdlBanco.SelectedValue.ToEntero, DdlTipoCuenta.SelectedValue.ToEntero, TxtNumCuenta.Text.Trim,
TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0, TxtLimiteCredito.Text.Trim.ToDouble,
"", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, If(ChkLayout.Checked, TxtConvenio.Text, ""), ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked,
- TieneTerminal:=ChkTieneTerminal.Checked, CveCuentaPadre:=DdlCuentaPadre.SelectedValue.ToEntero) Then
+ TieneTerminal:=ChkTieneTerminal.Checked,
+ CveCuentaPadre:=DdlCuentaPadre.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero) Then
ViewState("CveCuenta") = ObjCuentasBancariasDetalle.TCveCuenta
Else
ErrorUsuarios = True
@@ -322,7 +326,8 @@ Partial Class Bancos_CuentasBancariasDetalle
Else
If ObjCuentasBancariasDetalle.UpdateBancosCuentas(DdlBanco.SelectedValue.ToEntero, DdlTipoCuenta.SelectedValue.ToEntero, TxtNumCuenta.Text.Trim, TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0,
TxtLimiteCredito.Text.Trim.ToDouble, "", ChkEstatus.Checked, CveCuenta, TxtConvenio.Text,
- ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked, TieneTerminal:=ChkTieneTerminal.Checked, CveCuentaPadre:=DdlCuentaPadre.SelectedValue.ToEntero) Then
+ ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked, TieneTerminal:=ChkTieneTerminal.Checked,
+ CveCuentaPadre:=DdlCuentaPadre.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero) Then
'CargaDatos()
GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing
'If ObjCuentasBancariasDetalle.GetBancosCuentasUsuarios(-1) Then
@@ -409,6 +414,11 @@ Partial Class Bancos_CuentasBancariasDetalle
TxtLimiteCredito.Visible = False
RFVLimiteCredito.Enabled = False
VCELimiteCredito.Enabled = False
+ If DdlTipoCuenta.SelectedValue = "1" Then
+ trSubProyecto.Visible = True
+ Else
+ trSubProyecto.Visible = False
+ End If
End If
CargaCuentasContables()
diff --git a/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx
index 45747d1ea..ec3f491a6 100644
--- a/Bancos/DepositosCaja.aspx
+++ b/Bancos/DepositosCaja.aspx
@@ -147,9 +147,9 @@
-
+
-
+
@@ -171,6 +171,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb
index ca047fa89..9551eba19 100644
--- a/Bancos/DepositosCaja.aspx.vb
+++ b/Bancos/DepositosCaja.aspx.vb
@@ -61,6 +61,8 @@ Partial Class Bancos_DepositosCaja
DivRowCuenta.Visible = True
End If
+ If UsuarioActual.CveEmpresa.Contiene(140, 141) Then divTipoPago.Visible = False : divTipoPago1.Visible = False
+
DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
DdlSubProyectos.DataBind()
DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
@@ -284,15 +286,15 @@ Partial Class Bancos_DepositosCaja
End If
End If
- Dim CveTransaccionBanco As Integer = 13
+ Dim CveTransaccionBanco As Integer = DdlTipoDeposito.SelectedValue.ToEntero
If TotalImporte < 0 Then 'que es una devolución, entonces como es negativo, se cambia el concetpo de bancos, por condición de trigger
CveTransaccionBanco = 6
End If
- If DdlTipoPago.SelectedValue.Contiene("11", "12") Then ' cuando son pagos con tarjetas
- CveTransaccionBanco = DdlTipoPago.SelectedValue.ToEntero
- End If
+ 'If DdlTipoPago.SelectedValue.Contiene("11", "12") Then ' cuando son pagos con tarjetas
+ ' CveTransaccionBanco = DdlTipoPago.SelectedValue.ToEntero
+ 'End If
'código temporal, para claudia y toñita, monge, anadelia, alba,patricia
If UsuarioActual.CveUsuario.Contiene(1937, 2452, 3358, 3033, 2897, 2560) Then
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index e48061d12..b91ea0f79 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -646,7 +646,7 @@ Partial Class Bancos_IE
If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
DivOtrosIngresosEgresos.Visible = True
End If
- If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso UsuarioActual.CveRol = 1 Then
+ If UsuarioActual.CveRol = 1 Then
ChkAnticipoPuntual.Visible = True
End If
@@ -5212,8 +5212,9 @@ Partial Class Bancos_IE
Private Sub EnviarCorreoNotificacion(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActualNotificar As Usuario, MostarAlert As Boolean)
Try
- Dim Hilo As New Threading.Thread(Sub() EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar))
- Hilo.Start()
+ EnviarCorreoNotificacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar)
+ 'Dim Hilo As New Threading.Thread(Sub() EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar))
+ 'Hilo.Start()
If MostarAlert Then
Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
RegistraScript("$('#ModalDivMail').modal('hide');")
@@ -5226,7 +5227,7 @@ Partial Class Bancos_IE
End Sub
- Private Sub EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActualNotificar As Usuario)
+ Private Sub EnviarCorreoNotificacionHilo(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActualNotificar As Usuario)
Try
Dim ObjBancos As New ClsBancos()
@@ -5548,8 +5549,8 @@ Partial Class Bancos_IE
UpEliminarCotizacion.Update()
End Sub
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
- RVTxtFechaDocumento.MaximumValue = NowADS().ToShortDateString
- Calendario.EndDate = NowADS()
+ RVTxtFechaDocumento.MaximumValue = NowADS.AddDays(3).ToShortDateString
+ Calendario.EndDate = NowADS.AddDays(3)
End Sub
Private Sub CargaOCRelacionadas()
diff --git a/Bancos/PagoElectronicoGrupos.aspx.vb b/Bancos/PagoElectronicoGrupos.aspx.vb
index 801a3d737..f3cac6682 100644
--- a/Bancos/PagoElectronicoGrupos.aspx.vb
+++ b/Bancos/PagoElectronicoGrupos.aspx.vb
@@ -2999,9 +2999,10 @@ Partial Class Bancos_PagoElectronicoGrupos
Private Sub EnviarCorreoNotificacion(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActualNotificar As Usuario, MostarAlert As Boolean)
Try
- Dim Hilo As New Threading.Thread(Sub() EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar))
- Hilo.Start()
+ 'Dim Hilo As New Threading.Thread(Sub() EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar))
+ 'Hilo.Start()
+ EnviarCorreoNotificacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar)
If MostarAlert Then
Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
@@ -3017,7 +3018,7 @@ Partial Class Bancos_PagoElectronicoGrupos
End Try
End Sub
- Private Sub EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActualNotificar As Usuario)
+ Private Sub EnviarCorreoNotificacionHilo(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActualNotificar As Usuario)
Try
Dim ObjBancos As New ClsBancos()
diff --git a/Bancos/PopIECompras.aspx b/Bancos/PopIECompras.aspx
index 94086dd01..48e01ca67 100644
--- a/Bancos/PopIECompras.aspx
+++ b/Bancos/PopIECompras.aspx
@@ -47,7 +47,7 @@
Viaticos - PersonalDeudoresAcreedores
- Ventas
+ Ventas
diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb
index 0ecfd9ef6..4362fffd8 100644
--- a/Bancos/PopIECompras.aspx.vb
+++ b/Bancos/PopIECompras.aspx.vb
@@ -337,11 +337,11 @@ Partial Class Bancos_PopIECompras
CargaTipoTransaccion(TipoTransaccion)
CargaCuentas()
- Dim ObjVentas As New ClsVentas
- If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", -1, "-1", -1, -1, -1, -1, "-1", "-1", "-1", ClienteRFC:=RFCProveedor, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
- RBLContado.Items(4).Enabled = True
- End If
- ObjVentas.Dispose()
+ 'Dim ObjVentas As New ClsVentas
+ 'If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", -1, "-1", -1, -1, -1, -1, "-1", "-1", "-1", ClienteRFC:=RFCProveedor, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
+ ' RBLContado.Items(4).Enabled = True
+ 'End If
+ 'ObjVentas.Dispose()
If CveMoneda = 2 Then
ChkPagarPesos.Visible = True
@@ -1522,9 +1522,10 @@ Partial Class Bancos_PopIECompras
Private Sub EnviarCorreoNotificacion(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActualNotificar As Usuario, MostarAlert As Boolean)
Try
- Dim Hilo As New Threading.Thread(Sub() EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar))
- 'Dim Hilo As New Threading.Thread( EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar))
- Hilo.Start()
+ EnviarCorreoNotificacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar)
+ 'Dim Hilo As New Threading.Thread(Sub() EnviarCorreoNotificacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar))
+ ''Dim Hilo As New Threading.Thread( EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar))
+ 'Hilo.Start()
If MostarAlert Then
@@ -1541,7 +1542,7 @@ Partial Class Bancos_PopIECompras
End Try
End Sub
- Private Sub EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActualNotificar As Usuario)
+ Private Sub EnviarCorreoNotificacionHilo(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActualNotificar As Usuario)
Try
Dim ObjBancos As New ClsBancos()
diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx
index 1b1028021..1e7945306 100644
--- a/Bancos/ProveedoresAbonar.aspx
+++ b/Bancos/ProveedoresAbonar.aspx
@@ -338,13 +338,8 @@
-
-
-
-
-
-
-
+
+
diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb
index f4c14812e..a1791b726 100644
--- a/Bancos/ProveedoresAbonar.aspx.vb
+++ b/Bancos/ProveedoresAbonar.aspx.vb
@@ -317,9 +317,6 @@ Partial Class Bancos_ProveedoresAbonar
chkaplicaDescuento.Visible = True
End If
-
- tmpValida()
-
End If
End Sub
@@ -1383,36 +1380,32 @@ Partial Class Bancos_ProveedoresAbonar
Private Sub EnviarCorreoNotificacion(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActualNotificar As Usuario, MostarAlert As Boolean)
Try
- Dim Hilo As New Threading.Thread(Sub() EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar))
+ EnviarCorreoNotificacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar)
+ 'Dim Hilo As New Threading.Thread(Sub() EnviarCorreoNotificacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar))
'Dim Hilo As New Threading.Thread( EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar))
- Hilo.Start()
+ 'Hilo.Start()
If MostarAlert Then
- Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
+ Alert("El correo se envió correctamente", TipoMensaje.ToastInformacion)
End If
Catch ex As Exception
-
If MostarAlert Then
Alert("No se pudo enviar el correo electrónico.", TipoMensaje.MsgError)
End If
-
-
End Try
End Sub
- Private Sub EnviarCorreoNotifiMandaCorreocacionHilo(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActualNotificar As Usuario)
-
+ Private Sub EnviarCorreoNotificacionHilo(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActualNotificar As Usuario)
Try
Dim ObjBancos As New ClsBancos()
If ObjBancos.NotificacionPago(CveIENotificar, CorreoNotificarA, CopiaPara, UsuarioActualNotificar) Then
- Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
+ Alert("El correo se envió correctamente", TipoMensaje.ToastInformacion)
Else
Alert("No se pudo enviar el correo electrónico.", TipoMensaje.MsgError)
End If
-
ObjBancos.Dispose()
Catch ex As Exception
GuardaLog("Error al enviar notificación de pago ProveedoresAbonar --> " & ex.StackTrace.ToString)
@@ -1714,9 +1707,5 @@ Partial Class Bancos_ProveedoresAbonar
End If
End Sub
-
- Protected Sub Button1_Click(sender As Object, e As EventArgs)
- tmpValida()
- End Sub
End Class
diff --git a/Bancos/RepCortes.aspx b/Bancos/RepCortes.aspx
index f04019057..9f9830a38 100644
--- a/Bancos/RepCortes.aspx
+++ b/Bancos/RepCortes.aspx
@@ -243,7 +243,7 @@
-
+
diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb
index ea4d9efb6..bd784469f 100644
--- a/Bancos/RepCortes.aspx.vb
+++ b/Bancos/RepCortes.aspx.vb
@@ -65,7 +65,9 @@ Partial Class Bancos_RepCortes
txtFechaVI.Text = NowADS().ToShortDateString
txtFechaVF.Text = NowADS().ToShortDateString
Me.Form.DefaultButton = BtnConsultar.UniqueID
- CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, LblSubProyecto)
+ Dim AplicaTodos As String = ""
+ If UsuarioActual.CveEmpresa.Contiene(140, 141) Then AplicaTodos = "Todos"
+ CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, LblSubProyecto, AplicaTodos:=AplicaTodos)
End If
End Sub
@@ -86,12 +88,18 @@ Partial Class Bancos_RepCortes
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
GvDatos.Columns(3).Visible = True
GvDatos.Columns(4).Visible = True
- GvDatos.Columns(13).Visible = True
End If
+ GvP.DataBind()
+ GvDep.DataBind()
+ GvPorIVA.DataBind()
+ GvAnexo.DataBind()
+ GvD.DataBind()
+
GvDatos.DataSource = DtCortes
GvDatos.DataBind()
UPDatos.Update()
+ UPPDetalle.Update()
End Sub
#End Region
@@ -232,10 +240,17 @@ Partial Class Bancos_RepCortes
GvDep.DataBind()
GvPorIVA.DataBind()
- If UsuarioActual.CveEmpresa = 193 Then
+ If UsuarioActual.CveEmpresa.Contiene(189, 193, 195, 196, 197) Then
DivAnexo.Visible = True
+ Dim CveCuenta As Integer = 0
+ CveCuenta = If(UsuarioActual.CveEmpresa = 193, 186367, 0)
+ If DdlSubProyectos.SelectedValue = "12756" Then 'nav
+ CveCuenta = 188796
+ End If
+ If DdlSubProyectos.SelectedValue = "12755" Then 'hillo
+ CveCuenta = 188795
+ End If
- Dim CveCuenta As Integer = 186367
Using ObjConta As New ClsContabilidad
If ObjConta.GetAnexoCatalogo(CveCuenta, Fecha.ToDate(), Fecha.ToDate(), -1, -1, -1, UsuarioActual.CveEmpresa, 1) Then
GvAnexo.DataSource = ObjConta.DtResultados
diff --git a/Bin/ClbNegBICFDv3_2.dll b/Bin/ClbNegBICFDv3_2.dll
deleted file mode 100644
index 8ccf14b8c..000000000
Binary files a/Bin/ClbNegBICFDv3_2.dll and /dev/null differ
diff --git a/Bin/GoCfdi.dll b/Bin/GoCfdi.dll
index 12e6171e5..5ef366436 100644
Binary files a/Bin/GoCfdi.dll and b/Bin/GoCfdi.dll differ
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index ace5f8509..7d5dc99d7 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -10,10 +10,8 @@ Imports System.Threading.Tasks
Imports Newtonsoft.Json
Imports Extensiones
Imports MoreLinq
-Imports ClsPaginas
Imports System.Data.SqlClient
-
-
+Imports ClsPaginas
Partial Class Compras_Compras
Inherits ClsPaginas
@@ -1857,7 +1855,8 @@ Partial Class Compras_Compras
If Validada And Not EnListadoEFOS Then
Try
- XMLDoc.LoadXml(File.ReadAllText(Archivo).Replace("<br>", "").Replace("<", "").Replace("o;?", ""))
+ ' &HFEFF, es el código ZERO WIDTH NO-BREAK SPACE
+ XMLDoc.LoadXml(File.ReadAllText(Archivo).Replace("<br>", "").Replace("<", "").Replace("o;?", "").Replace(ChrW(&HFEFF), ""))
Catch ex As Exception
Try
Dim oReader As New StreamReader(Archivo, Encoding.GetEncoding("ISO-8859-1"))
@@ -1867,411 +1866,416 @@ Partial Class Compras_Compras
GuardaLog("Error al intentar leer el XML del SAT. Error:" & ex2.ToString())
End Try
End Try
+
+ If XMLDoc.InnerXml = "" Then
+ Alert("No se pudo procesar el archivo xml.", TipoMensaje.MsgError)
+ Return ""
+ End If
+
CreaDTConceptos()
CargaComprobanteXML(XMLDoc)
-
If NuevaValidacionXML = 1 OrElse (Version = "3.3" OrElse Version = "4.0") Then
- Dim Xml As String
- Dim nodo As XmlNode = XMLDoc.DocumentElement
- Dim Version As String = ValorXML(nodo, "version")
- Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
- Dim cfdVer As String = ""
- Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
+ Dim Xml As String
+ Dim nodo As XmlNode = XMLDoc.DocumentElement
+ Dim Version As String = ValorXML(nodo, "version")
+ Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
+ Dim cfdVer As String = ""
+ Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
- If Version = "3.2" Then
- Prefijo = "cfd"
- cfdVer = "http://www.sat.gob.mx/cfd/2"
- ElseIf Version = "3.3" Then
- cfdVer = "http://www.sat.gob.mx/cfd/3"
- Else ' se considera que es la version 4.0
- cfdVer = "http://www.sat.gob.mx/cfd/4"
+ If Version = "3.2" Then
+ Prefijo = "cfd"
+ cfdVer = "http://www.sat.gob.mx/cfd/2"
+ ElseIf Version = "3.3" Then
+ cfdVer = "http://www.sat.gob.mx/cfd/3"
+ Else ' se considera que es la version 4.0
+ cfdVer = "http://www.sat.gob.mx/cfd/4"
+ End If
+
+ 'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
+
+ namespaces.AddNamespace(Prefijo, cfdVer)
+ namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas")
+ namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
+ namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
+ namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal")
+
+ Dim nodeconceptos As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Conceptos", Prefijo), namespaces)
+ Xml = Replace(nodeconceptos.OuterXml, "", "") 'salto de linea html
+ Xml = Xml.Replace("<br>", "")
+ Xml = Xml.Replace("<", "")
+ 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
+ Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
+ For Each drr As DataRow In TmpDT.FiltraParametros("ClaveProdServ = '01010101'").Rows
+ ProductosCodigoSATNoPermitidos.AppendFormat("{0}", drr("PS"))
+ Next
+
+ If TmpDT.MAX("RetISRPorcentaje").ToDecimal = 0.0125 Then RetISRResico = True
+ If TmpDT.MAX("RetIVAPorcentaje").ToDecimal = 0.04 Then RetIVAFlete = True
+
+ If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
+ Dim mensajeAdvertencia As String = String.Format("El XML que intenta registrar contiene partidas o artículos con código SAT ‘01010101’ el cual no es aceptado, hable con su proveedor para cancelar y/o refacturar un XML válido. Partidas o artículos con código ‘01010101’: {0}", ProductosCodigoSATNoPermitidos.ToString)
+ Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
+ If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso Not UsuarioActual.CveUsuario.Contiene(1719, 1721) Then BtnGuardar.Enabled = False '' solo se activa para el usuario Sara.JAM
+ BtnGuardar.ToolTip = "No se permite registrar facturas con conceptos con código '01010101'. Solicite al proveedor un nuevo comprobante."
+ End If
+
+ End If
+
+
+
+ Dim SbValRet As New StringBuilder
+ For Each concepto As XmlNode In nodeconceptos
+ ' Obtener la descripción del concepto
+ Dim descripcion As String = ValorXML(concepto, "Descripcion")
+ Dim importeValue As Decimal = Decimal.Parse(ValorXML(concepto, "Importe"))
+
+ ' Seleccionar el nodo de Impuestos dentro de Concepto, si existe
+ Dim impuestosNode As XmlNode = concepto.SelectSingleNode("cfdi:Impuestos", namespaces)
+
+ If Not impuestosNode Is Nothing Then
+ ' Seleccionar los nodos de Retencion dentro de Impuestos
+ Dim retenciones As XmlNodeList = impuestosNode.SelectNodes("cfdi:Retenciones/cfdi:Retencion", namespaces)
+ For Each retencion As XmlNode In retenciones
+ ' Obtener los valores de los atributos Base e Importe
+ Dim baseValue As Decimal = Decimal.Parse(ValorXML(retencion, "Base"))
+ Dim impuesto As String = ValorXML(retencion, "Impuesto")
+
+ If impuesto = "001" Then
+ impuesto = "Retención ISR"
+ ElseIf impuesto = "002" Then
+ impuesto = "Retención IVA"
+ ElseIf impuesto = "003" Then
+ impuesto = "IEPS"
+ End If
+
+
+ ' Validar si Base coincide con Importe
+ If baseValue <> importeValue Then
+ 'SbValRet.Append($"La base e importe de la retención del impuesto {impuesto} no coinciden para {descripcion}. Base: {baseValue.ToString()}, Importe: {importeValue.ToString()} ")
+ SbValRet.Append($"Producto: {descripcion} La base e importe del impuesto {impuesto} no coincide Base: {baseValue.ToString()}, Importe Producto: {importeValue.ToString()} ")
+ End If
+ Next
+ End If
+ Next
+
+ If SbValRet.ToString.Trim.Length > 0 Then
+ Alert(SbValRet.ToString, TipoMensaje.MsgAdvertencia)
+ End If
+
+
+
+ Else
+ CargaConceptosXML(XMLDoc)
End If
- 'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
+ Select Case TipoComprobante
+ Case "ingreso" : DdlTipoComprobante.SelectedValue = "Fac" : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC")) : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
+ Case "egreso" : DdlTipoComprobante.SelectedValue = "NC" : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Fac")) : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) : ChkAplicaNotaCredito.Enabled = False
+ Case "I"
+ DdlTipoComprobante.SelectedValue = "Fac"
+ DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC"))
+ DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
+ DdlTipoCompra.Items.Remove(DdlTipoCompra.Items.FindByValue("6"))
+ DdlTipoCompra.Items.Remove(DdlTipoCompra.Items.FindByValue("11"))
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then DdlTipoCompra.Items.Add(New ListItem("Recolección", "14"))
+ Case "E"
+ DdlTipoComprobante.SelectedValue = "NC"
+ DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Fac"))
+ DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
+ ChkAplicaNotaCredito.Enabled = False
- namespaces.AddNamespace(Prefijo, cfdVer)
- namespaces.AddNamespace("aerolineas", "http://www.sat.gob.mx/aerolineas")
- namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
- namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
- namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal")
+ DdlTipoCompra.Items.Clear()
+ DdlTipoCompra.Items.Add(New ListItem("Seleccione", "-1"))
+ DdlTipoCompra.Items.Add(New ListItem("NC Con Productos", "6"))
+ DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
+ DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
+ DdlTipoCompra.Items.Add(New ListItem("Garantía", "12"))
+ Case "T"
+ DdlTipoCompra.Items.Clear()
+ DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
+ DdlTipoComprobante.SelectedValue = "Fac"
+ DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC"))
+ DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
- Dim nodeconceptos As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Conceptos", Prefijo), namespaces)
- Xml = Replace(nodeconceptos.OuterXml, "", "") 'salto de linea html
- Xml = Xml.Replace("<br>", "")
- Xml = Xml.Replace("<", "")
- Xml = Xml.Replace("&", "") 'adicional, si hay otros
+ End Select
- If ObjeFacturas.GetFacturasComparacionXML(Version, Xml, UsuarioActual.CveEmpresa) Then
- TmpDT = ObjeFacturas.DtResultados
- TmpDT.Columns.Add("CveSATPSActualizado")
- SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL
+ 'DIV ALIAS
+ CargaPSAlias()
+
+ RFC = dr("RFCDe").ToString
+ RFCProveedor = RFC
+ TxtFecha.Text = dr("FechaFactura").ToString.ToDate.ToShortDateString
+ TxtSerie.Text = dr("Serie").ToString
+ TxtFolio.Text = dr("Folio").ToString
+ DdlValidadaSAT.SelectedValue = If(dr("FueValidado").ToString.Contiene("Si", "1"), "Si", "No")
+ DdlValidadaSAT.Enabled = False
+ LblTipoFact.Text = dr("TipoFactura").ToString
+ SerieVieja = dr("Serie").ToString
+ LblMetodoPago.Text = MetodoPago
+
+ Dim SubTotal2, IVA, IEPS As Decimal
+ IVA = TrasladoIVA
+
+ If Not UsuarioActual.TienePermisoProceso(130) Then
+ TxtFolio.Enabled = False
+ TxtSerie.Enabled = False
+ End If
+
+ 'PERMISO PARA MODIFICACIÓN DE FECHA AUN CON FACTURA
+ TxtFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
+ ImgFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
+ CEFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
+
+ TxtSubTotal.Enabled = False
+ TxtDescuento.Enabled = False
+ TxtSubTotal2.Enabled = False
+ TxtIVA.Enabled = False
+ TxtTotal.Enabled = False
+ DdlProveedor.Enabled = False
+
+ If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True : TxtSerie.Enabled = True
+
+ If UsuarioActual.TienePermisoProceso(112) Then
+ PermisoEdicionManual = True
+ TxtSubTotal.Enabled = True
+ TxtDescuento.Enabled = True
+ TxtSubTotal2.Enabled = True
+ TxtIVA.Enabled = True
+ TxtTotal.Enabled = True
+ End If
+
+ If UsuarioActual.Empresa.Funcionalidad(118) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Fac" Then
+ VerVales.Visible = True
+ End If
+
+ If TieneAnticiposXML Then 'si tiene anticipos, limpia los descuentos
+ 'LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
+ TxtDescuento.Text = "0.00"
+ LblAmortizacion.Text = Descuentos.FormatoNumero
+ 'limpia los descuentos
+ For Each drr As DataRow In TmpDT.Rows
+ 'drr("Total") = drr("Total").ToString.ToDecimal + drr("Descuento").ToString.ToDecimal
+ drr("Amortizacion") = drr("Descuento") 'pasamos el importe de descuento a amortizacion
+ drr("Descuento") = 0.00
+ Next
+ Amortizaciones = Descuentos
+ Descuentos = 0
+ End If
+
+ Dim Msg As String = ""
+ 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
+ 'PRUEBA
+ 'http://rm/Compras/Compras.aspx?CveFactura=122518 Emp: 48
- AddPS2(False)
+ 'tTotal = Math.Round(SubTotal2 + IVA - RetencionIVA - RetencionISR + IEPS + OtrosImpuestos, 2)
+ HdnCompraSaldo.Value = Total.ToString
+ CompraSaldo = Total
+ Dim AjustaUltimoConcepto As Boolean = False
- 'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101
- Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
- For Each drr As DataRow In TmpDT.FiltraParametros("ClaveProdServ = '01010101'").Rows
- ProductosCodigoSATNoPermitidos.AppendFormat("{0}", drr("PS"))
- Next
-
- If TmpDT.MAX("RetISRPorcentaje").ToDecimal = 0.0125 Then RetISRResico = True
- If TmpDT.MAX("RetIVAPorcentaje").ToDecimal = 0.04 Then RetIVAFlete = True
-
- If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
- Dim mensajeAdvertencia As String = String.Format("El XML que intenta registrar contiene partidas o artículos con código SAT ‘01010101’ el cual no es aceptado, hable con su proveedor para cancelar y/o refacturar un XML válido. Partidas o artículos con código ‘01010101’: {0}", ProductosCodigoSATNoPermitidos.ToString)
- Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
- If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso Not UsuarioActual.CveUsuario.Contiene(1719, 1721) Then BtnGuardar.Enabled = False '' solo se activa para el usuario Sara.JAM
- BtnGuardar.ToolTip = "No se permite registrar facturas con conceptos con código '01010101'. Solicite al proveedor un nuevo comprobante."
+ 'AGREGA IEPS COMO CONCEPTO
+ If TrasladoIEPS > 0 And UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero > 0 Then
+ AgregarConceptoIEPS(TrasladoIEPS, UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero)
+ ' TrasladoIEPS = 0
+ End If
+ 'en otro impuesto lo esta registrando en ajuste en automatico
+ If OtrosImpuestos > 0 Then
+ AjustaUltimoConcepto = True
End If
- End If
-
-
-
- Dim SbValRet As New StringBuilder
- For Each concepto As XmlNode In nodeconceptos
- ' Obtener la descripción del concepto
- Dim descripcion As String = ValorXML(concepto, "Descripcion")
- Dim importeValue As Decimal = Decimal.Parse(ValorXML(concepto, "Importe"))
-
- ' Seleccionar el nodo de Impuestos dentro de Concepto, si existe
- Dim impuestosNode As XmlNode = concepto.SelectSingleNode("cfdi:Impuestos", namespaces)
-
- If Not impuestosNode Is Nothing Then
- ' Seleccionar los nodos de Retencion dentro de Impuestos
- Dim retenciones As XmlNodeList = impuestosNode.SelectNodes("cfdi:Retenciones/cfdi:Retencion", namespaces)
- For Each retencion As XmlNode In retenciones
- ' Obtener los valores de los atributos Base e Importe
- Dim baseValue As Decimal = Decimal.Parse(ValorXML(retencion, "Base"))
- Dim impuesto As String = ValorXML(retencion, "Impuesto")
-
- If impuesto = "001" Then
- impuesto = "Retención ISR"
- ElseIf impuesto = "002" Then
- impuesto = "Retención IVA"
- ElseIf impuesto = "003" Then
- impuesto = "IEPS"
- End If
-
-
- ' Validar si Base coincide con Importe
- If baseValue <> importeValue Then
- 'SbValRet.Append($"La base e importe de la retención del impuesto {impuesto} no coinciden para {descripcion}. Base: {baseValue.ToString()}, Importe: {importeValue.ToString()} ")
- SbValRet.Append($"Producto: {descripcion} La base e importe del impuesto {impuesto} no coincide Base: {baseValue.ToString()}, Importe Producto: {importeValue.ToString()} ")
- End If
- Next
+ If RFC = "CFE370814QI0" Then ' RFC de CFE, se hace un ajuste por diferencia para sacar el DAP
+ 'OtrosImpuestos = Total - (SubTotal2 + IVA)
+ 'este importe lo vamos a meter al gasto
+ 'AjustaImporteUltimoConcepto(OtrosImpuestos)
+ OtrosImpuestos = 1
+ AjustaUltimoConcepto = True
+ 'SubTotal2 = SubTotal
End If
- Next
- If SbValRet.ToString.Trim.Length > 0 Then
- Alert(SbValRet.ToString, TipoMensaje.MsgAdvertencia)
- End If
+ Dim SubTotalReal As Decimal = 0
+ SubTotalReal = Math.Round(Total + RetencionISR + RetencionIVA - IVA + Descuentos - TrasladoIEPS, 2) ' NO se incluye otros impuestos para ajustar esa cifra
+ Dim DiferenciaTotales As Decimal = SubTotalReal - Math.Round(SubTotalConceptos, 2)
+ If DiferenciaTotales <> 0 Then
+ 'Verificamos IEPS y Otros Impuestos
+ 'restricccion general, que si el subtotal de los conceptos no cuadra con Total + RetISR + RetIVA - IVA <> SubTotalConeptos, ajuste al final
+ If TrasladoIEPS > 0 OrElse OtrosImpuestos > 0 OrElse Math.Abs(DiferenciaTotales) < 1 Then
+ 'Condicion necesaria cuando hay IVA pero no hay diferencia
+ If DiferenciaTotales <> 0 Then
- Else
- CargaConceptosXML(XMLDoc)
- End If
+ If DiferenciaTotales < 50 OrElse AjustaUltimoConcepto = True Then
+ Dim IA As Decimal = Total + RetencionISR + RetencionIVA - IVA - SubTotalConceptos - TrasladoIEPS + Descuentos
+ AjustaImporteUltimoConcepto(IA, True)
- Select Case TipoComprobante
- Case "ingreso" : DdlTipoComprobante.SelectedValue = "Fac" : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC")) : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
- Case "egreso" : DdlTipoComprobante.SelectedValue = "NC" : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Fac")) : DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) : ChkAplicaNotaCredito.Enabled = False
- Case "I"
- DdlTipoComprobante.SelectedValue = "Fac"
- DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC"))
- DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
- DdlTipoCompra.Items.Remove(DdlTipoCompra.Items.FindByValue("6"))
- DdlTipoCompra.Items.Remove(DdlTipoCompra.Items.FindByValue("11"))
- If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then DdlTipoCompra.Items.Add(New ListItem("Recolección", "14"))
- Case "E"
- DdlTipoComprobante.SelectedValue = "NC"
- DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Fac"))
- DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
- ChkAplicaNotaCredito.Enabled = False
+ ElseIf DiferenciaTotales > 50 Then
+ PnlAjusteProductos.Visible = True
+ Dim Porcentaje As Double = Math.Round((SubTotalConceptos - SubTotalReal) / SubTotalConceptos * 100, 2)
+ TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero
+ Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente ")
+ ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
- DdlTipoCompra.Items.Clear()
- DdlTipoCompra.Items.Add(New ListItem("Seleccione", "-1"))
- DdlTipoCompra.Items.Add(New ListItem("NC Con Productos", "6"))
- DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
- DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
- DdlTipoCompra.Items.Add(New ListItem("Garantía", "12"))
- Case "T"
- DdlTipoCompra.Items.Clear()
- DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
- DdlTipoComprobante.SelectedValue = "Fac"
- DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("NC"))
- DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("DEV"))
-
- End Select
-
- 'DIV ALIAS
- CargaPSAlias()
-
- RFC = dr("RFCDe").ToString
- RFCProveedor = RFC
- TxtFecha.Text = dr("FechaFactura").ToString.ToDate.ToShortDateString
- TxtSerie.Text = dr("Serie").ToString
- TxtFolio.Text = dr("Folio").ToString
- DdlValidadaSAT.SelectedValue = If(dr("FueValidado").ToString.Contiene("Si", "1"), "Si", "No")
- DdlValidadaSAT.Enabled = False
- LblTipoFact.Text = dr("TipoFactura").ToString
- SerieVieja = dr("Serie").ToString
- LblMetodoPago.Text = MetodoPago
-
- Dim SubTotal2, IVA, IEPS As Decimal
- IVA = TrasladoIVA
-
- If Not UsuarioActual.TienePermisoProceso(130) Then
- TxtFolio.Enabled = False
- TxtSerie.Enabled = False
- End If
-
- 'PERMISO PARA MODIFICACIÓN DE FECHA AUN CON FACTURA
- TxtFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
- ImgFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
- CEFecha.Enabled = UsuarioActual.TienePermisoProceso(216)
-
- TxtSubTotal.Enabled = False
- TxtDescuento.Enabled = False
- TxtSubTotal2.Enabled = False
- TxtIVA.Enabled = False
- TxtTotal.Enabled = False
- DdlProveedor.Enabled = False
-
- If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True : TxtSerie.Enabled = True
-
- If UsuarioActual.TienePermisoProceso(112) Then
- PermisoEdicionManual = True
- TxtSubTotal.Enabled = True
- TxtDescuento.Enabled = True
- TxtSubTotal2.Enabled = True
- TxtIVA.Enabled = True
- TxtTotal.Enabled = True
- End If
-
- If UsuarioActual.Empresa.Funcionalidad(118) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Fac" Then
- VerVales.Visible = True
- End If
-
- If TieneAnticiposXML Then 'si tiene anticipos, limpia los descuentos
- 'LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
- TxtDescuento.Text = "0.00"
- LblAmortizacion.Text = Descuentos.FormatoNumero
- 'limpia los descuentos
- For Each drr As DataRow In TmpDT.Rows
- 'drr("Total") = drr("Total").ToString.ToDecimal + drr("Descuento").ToString.ToDecimal
- drr("Amortizacion") = drr("Descuento") 'pasamos el importe de descuento a amortizacion
- drr("Descuento") = 0.00
- Next
- Amortizaciones = Descuentos
- Descuentos = 0
- End If
-
- Dim Msg As String = ""
- 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
- 'PRUEBA
- 'http://rm/Compras/Compras.aspx?CveFactura=122518 Emp: 48
-
- 'tTotal = Math.Round(SubTotal2 + IVA - RetencionIVA - RetencionISR + IEPS + OtrosImpuestos, 2)
- HdnCompraSaldo.Value = Total.ToString
- CompraSaldo = Total
- Dim AjustaUltimoConcepto As Boolean = False
-
- 'AGREGA IEPS COMO CONCEPTO
- If TrasladoIEPS > 0 And UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero > 0 Then
- AgregarConceptoIEPS(TrasladoIEPS, UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero)
- ' TrasladoIEPS = 0
- End If
- 'en otro impuesto lo esta registrando en ajuste en automatico
- If OtrosImpuestos > 0 Then
- AjustaUltimoConcepto = True
- End If
-
- If RFC = "CFE370814QI0" Then ' RFC de CFE, se hace un ajuste por diferencia para sacar el DAP
- 'OtrosImpuestos = Total - (SubTotal2 + IVA)
- 'este importe lo vamos a meter al gasto
- 'AjustaImporteUltimoConcepto(OtrosImpuestos)
- OtrosImpuestos = 1
- AjustaUltimoConcepto = True
- 'SubTotal2 = SubTotal
- End If
-
- Dim SubTotalReal As Decimal = 0
- SubTotalReal = Math.Round(Total + RetencionISR + RetencionIVA - IVA + Descuentos - TrasladoIEPS, 2) ' NO se incluye otros impuestos para ajustar esa cifra
- Dim DiferenciaTotales As Decimal = SubTotalReal - Math.Round(SubTotalConceptos, 2)
-
- If DiferenciaTotales <> 0 Then
- 'Verificamos IEPS y Otros Impuestos
- 'restricccion general, que si el subtotal de los conceptos no cuadra con Total + RetISR + RetIVA - IVA <> SubTotalConeptos, ajuste al final
- If TrasladoIEPS > 0 OrElse OtrosImpuestos > 0 OrElse Math.Abs(DiferenciaTotales) < 1 Then
-
- 'Condicion necesaria cuando hay IVA pero no hay diferencia
- If DiferenciaTotales <> 0 Then
-
- If DiferenciaTotales < 50 OrElse AjustaUltimoConcepto = True Then
- Dim IA As Decimal = Total + RetencionISR + RetencionIVA - IVA - SubTotalConceptos - TrasladoIEPS + Descuentos
- AjustaImporteUltimoConcepto(IA, True)
-
- ElseIf DiferenciaTotales > 50 Then
- PnlAjusteProductos.Visible = True
- Dim Porcentaje As Double = Math.Round((SubTotalConceptos - SubTotalReal) / SubTotalConceptos * 100, 2)
- TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero
- Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente ")
- ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
-
- 'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
- For Each Row As GridViewRow In GvPS.Rows
- Row.FCLinkButton("imgE").Visible = False
- Row.FCLinkButton("imgD").Visible = False
- Next
+ 'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
+ For Each Row As GridViewRow In GvPS.Rows
+ Row.FCLinkButton("imgE").Visible = False
+ Row.FCLinkButton("imgD").Visible = False
+ Next
+ End If
End If
+ TrasladoIEPS = 0 : OtrosImpuestos = 0 : SubTotal2 = SubTotal
+ Else
+ PnlAjusteProductos.Visible = True
+ Dim Porcentaje As Double = If(SubTotalConceptos > 0, Math.Round((SubTotalConceptos - SubTotalReal) / SubTotalConceptos * 100, 2), 0)
+ TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero
+ Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente ")
+ ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
+
+ 'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
+ For Each Row As GridViewRow In GvPS.Rows
+ Row.FCLinkButton("imgE").Visible = False
+ Row.FCLinkButton("imgD").Visible = False
+ Next
End If
- TrasladoIEPS = 0 : OtrosImpuestos = 0 : SubTotal2 = SubTotal
- Else
- PnlAjusteProductos.Visible = True
- Dim Porcentaje As Double = If(SubTotalConceptos > 0, Math.Round((SubTotalConceptos - SubTotalReal) / SubTotalConceptos * 100, 2), 0)
- TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero
- Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente ")
- ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
-
- 'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
- For Each Row As GridViewRow In GvPS.Rows
- Row.FCLinkButton("imgE").Visible = False
- Row.FCLinkButton("imgD").Visible = False
- Next
End If
- End If
- 'Si no hay diferencias pero tenemos descuento, se ofrece la opcion para ajustar el gasto
- If Descuentos > 0 Then
+ 'Si no hay diferencias pero tenemos descuento, se ofrece la opcion para ajustar el gasto
+ If Descuentos > 0 Then
- '[IPP] PARCHE: Factura TELMEX para APH 12/ENERO/2018
- If CveFactura = 286290 Then
+ '[IPP] PARCHE: Factura TELMEX para APH 12/ENERO/2018
+ If CveFactura = 286290 Then
- Else
- PnlAjusteProductos.Visible = True
- Dim Porcentaje As Double = Math.Round((Descuentos) / (SubTotalConceptos) * 100, 4)
- TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero(4)
- Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente ")
- ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
+ Else
+ PnlAjusteProductos.Visible = True
+ Dim Porcentaje As Double = Math.Round((Descuentos) / (SubTotalConceptos) * 100, 4)
+ TxtAjustePorcentaje.Text = Porcentaje.FormatoNumero(4)
+ Msg &= String.Format("La Factura presenta anomalias en los importes mostrados, estas anomalias impiden que se editen las partidas. Por favor realice el ajuste correspondiente ")
+ ImgBtnBuscarOC.Visible = False : TxtOC.Enabled = False
- 'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
- For Each Row As GridViewRow In GvPS.Rows
- Row.FCLinkButton("imgE").Visible = False
- Row.FCLinkButton("imgD").Visible = False
- Next
+ 'Ocultamos la opcion de Editar y Eliminar hasta que se arreglen las anomalias
+ For Each Row As GridViewRow In GvPS.Rows
+ Row.FCLinkButton("imgE").Visible = False
+ Row.FCLinkButton("imgD").Visible = False
+ Next
+ End If
End If
+
+ SubTotal2 = SubTotalReal - Descuentos
+
+ If Descuentos > 0 Then
+ TrDescuento.Visible = True
+ End If
+
+ If Msg <> "" Then
+ Alert(Msg, TipoMensaje.MsgAdvertencia)
+ BtnGuardar.Enabled = False
+ End If
+ 'AJUSTAMOS SUBTOTAL EN CASO DE SER DIFERENTE AL SUBTOTAL2 DEL XML (TOTAL - IVA)
+ If SubTotal2 <> SubTotal Then
+ SubTotal = SubTotalConceptos
+ End If
+
+ TxtSubTotal.Text = SubTotal.FormatoNumero
+ TxtDescuento.Text = Descuentos.FormatoNumero
+ TxtSubTotal2.Text = SubTotal2.FormatoNumero
+ TxtIVA.Text = IVA.FormatoNumero
+ TxtTotal.Text = Total.ToString.FormatoNumero
+
+ HfTotalCompra.Value = Total.ToString
+ CompraSaldo = Total
+
+ CalculaTotalPorDevengar()
+ TxtDocumentoImporteFE.Text = Total.ToString
+ RVDocumentoImporte.MaximumValue = Math.Round(Total, 2).ToString
+ RVDocumentoImporteFE.MaximumValue = RVDocumentoImporte.MaximumValue
+ RVDocumentoImporteCaja.MaximumValue = RVDocumentoImporte.MaximumValue
+ TxtDocumentoImporte.Text = Total.FormatoNumero
+ TxtDocumentoImporteCaja.Text = Total.FormatoNumero
+ TxtRetIVA.Text = RetencionIVA.FormatoNumero
+ TxtRetISR.Text = RetencionISR.FormatoNumero
+ TxtIEPS.Text = IEPS.FormatoNumero
+ If IEPS > 0 Then TrIEPS.Visible = True
+ If RetencionIVA > 0 Then TrRetIVA.Visible = True
+ If RetencionISR > 0 Then TrRetISR.Visible = True
+ TxtOtrosImpuestos.Text = OtrosImpuestos.FormatoNumero
+ If OtrosImpuestos > 0 Then TrOtrosImpuestos.Visible = True
+
+ HFDiferenciaCompra.Value = TxtTotal.Text
+ 'ASIGNA VALORES ORIGINALES PARA GUARDAR
+ AsignaValoresOriginales(SubTotal, SubTotal2, IVA, RetencionIVA, RetencionISR, Total)
+
End If
+ TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
- SubTotal2 = SubTotalReal - Descuentos
-
- If Descuentos > 0 Then
- TrDescuento.Visible = True
- End If
-
- If Msg <> "" Then
- Alert(Msg, TipoMensaje.MsgAdvertencia)
- BtnGuardar.Enabled = False
- End If
- 'AJUSTAMOS SUBTOTAL EN CASO DE SER DIFERENTE AL SUBTOTAL2 DEL XML (TOTAL - IVA)
- If SubTotal2 <> SubTotal Then
- SubTotal = SubTotalConceptos
- End If
-
- TxtSubTotal.Text = SubTotal.FormatoNumero
- TxtDescuento.Text = Descuentos.FormatoNumero
- TxtSubTotal2.Text = SubTotal2.FormatoNumero
- TxtIVA.Text = IVA.FormatoNumero
- TxtTotal.Text = Total.ToString.FormatoNumero
-
- HfTotalCompra.Value = Total.ToString
- CompraSaldo = Total
-
- CalculaTotalPorDevengar()
- TxtDocumentoImporteFE.Text = Total.ToString
- RVDocumentoImporte.MaximumValue = Math.Round(Total, 2).ToString
- RVDocumentoImporteFE.MaximumValue = RVDocumentoImporte.MaximumValue
- RVDocumentoImporteCaja.MaximumValue = RVDocumentoImporte.MaximumValue
- TxtDocumentoImporte.Text = Total.FormatoNumero
- TxtDocumentoImporteCaja.Text = Total.FormatoNumero
- TxtRetIVA.Text = RetencionIVA.FormatoNumero
- TxtRetISR.Text = RetencionISR.FormatoNumero
- TxtIEPS.Text = IEPS.FormatoNumero
- If IEPS > 0 Then TrIEPS.Visible = True
- If RetencionIVA > 0 Then TrRetIVA.Visible = True
- If RetencionISR > 0 Then TrRetISR.Visible = True
- TxtOtrosImpuestos.Text = OtrosImpuestos.FormatoNumero
- If OtrosImpuestos > 0 Then TrOtrosImpuestos.Visible = True
-
- HFDiferenciaCompra.Value = TxtTotal.Text
- 'ASIGNA VALORES ORIGINALES PARA GUARDAR
- AsignaValoresOriginales(SubTotal, SubTotal2, IVA, RetencionIVA, RetencionISR, Total)
-
- End If
- TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
-
- Dim drMon As DataRow = GlobalDTMonedas.FiltroPrimero(String.Format(" (Abreviatura LIKE '%{0}%' OR Moneda LIKE '%{0}%' )", Moneda))
-
- If drMon IsNot Nothing Then
- DdlMoneda.SelectedValue = drMon("CveMoneda").ToString
- CveMoneda = drMon("CveMoneda").ToString.ToEntero
- Else
- 'sino busco en la tabla de alias
- drMon = GlobalDTMonedasAlias.FiltroPrimero(String.Format("MonedaAlias LIKE '%{0}%' ", Moneda))
+ Dim drMon As DataRow = GlobalDTMonedas.FiltroPrimero(String.Format(" (Abreviatura LIKE '%{0}%' OR Moneda LIKE '%{0}%' )", Moneda))
If drMon IsNot Nothing Then
DdlMoneda.SelectedValue = drMon("CveMoneda").ToString
CveMoneda = drMon("CveMoneda").ToString.ToEntero
Else
- LblMoneda.Text = Moneda
- LblMoneda.ForeColor = Drawing.Color.Red
- End If
- End If
+ 'sino busco en la tabla de alias
+ drMon = GlobalDTMonedasAlias.FiltroPrimero(String.Format("MonedaAlias LIKE '%{0}%' ", Moneda))
- If DdlMoneda.SelectedValue.ToEntero > 1 Then
- If TipoCambio <= 10 Then
- TipoCambio = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
+ If drMon IsNot Nothing Then
+ DdlMoneda.SelectedValue = drMon("CveMoneda").ToString
+ CveMoneda = drMon("CveMoneda").ToString.ToEntero
+ Else
+ LblMoneda.Text = Moneda
+ LblMoneda.ForeColor = Drawing.Color.Red
+ End If
End If
- TxtFecha.Attributes.Remove("onblur")
- If UsuarioActual.Empresa.UsaAC Then
- TxtFecha.Attributes.Add("onblur", "CambiaFecha();CambiaFechaTC();")
- Else
- TxtFecha.Attributes.Add("onblur", "CambiaFechaTC();")
+ If DdlMoneda.SelectedValue.ToEntero > 1 Then
+ If TipoCambio <= 10 Then
+ TipoCambio = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
+ End If
+
+ TxtFecha.Attributes.Remove("onblur")
+ If UsuarioActual.Empresa.UsaAC Then
+ TxtFecha.Attributes.Add("onblur", "CambiaFecha();CambiaFechaTC();")
+ Else
+ TxtFecha.Attributes.Add("onblur", "CambiaFechaTC();")
+ End If
+ End If
+
+ If TipoCambio > 0 And DdlMoneda.SelectedValue.ToEntero > 1 Then LblTC.Text = String.Format("TC: {0}", TipoCambio.ToString("N4"))
+
+ 'DF - 10-04-17
+ If UsuarioActual.TienePermisoProceso(187) Then
+ TxtSerie.Enabled = True
+ End If
+
+ If LblMetodoPago.Text = "" AndAlso TipoComprobante <> "T" Then
+ Alert("El xml no contiene la etiqueta 'método de pago', favor de verificar la emisión con el proveedor.", TipoMensaje.MsgAdvertencia)
+ BtnGuardar.Visible = False
End If
End If
-
- If TipoCambio > 0 And DdlMoneda.SelectedValue.ToEntero > 1 Then LblTC.Text = String.Format("TC: {0}", TipoCambio.ToString("N4"))
-
- 'DF - 10-04-17
- If UsuarioActual.TienePermisoProceso(187) Then
- TxtSerie.Enabled = True
- End If
-
- If LblMetodoPago.Text = "" AndAlso TipoComprobante <> "T" Then
- Alert("El xml no contiene la etiqueta 'método de pago', favor de verificar la emisión con el proveedor.", TipoMensaje.MsgAdvertencia)
- BtnGuardar.Visible = False
- End If
- End If
- Else
+ Else
Alert("No se Encontró la Factura", TipoMensaje.MsgAdvertencia)
BtnGuardar.Visible = False
End If
@@ -3148,7 +3152,6 @@ Partial Class Compras_Compras
LtlGvAnticiposSel.Visible = True
End If
-
'' VALIDA ELIMINAR COMPRA, QUE NO TENGA PAGOS CONCILIADOS
If (UsuarioActual.TienePermisoProceso(77) OrElse UsuarioActual.TienePermisoProceso(135)) AndAlso dr("NumPagosConciliados").ToString.ToEntero = 0 Then ' Eliminar compra
@@ -3168,7 +3171,6 @@ Partial Class Compras_Compras
End If
End If
-
Dim StrInventario As String = ""
If dr("Inventario").ToString = "1" Then
StrInventario = "los Movimientos de Inventario relacionados"
@@ -4185,20 +4187,17 @@ Partial Class Compras_Compras
Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click
-
-
If Not ValidaPresupuesto(2) Then
Exit Sub
End If
'------------------ INICIA VALIDACIONES ------------------
- If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 Then
+ If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 AndAlso LblSaldoFactura.Text.ToDecimal > 0 Then
Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
-
Dim CveSubProyectoPrincipal As Integer = AsignarSubProyectoPrincipal()
If Not CveSubProyectoPrincipal > 0 Then
@@ -4206,7 +4205,7 @@ Partial Class Compras_Compras
End If
If Not ValidaVinculacionNotaFactura() Then
- Alert("Se requiere que la nota este aplciada a las facturas", TipoMensaje.MsgAdvertencia)
+ Alert("Se requiere que la nota este aplicada a las facturas", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -5682,7 +5681,7 @@ Partial Class Compras_Compras
Dim CveConceptoAfectacion As Integer = 5 'Proveedores
Dim CveConceptoOriginal As Integer
- If CveTipoConcepto = 2 Then CveConceptoAfectacion = 305 'cuando es acreedor
+ If CveTipoConcepto <> 1 Then CveConceptoAfectacion = 305 'cuando es acreedor
If CveMoneda <> 1 Then
Select Case CveConceptoAfectacion
Case 5
@@ -5694,7 +5693,7 @@ Partial Class Compras_Compras
End If
Dim CveConceptoAfectacionContado As Integer = 17 'Pago Proveedores
- If CveTipoConcepto = 2 Then CveConceptoAfectacionContado = 308 'cuando es acreedor
+ If CveTipoConcepto <> 1 Then CveConceptoAfectacionContado = 308 'cuando es acreedor
If CveMoneda <> 1 Then
Select Case CveConceptoAfectacionContado
Case 17
@@ -6014,7 +6013,7 @@ Partial Class Compras_Compras
Case 17 'Pago Proveedores
- If CveTipoConcepto = 2 Then ConceptoContable = 308 'cuando es acreedor
+ If CveTipoConcepto <> 1 Then ConceptoContable = 308 'cuando es acreedor
If CveMoneda <> 1 Then
Select Case ConceptoContable
Case 17
@@ -6118,7 +6117,7 @@ Partial Class Compras_Compras
If importeMovimiento <> 0 Then 'Cuando tiene complementaria lo dividimos en dos
Dim CveConceptoContableComplementaria As Integer = 206
- If CveTipoConcepto = 2 Then CveConceptoContableComplementaria = 310 'cuando es acreedor
+ If CveTipoConcepto <> 1 Then CveConceptoContableComplementaria = 310 'cuando es acreedor
importeMN = importeMovimiento
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento * TipoCambioCompra - importeMovimiento, importeMovimiento * TipoCambioCompra - importeMovimiento, CveConceptoContableComplementaria, Referencia, Concepto, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteME:=importeMovimiento, Contabilizable:=SeContabiliza, TipoCambio:=TipoCambioCompra) Then
@@ -6288,21 +6287,22 @@ Partial Class Compras_Compras
Case 6 'Compra
Dim AgregaMercanciaInventario As Boolean = UsuarioActual.Empresa.UsaInventarios
+ If UsuarioActual.CveEmpresa.Contiene(13, 83, 7, 11, 12, 122) Then AgregaMercanciaInventario = False
- Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV")
+ Dim RegistraConcepto225 As Boolean = AgregaMercanciaInventario AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV")
Dim Insertado205 As Boolean = False
If RBLPago.SelectedValue.ToEntero = 4 Then
Exit Select 'Es credito el concepto 6 se agrega en CASE 17
End If
- Dim DifSubTotatles As Decimal = 0D
+ Dim DifSubTotales As Decimal = 0D
If CveCompraRefacturacion > 0 Then
- DifSubTotatles = Math.Abs(SubTotalRefacturacion - TxtSubTotal2.Text.ToDecimal)
+ DifSubTotales = Math.Abs(SubTotalRefacturacion - TxtSubTotal2.Text.ToDecimal)
End If
- If DifSubTotatles > 0 Or (Not CveCompraRefacturacion > 0 OrElse (ChkRefacNC.Checked)) Then
+ If DifSubTotales > 0 Or (Not CveCompraRefacturacion > 0 OrElse (ChkRefacNC.Checked)) Then
'AF TipoAF 2 Es para las compras
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) = 2 And ISNULL(AplicaCostoIndirecto,0) <> 1 ")
If DT.Rows.Count > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
@@ -6323,7 +6323,7 @@ Partial Class Compras_Compras
'COSTO ALMACEN
Dim DtAlmacenes As DataTable = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
- If UsuarioActual.Empresa.UsaInventarios Then
+ If AgregaMercanciaInventario Then
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen"})
'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN
'SI LA COMPRA ES DE TIPO GASTO CON ALMACEN DEBE REGISTRAR MOVIMIENTO
@@ -6347,8 +6347,6 @@ Partial Class Compras_Compras
DT = DT.FiltraParametros("ISNULL(CveAlmacen,0) > 0")
If DT.Rows.Count > 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
-
-
'SI ES GASTO CON ALMACEN
If DdlTipoCompra.SelectedValue = "10" Then
For Each RowDetalle As DataRow In TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen", "CveClasificacion", "CveSubProyecto"}).Rows
@@ -6449,6 +6447,9 @@ Partial Class Compras_Compras
ConceptoContabilizacion = 6
End If
+ If UsuarioActual.CveEmpresa.Contiene(7, 11, 12, 122, 145, 13, 83) AndAlso ConceptoContabilizacion = 205 Then
+ ConceptoContabilizacion = 6
+ End If
Select Case ConceptoContabilizacion
Case 6
@@ -6713,10 +6714,32 @@ Partial Class Compras_Compras
For Each Gvr As GridViewRow In GvFacturaNC.Rows
If Gvr.FCCheckBox("ChkFacturaNC").Checked Then ' recorro la seleccion y tomo el TC de cada aplicación
AplicadoenFactura = True
- Dim timporteMovimientoNC As Decimal = (Gvr.FCTextBox("TxtImporte").Text.ToDecimal * Gvr.DataKey("SubTotal").ToDecimal / Gvr.DataKey("Saldo").ToDecimal).RoundSQL
+ Dim timporteMovimientoNC As Decimal = (Gvr.FCTextBox("TxtImporte").Text.ToDecimal) '* Gvr.DataKey("SubTotal").ToDecimal / Gvr.DataKey("Saldo").ToDecimal).RoundSQL
Dim TCNC As Decimal = Gvr.DataKey("TipoCambio").ToDecimal
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, timporteMovimientoNC, (timporteMovimientoNC * TCNC * Multiplicador).RoundSQL, ConceptoContabilizacionNC, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=TCNC, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveClasificacion:=tCveClasif, CveSubProyecto:=tCveSubProyecto, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
+ Else
+ 'validación de flcutuacción
+ If CompraActual.TC <> TCNC Then
+ Dim tConceptoContable As Integer
+ Dim tTipoMovimiento As Boolean
+ Dim Diferencia As Decimal = 0
+
+ If CompraActual.TC > TCNC Then
+ tConceptoContable = 64
+ tTipoMovimiento = True
+ Else
+ tConceptoContable = 65
+ tTipoMovimiento = False
+ End If
+ Diferencia = (timporteMovimientoNC * (CompraActual.TC - TCNC)).RoundSQL 'Añadimos la diferencia de perdida en la venta
+
+ If Diferencia <> 0 Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tTipoMovimiento, Diferencia, Diferencia, tConceptoContable, Referencia, Concepto, CveCompra:=CveCompra, CveSubProyecto:=CompraActual.CveSubProyecto, CveProveedor:=CompraActual.CveProveedor) Then
+ ErrorPrepoliza = True
+ End If
+ End If
+ End If
End If
End If
Next
@@ -6796,6 +6819,7 @@ Partial Class Compras_Compras
' 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
@@ -6869,7 +6893,7 @@ Partial Class Compras_Compras
importeMovimiento = 0
End If
Case 5 'Proveedores
- If CveTipoConcepto = 2 Then ConceptoContable = 305 'cuando es acreedor
+ If CveTipoConcepto <> 1 Then ConceptoContable = 305 'cuando es acreedor
Dim UsaComplementaria As Boolean = True
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then UsaComplementaria = False
@@ -6890,7 +6914,7 @@ Partial Class Compras_Compras
If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
Dim CveConceptoContableComplementaria As Integer = 201
- If CveTipoConcepto = 2 Then CveConceptoContableComplementaria = 307
+ If CveTipoConcepto <> 1 Then CveConceptoContableComplementaria = 307
If tipoCambioActual <> 1 Then
@@ -8588,7 +8612,6 @@ Partial Class Compras_Compras
'PORCENTAJE IVA
Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal
-
Dim TmpCveRetIVAConcepto As Integer = If(CveRetIVAConceptoOriginal <> DdlRetIVAConcepto.SelectedValue.ToEntero, DdlRetIVAConcepto.SelectedValue.ToEntero, -1)
Dim TmpCveRetISRConcepto As Integer = If(CveRetISRConceptoOriginal <> DdlRetISRConcepto.SelectedValue.ToEntero, DdlRetISRConcepto.SelectedValue.ToEntero, -1)
Dim tNoDeducible As Integer = If(ChkEsNoDeducible.Checked, 1, 0)
@@ -9207,15 +9230,10 @@ Partial Class Compras_Compras
End If
Dim CveMovimientoInventario As Integer = CveMovimientoAlmacen
-
-
Dim DT As DataTable
Dim tipoCambioActual, tipoCambioPago As Decimal
Dim FechaMovimiento As Date = TxtFecha.Text.ToDate
-
-
-
If DdlMoneda.SelectedValue.ToString.ToEntero = 2 Then
tipoCambioActual = GlobalTipoCambio(FechaMovimiento).ToString.ToDecimal
tipoCambioActual = If(DivTC.Visible Or TipoCambio > 0, TipoCambio, tipoCambioActual)
@@ -9248,17 +9266,20 @@ Partial Class Compras_Compras
Dim CveProveedorConcepto As Integer = 0, CveIE As Integer = 0, CveCreditoDetalle As Integer = 0
Dim ConceptoPersonal As String = "", Concepto As String = ""
+ Dim tUsaInventarios As Boolean = UsuarioActual.Empresa.UsaInventarios
+ If (UsuarioActual.CveEmpresa.Contiene(13, 83, 7, 11, 12, 122, 145)) Then tUsaInventarios = False
If Not ObjConta.GetPrePolizasDetalleCompra(CveCompra, UsuarioActual.CveEmpresa) Then
ErrorPrepoliza = True
Else
- DtPrePolizas = ObjConta.DtResultados.FiltraParametros("CveConceptoContable IN (6,68,49,205,176)")
+ DtPrePolizas = ObjConta.DtResultados.FiltraParametros("CveConceptoContable IN (6,68,49,205,176,5,305,311)")
If DtPrePolizas.Rows.Count > 0 Then
- CveProveedorConcepto = ObjConta.DtResultados.FiltraParametros("CveConceptoContable = 6 OR CveConceptoContable = 68 OR CveConceptoContable = 49 OR CveConceptoContable = 205 OR CveConceptoContable = 176").Rows(0)("CveProveedor").ToString.ToEntero
- CveIE = ObjConta.DtResultados.FiltraParametros("CveConceptoContable = 6 OR CveConceptoContable = 68 OR CveConceptoContable = 49 OR CveConceptoContable = 205 OR CveConceptoContable = 176").Rows(0)("CveIE").ToString.ToEntero
- CveCreditoDetalle = ObjConta.DtResultados.FiltraParametros("CveConceptoContable = 6 OR CveConceptoContable = 68 OR CveConceptoContable = 49 OR CveConceptoContable = 205 OR CveConceptoContable = 176").Rows(0)("CveCreditoDetalle").ToString.ToEntero
- Concepto = ObjConta.DtResultados.FiltraParametros("CveConceptoContable = 6 OR CveConceptoContable = 68 OR CveConceptoContable = 49 OR CveConceptoContable = 205 OR CveConceptoContable = 176").Rows(0)("Concepto").ToString
+ Dim drr As DataRow = ObjConta.DtResultados.FiltraParametros("CveConceptoContable in(6,68,49,205,176,5,305,311)").FiltroPrimero("")
+ CveProveedorConcepto = drr("CveProveedor").ToString.ToEntero
+ CveIE = drr("CveIE").ToString.ToEntero
+ CveCreditoDetalle = drr("CveCreditoDetalle").ToString.ToEntero
+ Concepto = drr("Concepto").ToString
End If
End If
@@ -9297,7 +9318,7 @@ Partial Class Compras_Compras
If ObjCompra.GetCompras(CveCompra, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjCompra.DtResultados.Rows.Count > 0 Then
CveConceptoContableAlmacen = ObjCompra.DtResultados.FiltroPrimeroValor("CveConceptoContableAlmacen").ToEntero
- If CveConceptoContableAlmacen = 0 Then
+ If CveConceptoContableAlmacen = 0 AndAlso tUsaInventarios Then
If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
If (CveImportacion > 0 Or CveFlete > 0) Then
CveConceptoContableAlmacen = CveConceptoContableAlmacen
@@ -9335,7 +9356,7 @@ Partial Class Compras_Compras
importeMovimiento = 0
'COSTO ALMACEN
Dim DtAlmacenes As DataTable = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
- If UsuarioActual.Empresa.UsaInventarios And CveConceptoContableAlmacen = 0 Or DdlTipoCompra.SelectedValue.ToEntero = 10 Then
+ If tUsaInventarios And CveConceptoContableAlmacen = 0 Or DdlTipoCompra.SelectedValue.ToEntero = 10 Then
DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) > 0", "", {"CveAlmacen"})
'RECORREMOS PARA DETECTAR LA MODALIDAD DEL ALMACEN, EN CASO DE SER SOLO EXISTENCIA LIMPIAMOS CVEALMACEN
@@ -9366,7 +9387,7 @@ Partial Class Compras_Compras
importeMovimiento = 0
'INV [MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA) ]
- If DdlTipoCompra.SelectedValue.ToEntero <> 10 AndAlso UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And CveConceptoContableAlmacen.Contiene(176, 205) Then
+ If DdlTipoCompra.SelectedValue.ToEntero <> 10 AndAlso tUsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And CveConceptoContableAlmacen.Contiene(176, 205) Then
importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
@@ -9380,7 +9401,7 @@ Partial Class Compras_Compras
'NC CON PRODUCTOS - CUENTA PUENTE
- If UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("Ant") And CveConceptoContableAlmacen.Contiene(225) Then
+ If tUsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("Ant") And CveConceptoContableAlmacen.Contiene(225) Then
importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
@@ -9409,7 +9430,7 @@ Partial Class Compras_Compras
If DdlTipoCompra.SelectedValue.ToEntero <> 10 Then
'QUITA 1-[MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA)] 2-[NC CON PRODUCTOS]
- If UsuarioActual.Empresa.UsaInventarios And CveConceptoContableAlmacen > 0 Then
+ If tUsaInventarios And CveConceptoContableAlmacen > 0 Then
DT = DT.FiltraParametros("CveTipoPS <> 2")
End If
End If
@@ -18514,7 +18535,9 @@ Partial Class Compras_Compras
If ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 49, CveCompra, 1) Then
If ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 68, CveCompra, 1) Then
If ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 6, CveCompra, 1) Then
- TieneError = False
+ If ObjConta.RemovePrePolizasDetalle(CvePrePoliza, 205, CveCompra, 1) Then
+ TieneError = False
+ End If
End If
End If
End If
@@ -21131,9 +21154,9 @@ Public Class ClsCompraManagerCompras
Public Property CveRetISRConcepto As Integer = -1
Public Property CveSubProyecto As Integer = -1
Public Property UsuarioActual As Usuario
- Public ReadOnly Property ConceptoPrePolizaIVA As ConceptosRetenciones
+ Public ReadOnly Property ConceptoPrePolizaIVA As ClsPaginas.ConceptosRetenciones
Get
- Dim Ret As New ConceptosRetenciones
+ Dim Ret As New ClsPaginas.ConceptosRetenciones
If EsImportacion Then
Ret.CveConceptoAcreditable = 288
Ret.CveConceptoxAcreditar = 287
@@ -21144,9 +21167,9 @@ Public Class ClsCompraManagerCompras
Return Ret
End Get
End Property
- Public ReadOnly Property ConceptoPrePolizaRetIVA As ConceptosRetenciones
+ Public ReadOnly Property ConceptoPrePolizaRetIVA As ClsPaginas.ConceptosRetenciones
Get
- Dim Ret As New ConceptosRetenciones
+ Dim Ret As New ClsPaginas.ConceptosRetenciones
Dim Funcionalidad, FuncionalidadxAcred As Integer
If CveRetIVAConcepto = 1 Then
Funcionalidad = 308 : FuncionalidadxAcred = 307
@@ -21176,9 +21199,9 @@ Public Class ClsCompraManagerCompras
Return Ret
End Get
End Property
- Public ReadOnly Property ConceptoPrePolizaRetISR As ConceptosRetenciones
+ Public ReadOnly Property ConceptoPrePolizaRetISR As ClsPaginas.ConceptosRetenciones
Get
- Dim Ret As New ConceptosRetenciones
+ Dim Ret As New ClsPaginas.ConceptosRetenciones
Dim Funcionalidad, FuncionalidadxAcred As Integer
If CveRetISRConcepto = 1 Then
Funcionalidad = 316 : FuncionalidadxAcred = 315
@@ -21376,7 +21399,7 @@ Public Class ClsCompraManagerCompras
Descuento = ValorXML(nodo, "descuento").ToDecimal
Moneda = ValorXML(nodo, "Moneda")
- CveMoneda = GlobalDTMonedas().FiltroPrimeroValor("CveMoneda", $" AbreviaturaSAT = '{Moneda}' ").ToEntero
+ CveMoneda = ClsPaginas.GlobalDTMonedas().FiltroPrimeroValor("CveMoneda", $" AbreviaturaSAT = '{Moneda}' ").ToEntero
If Not CveMoneda > 0 Then
GuardaLog($"Moneda {Moneda} no se obtuvo la clabe")
Errores.AppendLine($"Moneda {Moneda} no se obtuvo la clabe")
@@ -21388,7 +21411,7 @@ Public Class ClsCompraManagerCompras
TipoCambio = ValorXML(nodo, "TipoCambio", "1").ToDecimal
If CFDIVersion = EnumCFDIVersion.v33 Or CFDIVersion = EnumCFDIVersion.v40 Then
- Dim drm As DataRow = GlobalDTVtaMetodoPago.FiltroPrimero(String.Format("ClaveMetodoPagoSAT = '{0}'", ValorXML(nodo, "MetodoPago")))
+ Dim drm As DataRow = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimero(String.Format("ClaveMetodoPagoSAT = '{0}'", ValorXML(nodo, "MetodoPago")))
If drm IsNot Nothing Then
CveMetodoPago = drm("CveMetodoPago").ToString.ToEntero
MetodoPago = drm("MetodoPagoSAT").ToString
diff --git a/Compras/Importaciones.aspx b/Compras/Importaciones.aspx
index a25eade62..cb2d69d6a 100644
--- a/Compras/Importaciones.aspx
+++ b/Compras/Importaciones.aspx
@@ -143,7 +143,7 @@
-
+
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 427b1e733..4ba4d6a1c 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -2,14 +2,10 @@
Option Explicit On
Imports System.Data
-Imports System.Data.Entity.Core.Metadata.Edm
Imports System.IO
Imports System.Xml
Imports Extensiones
-Imports iText.Barcodes.Dmcode
Imports Microsoft.Reporting.WebForms
-Imports Modelos
-Imports Stimulsoft.Base.Context
Imports ZXing
@@ -244,7 +240,6 @@ Partial Class PopUpVerFactura
End If
End Sub
-
Private Sub DescargaArchivoDirecto(RutaArchivo As String)
If RutaArchivo <> "" Then
@@ -351,7 +346,7 @@ Partial Class PopUpVerFactura
Dim totalPallets As String = ""
Dim totalBachas As String = ""
Dim dfec As DateTime = fecha.ToDateTime()
- Dim fechas As String = String.Format(New System.Globalization.CultureInfo("es-MX"), "{0:dd} DE {0:MMMM} DEL {0:yyyy}", dfec).ToUpper()
+ Dim fechas As String = String.Format(New System.Globalization.CultureInfo("es-MX"), "{0dd} DE {0:MMMM} DEL {0:yyyy}", dfec).ToUpper()
Dim totalcajas As String = ""
Dim TotalBins As String = ""
@@ -385,7 +380,7 @@ Partial Class PopUpVerFactura
Dim rds2 As New ReportDataSource With {.Name = "DataSetBins", .Value = tablaReporteBins}
lrds.Add(rds2)
- '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
+ '"D\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
Dim rutardlc As String = "Formatos\RepAgroInventarioDiario.rdlc"
If EnviarCorrreo Then
Dim para As String = ""
@@ -523,7 +518,6 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("CAAT", CAAT))
params.Add(New ReportParameter("NumeroTrailer", NumeroTrailer))
-
params.Add(New ReportParameter("NoFactura", NoFactura))
params.Add(New ReportParameter("Mercado", Mercado))
params.Add(New ReportParameter("NoBultos", NoBultos))
@@ -531,16 +525,11 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("NoKgManifiesto", NoKgManifiesto))
-
-
-
-
-
Dim lrds As New List(Of ReportDataSource)
Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = tablaReporte}
lrds.Add(rds)
- '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
+ '"D\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
Dim rutardlc As String = "Formatos\Agro\EmbarqueManifiesto.rdlc"
If Not IsNothing(tablaReporte.FiltroPrimero("TipoManifiesto=1")) Then
rutardlc = "Formatos\Agro\EmbarqueManifiesto2.rdlc"
@@ -698,7 +687,7 @@ Partial Class PopUpVerFactura
Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = tablaReporte}
lrds.Add(rds)
'"Empresas/Grales/Formatos/EquiposGPS.rdlc"
- '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
+ '"D\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
ImprimirPDF("Formatos\Agro\EmbarqueManifiestoRemision.rdlc", lrds, params, "Remisión") ', Content_Disposition:="Inline")
End Sub
@@ -754,7 +743,7 @@ Partial Class PopUpVerFactura
Cliente = row("Cliente").ToString()
Direccion = row("Direccion").ToString()
Correo = row("Correo").ToString()
- Fecha = String.Format("{0:dd/MM/yyyy}", row("Fecha"))
+ Fecha = String.Format("{0dd/MM/yyyy}", row("Fecha"))
DivisoresdeCarton = String.Format("{0:N0}", row("DivisoresdeCarton"))
BolsasdePlastico = String.Format("{0:N0}", row("BolsasdePlastico"))
TapaderasdeCarton = String.Format("{0:N0}", row("TapaderasdeCarton"))
@@ -769,7 +758,7 @@ Partial Class PopUpVerFactura
AgenciaAduanalUSA = row("AgenciaAduanalUSA").ToString()
AgenciaAduanalMEX = row("AgenciaAduanalMEX").ToString()
Temperatura = row("Temperatura").ToString()
- Hora = String.Format("{0:hh }:{0:mm }:{0:ss tt}:", row("FechaIng"))
+ Hora = String.Format("{0hh }:{0:mm }:{0:ss tt}:", row("FechaIng"))
Chofer = row("Chofer").ToString()
CamPlaca = row("CamPlaca").ToString()
Camion = String.Format("{0} {1}", row("CamEspecificacion"), row("CamAnio"))
@@ -850,7 +839,7 @@ Partial Class PopUpVerFactura
Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = tablaReporte}
lrds.Add(rds)
'"Empresas/Grales/Formatos/EquiposGPS.rdlc"
- '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
+ '"D\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
Dim pdf As Byte() = StreamPDF("Formatos\Agro\EmbarqueManifiestoCartaPorte.rdlc", lrds, params, "DatosCartaPorte")
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
@@ -932,7 +921,7 @@ Partial Class PopUpVerFactura
lrds.Add(rds2)
'endimg
'"Empresas/Grales/Formatos/EquiposGPS.rdlc"
- '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
+ '"D\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
ImprimirPDF("Formatos\Agro\PalletEtiqueta2.rdlc", lrds, params, "Pallet") ', Content_Disposition:="Inline")
End Sub
@@ -973,8 +962,8 @@ Partial Class PopUpVerFactura
Fecha = String.Format("{0:MMM dd}", row("Fecha")).Replace(".", "").ToUpper()
CvetypeImpresion = row("CvetypeImpresion").ToString().ToEntero()
NumberOfCode = String.Format("(00)00000000000000(00){1:ddMMyy}(00){0}00", Right(String.Format("0{0}", Regex.Match(row("Cuadro").ToString(), "\d+")), 2), row("Fecha"))
- 'NumberSmall = String.Format("{0:00}", noPallet.ToEntero())
- 'NumberBig = String.Format("{0:00}", row("Consecutivo").ToString().ToEntero()) ' String.Format("{0:dd}", row("Fecha"))
+ 'NumberSmall = String.Format("{000}", noPallet.ToEntero())
+ 'NumberBig = String.Format("{000}", row("Consecutivo").ToString().ToEntero()) ' String.Format("{0:dd}", row("Fecha"))
NumberSmall = row("NumberSmall").ToString()
@@ -1058,7 +1047,7 @@ Partial Class PopUpVerFactura
lrds.Add(rds)
'"Empresas/Grales/Formatos/EquiposGPS.rdlc"
- '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
+ '"D\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
Dim ruta As String = "Formatos\Agro\PalletEtiquetaWalmart.rdlc"
'If CvetypeImpresion = 2 Then
' ruta = "Formatos\Agro\PalletEtiqueta_2.rdlc"
@@ -1098,8 +1087,8 @@ Partial Class PopUpVerFactura
Fecha = String.Format("{0:MMM dd}", row("Fecha")).Replace(".", "").ToUpper()
CvetypeImpresion = row("CvetypeImpresion").ToString().ToEntero()
NumberOfCode = String.Format("(00)00000000000000(00){1:ddMMyy}(00){0}00", Right(String.Format("0{0}", Regex.Match(row("Cuadro").ToString(), "\d+")), 2), row("Fecha"))
- NumberSmall = String.Format("{0:00}", noPallet.ToEntero())
- NumberBig = String.Format("{0:00}", row("Consecutivo").ToString().ToEntero()) ' String.Format("{0:dd}", row("Fecha"))
+ NumberSmall = String.Format("{000}", noPallet.ToEntero())
+ NumberBig = String.Format("{000}", row("Consecutivo").ToString().ToEntero()) ' String.Format("{0:dd}", row("Fecha"))
End If
End Using
Dim params As New List(Of ReportParameter)
@@ -1156,7 +1145,7 @@ Partial Class PopUpVerFactura
lrds.Add(rds)
'"Empresas/Grales/Formatos/EquiposGPS.rdlc"
- '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
+ '"D\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
Dim ruta As String = "Formatos\Agro\PalletEtiquetaCaja.rdlc"
'If CvetypeImpresion = 2 Then
' ruta = "Formatos\Agro\PalletEtiqueta_2.rdlc"
@@ -1574,7 +1563,7 @@ Partial Class PopUpVerFactura
Dim Fecha As String = "", Nombre As String = ""
Dim OpcionDetallado As Integer = 1
- If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then OpcionDetallado = 2
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then OpcionDetallado = 2
Dim ObjVenta As New ClsVentas
Dim ObjPuntoVenta As New ClsPuntoVenta
@@ -1593,7 +1582,7 @@ Partial Class PopUpVerFactura
End If
End If
- If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then
If ObjPuntoVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, CveSubProyecto, CveCorte:=CveCorte) Then
DtReporteCorte = ObjPuntoVenta.DtResultados.FiltraParametros("CveCorte > 0")
End If
@@ -1602,7 +1591,7 @@ Partial Class PopUpVerFactura
DtIngresosRetiros = ObjPuntoVenta.DtResultados.Copy()
End If
- If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVenta.GetCortesDetalleDepositosCaja(CveCorte, -1, UsuarioActual.CveEmpresa) Then
+ If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVenta.GetCortesDetalleDepositosCaja(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDepositos = ObjVenta.DtResultados.Copy()
End If
End If
@@ -1610,8 +1599,8 @@ Partial Class PopUpVerFactura
ObjVenta.Dispose()
ObjPuntoVenta.Dispose()
- Dim FechaCorte As String = $" Fecha fin: {Fecha}"
- Dim Usuario As String = $" Usuario: {Nombre}"
+ Dim FechaCorte As String = $" Fecha fin {Fecha}"
+ Dim Usuario As String = $" Usuario {Nombre}"
If DtCortesVentas.Rows.Count > 0 Or DtCortesVentasResumen.Rows.Count > 0 Then
Dim lrds As New List(Of ReportDataSource)
@@ -1621,7 +1610,6 @@ Partial Class PopUpVerFactura
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
DtMetodosPago = DtCortesVentasResumen.FiltraParametros("MetodoPago <> 'Crédito'")
End If
-
Dim DirFormato As String = "Empresas/Grales/Formatos/RepCortes.rdlc"
If File.Exists(UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc") Then
DirFormato = UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc"
@@ -1634,7 +1622,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("AgrupoPor", $"{FechaCorte}{Usuario}"))
params.Add(New ReportParameter("LogoPath", RutaImagenLogo))
- If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then
If DtReporteCorte IsNot Nothing Then
Dim DtTT = GenerateTransposedTable(DtReporteCorte)
Dim DtDatosVentas As New DataTable()
@@ -1674,9 +1662,13 @@ Partial Class PopUpVerFactura
Orden = 5
TipoTabla = 1
Case "VentaTotalRemision"
- rowData("Columna") = "Ventas Remisiones"
- Orden = 6
- TipoTabla = 1
+ If UsuarioActual.CveEmpresa.Contiene(190, 192) Then
+ rowData("Columna") = "Ventas Remisiones"
+ Orden = 6
+ TipoTabla = 1
+ Else
+ Orden = 0
+ End If
Case "TotalEfectivo"
rowData("Columna") = "Total Efectivo"
Orden = 7
@@ -1739,13 +1731,13 @@ Partial Class PopUpVerFactura
DtDatosCajas.Rows.Add(rowData.ItemArray)
End If
- If row(0).ToString() = "SaldoAnteriorAplicado" Then
- Dim RowMP As DataRow = DtMetodosPago.NewRow
- RowMP("MetodoPago") = "Saldo Aplicado"
- RowMP("Importe") = Total.ToDecimal()
+ 'If row(0).ToString() = "SaldoAnteriorAplicado" Then
+ ' Dim RowMP As DataRow = DtMetodosPago.NewRow
+ ' RowMP("MetodoPago") = "Saldo Aplicado"
+ ' RowMP("Importe") = Total.ToDecimal()
- DtMetodosPago.Rows.Add(RowMP)
- End If
+ ' DtMetodosPago.Rows.Add(RowMP)
+ 'End If
End If
Next
@@ -1768,15 +1760,30 @@ Partial Class PopUpVerFactura
lrds.Add(rds5)
- If UsuarioActual.CveEmpresa = 193 Then
+ If UsuarioActual.CveEmpresa.Contiene(197, 193) Then
+ Dim CveCuenta As Integer = -1
+ If UsuarioActual.CveEmpresa = 193 Then
+ CveCuenta = 186367
+ Else
+ CveCuenta = 0
- Dim CveCuenta As Integer = 186367
- Using ObjConta As New ClsContabilidad
- If ObjConta.GetAnexoCatalogo(CveCuenta, Fecha.ToDate(), Fecha.ToDate(), -1, -1, -1, UsuarioActual.CveEmpresa, 1) Then
- Dim rdsConta As New ReportDataSource With {.Name = "DsContabilidad", .Value = ObjConta.DtResultados}
- lrds.Add(rdsConta)
+ If CveSubProyecto = 12756 Then 'nav
+ CveCuenta = 188796
End If
- End Using
+
+ If CveSubProyecto = 12755 Then 'hillo
+ CveCuenta = 188795
+ End If
+ End If
+
+ If CveCuenta >= 0 Then
+ Using ObjConta As New ClsContabilidad
+ If ObjConta.GetAnexoCatalogo(CveCuenta, Fecha.ToDate(), Fecha.ToDate(), -1, -1, -1, UsuarioActual.CveEmpresa, 1) Then
+ Dim rdsConta As New ReportDataSource With {.Name = "DsContabilidad", .Value = ObjConta.DtResultados}
+ lrds.Add(rdsConta)
+ End If
+ End Using
+ End If
If DtDepositos IsNot Nothing Then
Dim rdsDepositos As New ReportDataSource With {.Name = "DsDepositos", .Value = DtDepositos}
@@ -4693,7 +4700,7 @@ Partial Class PopUpVerFactura
Dim ObjAcum As New ClsAcumuladores
Dim DatosEntradasUsados As New DataTable
Dim CveAlmacen As String = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", String.Format("Almacen = '{0}'", Almacen))
- If ObjAcum.EntradasUsadosGet(UsuarioActual.CveEmpresa, CveAlmacen.ToEntero, Convert.ToDateTime(Fecha.ToString), Convert.ToDateTime(Today.ToString)) Then
+ If ObjAcum.EntradasUsadosGet(UsuarioActual.CveEmpresa, CveAlmacen.ToEntero, Fecha.ToDate, Today.ToDate) Then
DatosEntradasUsados = ObjAcum.DtResultados
End If
@@ -5751,18 +5758,22 @@ Partial Class PopUpVerFactura
If ObjIE.GetBancosIEFacturasPagadas(CveIE, UsuarioActual.CveEmpresa) Then
dtMovs = ObjIE.DtResultados.FiltraParametros("CveConceptoContable IN (17,2,308,309,312,292 )")
- CvePrePoliza = dtMovs.Rows(0)("CVePrePoliza").ToString.ToEntero
- If Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then
- 'CONVIERTO A PESOS CUANDO SE PAGA CON PESOS FACTURAS DE DOLARES
- For Each Dr As DataRow In dtMovs.Rows
- Dr("Importe") = Dr("ImporteMN").ToString.ToDecimal
- Dr("ImporteNC") = Dr("ImporteNC").ToString.ToDecimal * Dr("TC").ToString.ToDecimal
- Dr("Total") = Dr("Total").ToString.ToDecimal * Dr("TC").ToString.ToDecimal
- Dr("Saldo") = Dr("Saldo").ToString.ToDecimal * Dr("TC").ToString.ToDecimal
- Next
+ If dtMovs IsNot Nothing AndAlso dtMovs.Rows.Count > 0 Then
+ CvePrePoliza = dtMovs.Rows(0)("CVePrePoliza").ToString.ToEntero
+
+ If Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then
+ 'CONVIERTO A PESOS CUANDO SE PAGA CON PESOS FACTURAS DE DOLARES
+ For Each Dr As DataRow In dtMovs.Rows
+ Dr("Importe") = Dr("ImporteMN").ToString.ToDecimal
+ Dr("ImporteNC") = Dr("ImporteNC").ToString.ToDecimal * Dr("TC").ToString.ToDecimal
+ Dr("Total") = Dr("Total").ToString.ToDecimal * Dr("TC").ToString.ToDecimal
+ Dr("Saldo") = Dr("Saldo").ToString.ToDecimal * Dr("TC").ToString.ToDecimal
+ Next
+ End If
End If
+
End If
Dim rds As New ReportDataSource("DataSet1", dtMovs)
@@ -5794,7 +5805,7 @@ Partial Class PopUpVerFactura
End With
dtMovs.Dispose()
- If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
+ If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 And CvePrePoliza > 0 Then
Dim ObjContabilidad As New ClsContabilidad
@@ -5959,7 +5970,7 @@ Partial Class PopUpVerFactura
Dim QrDescarga As String = ""
Dim Cfdi As New RVCFDI33.GeneraCFDI()
Dim b As Byte() = Cfdi.ConvertirQrCode(String.Format("?CvePS={0}&Lote={1}&Fecha={2}", CvePS, Lote, Format(FechaCaducidad, "dd/MM/yyyy").ToString()))
- QrDescarga = Convert.ToBase64String(b)
+ QrDescarga = System.Convert.ToBase64String(b)
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("QR", QrDescarga))
params.Add(New ReportParameter("PS", PS))
@@ -6286,7 +6297,7 @@ Partial Class PopUpVerFactura
DtPrecios.Columns.Add(New DataColumn("CBBase64", GetType(String)))
For Each Row As DataRow In DtPrecios.Rows
- Row("CBBase64") = Convert.ToBase64String(GeneraCodigoQR(Row("CodigoBarras").ToString(), 40, 150, 0, "CODE_39", True))
+ Row("CBBase64") = System.Convert.ToBase64String(GeneraCodigoQR(Row("CodigoBarras").ToString(), 40, 150, 0, "CODE_39", True))
Next
Dim DirectorioArchivo As String = "Empresas/Grales/Formatos/Etiqueta.mrt"
@@ -6383,7 +6394,7 @@ Partial Class PopUpVerFactura
Else
params.Add(New ReportParameter("Fecha", Fecha.ToShortDateString))
End If
- If UsuarioActual.CveEmpresa.Contiene(119, 141) Then
+ If UsuarioActual.CveEmpresa.Contiene(119, 141, 193, 195, 197, 189) Then
params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(drp("CveUsuario").ToString.ToEntero).FiltroPrimeroValor("Nombre")))
End If
If UsuarioActual.CveEmpresa.Contiene(140, 141) Then
diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb
index ea2e659fe..9835bc81d 100644
--- a/Compras/Proveedores.aspx.vb
+++ b/Compras/Proveedores.aspx.vb
@@ -1309,7 +1309,7 @@ Partial Class Compras_Proveedores
e.Row.FCHyperLink("HplCheque").Visible = True
HLSendMail.Visible = True
- HLSendMail.HRef = String.Format("javascript:$get('HdnCveIE').value='{0}';$get('HdnSerieFolio').value='{1}';$get('HdnFolioPago').value='{2}';$get('TxtParaMail').value='{3}';$('#ModalDivMail').modal();", e.Row.DBCampo("CveIE"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("FolioPago"), TxtCorreoCobranza.Text)
+ HLSendMail.HRef = String.Format("javascript:$get('HdnCveIE').value='{0}';$get('HdnSerieFolio').value='{1}';$get('HdnFolioPago').value='{2}';$get('TxtParaMail').value='{3}';$('#ModalDivMail').modal();void(0);", e.Row.DBCampo("CveIE"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("FolioPago"), TxtCorreoCobranza.Text)
If ObjCompra.GetCompraComplementoPago(-1, UsuarioActual.CveEmpresa, e.Row.DBCampo("CveIE").ToString.ToEntero) Then
If ObjCompra.DtResultados.Rows.Count > 0 Then
@@ -4139,8 +4139,10 @@ Partial Class Compras_Proveedores
End Sub
Private Sub LnkAddParametros_Click(sender As Object, e As EventArgs) Handles LnkAddParametros.Click
+
LblLimiteCredito.Text = TxtLimiteCredito.Text.FormatoNumero
LblPlazoCobranza.Text = TxtPlazoCobranza.Text
+
If LblLimiteCredito.Text.ToDouble > 0 Then
TdSaldo.Visible = True
TdSaldo2.Visible = True
@@ -4149,9 +4151,24 @@ Partial Class Compras_Proveedores
TdSaldo.Visible = False
TdSaldo2.Visible = False
End If
+
+ If CveProveedor > 0 Then
+ Dim ObjPro As New ClsCompProveedores
+ If ObjPro.UpdateProveedorLimiteCredito(CveProveedor, TxtLimiteCredito.Text.ToDecimal, TxtPlazoCobranza.Text.ToEntero, ChkUsaLimiteCredito.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+ Alert("Limite de crédito modificado correctamente.")
+ RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAddParametros"))
+ End If
+ ObjPro.Dispose()
+ Else
+ RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAddParametros"))
+ End If
+
+
+
+
UPPCxP.Update()
UpParametros.Update()
- RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAddParametros"))
+
End Sub
Private Sub LnkCuentasBancarias_Click(sender As Object, e As EventArgs) Handles LnkCuentasBancarias.Click
@@ -5493,35 +5510,47 @@ Partial Class Compras_Proveedores
Private Sub BtnSendMail_Click(sender As Object, e As EventArgs) Handles BtnSendMail.Click
'NotificacionPago(HdnCveIE.Value.ToEntero, Txt)
- Dim ObjMail As New ClsSisMail()
- Dim Body As String = GeneraCorreo(HdnCveIE.Value.ToEntero)
- Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail)
+ Dim ObjBancos As New ClsBancos()
- Dim ObjIE As New ClsBancos()
- Dim ComprobanteIE As String
- If ObjIE.GetBancosIE(HdnCveIE.Value.ToEntero, UsuarioActual.CveEmpresa) Then
- If ObjIE.DtResultados.Rows.Count > 0 Then
- If ObjIE.Comprobante <> "" Then
- ComprobanteIE = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ObjIE.Comprobante.ToString)
-
- If IO.File.Exists(ComprobanteIE) Then
- ListaArchivos.Add(New ClsSisMail.ArchivoMail With {.Ruta = ComprobanteIE.ToString})
- End If
- End If
+ If ObjBancos.NotificacionPago(HdnCveIE.Value.ToEntero, TxtParaMail.Text.Trim, TxtCC.Text.Trim, UsuarioActual) Then
+ Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
+ Else
+ Alert("No se pudo enviar el correo electrónico.", TipoMensaje.MsgError)
End If
- End If
- ObjIE.Dispose()
- If ObjMail.SendMail(UsuarioActual.Empresa, TxtParaMail.Text.Trim, "Notificaciones de pago", Body, TxtCC.Text.Trim, Displayname:="Notificaciones de pago", Archivos:=ListaArchivos) Then
- 'ResultadoMail = 1
- TxtCC.Text = ""
- TxtBody.Text = ""
- RegistraScript("$('#ModalDivMail').modal('hide');")
- Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
- Else
- Alert("No se pudo enviar el correo electrónico.", TipoMensaje.MsgError)
- End If
+ ObjBancos.Dispose()
+
+
+ 'Dim ObjMail As New ClsSisMail()
+ 'Dim Body As String = GeneraCorreo(HdnCveIE.Value.ToEntero)
+
+ 'Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail)
+
+ 'Dim ObjIE As New ClsBancos()
+ 'Dim ComprobanteIE As String
+ 'If ObjIE.GetBancosIE(HdnCveIE.Value.ToEntero, UsuarioActual.CveEmpresa) Then
+ ' If ObjIE.DtResultados.Rows.Count > 0 Then
+ ' If ObjIE.Comprobante <> "" Then
+ ' ComprobanteIE = String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ObjIE.Comprobante.ToString)
+
+ ' If IO.File.Exists(ComprobanteIE) Then
+ ' ListaArchivos.Add(New ClsSisMail.ArchivoMail With {.Ruta = ComprobanteIE.ToString})
+ ' End If
+ ' End If
+ ' End If
+ 'End If
+ 'ObjIE.Dispose()
+
+ 'If ObjMail.SendMail(UsuarioActual.Empresa, TxtParaMail.Text.Trim, "Notificaciones de pago", Body, TxtCC.Text.Trim, Displayname:="Notificaciones de pago", Archivos:=ListaArchivos) Then
+ ' 'ResultadoMail = 1
+ ' TxtCC.Text = ""
+ ' TxtBody.Text = ""
+ ' RegistraScript("$('#ModalDivMail').modal('hide');")
+ ' Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
+ 'Else
+ ' Alert("No se pudo enviar el correo electrónico.", TipoMensaje.MsgError)
+ 'End If
End Sub
#End Region
diff --git a/Contabilidad/PlantillasPolizasDetalle.aspx.vb b/Contabilidad/PlantillasPolizasDetalle.aspx.vb
index f87298a0c..41359a5ee 100644
--- a/Contabilidad/PlantillasPolizasDetalle.aspx.vb
+++ b/Contabilidad/PlantillasPolizasDetalle.aspx.vb
@@ -138,7 +138,6 @@ Partial Class Contabilidad_PlantillasPolizasDetalle
Private Sub CargaCuenta()
DdlCtaContable.Items.Clear()
-
DdlCtaContable.Items.Insert(0, New ListItem("Seleccione", "-1"))
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
@@ -148,7 +147,6 @@ Partial Class Contabilidad_PlantillasPolizasDetalle
If Conta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
dtt = Conta.DtResultados
End If
-
Conta.Dispose()
DdlCuentas.Items.Clear()
@@ -156,14 +154,12 @@ Partial Class Contabilidad_PlantillasPolizasDetalle
DdlCuentas.DataBind()
DdlCuentas.Visible = True
DdlCtaContable.Visible = False
+ DdlCuentas.Items.Insert(0, New ListItem("-", "-1"))
Else
-
DdlCtaContable.DataSource = DTCuentasContables
DdlCtaContable.DataBind()
End If
-
- DdlCuentas.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Private Sub CargarConcepto()
diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx
index 4856937c2..23a848b8a 100644
--- a/Contabilidad/RegPrePolizaS.aspx
+++ b/Contabilidad/RegPrePolizaS.aspx
@@ -69,37 +69,27 @@
-
-
-
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb
index bbf936287..8fa667a29 100644
--- a/Contabilidad/RegPrePolizaS.aspx.vb
+++ b/Contabilidad/RegPrePolizaS.aspx.vb
@@ -6,7 +6,6 @@ Imports GemBox.Spreadsheet
Partial Class ContabilidadC_RegPrePolizaS
Inherits ClsPaginas
-
#Region "Propiedades"
Public Property ArregloMovs As ArrayList
Get
@@ -322,7 +321,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtFechaDocumento.Text = NowADS().ToString("dd/MM/yyyy")
TxtFechaelaboracion.Text = NowADS().ToString("dd/MM/yyyy")
TxtConcepto.Enabled = True
- TxtUsuarioElaboro.Text = UsuarioActual.Usuario
+ TxtUsuarioElaboro.Text = UsuarioActual.Nombre
End If
@@ -449,7 +448,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Folio = dr("FolioPoliza").ToString
TxtFolio.Text = dr("FolioPoliza").ToString
- TxtUsuarioElaboro.Text = dr("Usuario").ToString
+ TxtUsuarioElaboro.Text = dr("UsuarioNombre").ToString
TxtFechaelaboracion.Text = dr("FechaIng").ToString.ToDate.ToString("dd/MM/yyyy")
TxtFechaelaboracion.ToolTip = dr("FechaIng").ToString.ToDate.ToString("HH:mm:ss")
CvePlantillaPoliza = dr("CvePlantillaPoliza").ToString.ToEntero
@@ -504,7 +503,7 @@ Partial Class ContabilidadC_RegPrePolizaS
GvPrePoliza.Columns(7).Visible = True
End If
- If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,17,292,308)").Rows.Count > 0 Then
+ If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,292)").Rows.Count > 0 AndAlso DtMovimientos.FiltraParametros("CveConceptoContable IN (30)").Rows.Count = 0 Then
LnkComplementoPago.Visible = True
End If
@@ -769,7 +768,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim dr As DataRow = DtMovimientos.NewRow
dr("CodigoNombreCuenta") = drt("Codigo").ToString & " " & drt("Nombre").ToString
- 'dr("Cuenta") = drt("ConceptoContable").ToString
+ dr("ConceptoContable") = drt("ConceptoContable").ToString
dr("Referencia") = If(drt("CveConceptoContable").ToString.Contiene("29", "130"), drt("Personal"), drt("RazonSocial"))
dr("Concepto") = TxtConcepto.Text
dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1)
@@ -1022,7 +1021,7 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
'Registra movimieno bancario
- If gvr.DataKey("CveConceptoContable") = "30" AndAlso Importe <> 0 Then
+ If gvr.DataKey("CveConceptoContable") = "30" AndAlso (Importe <> 0 OrElse DdlPlantilla.SelectedValue = "53") Then
Dim tFolio As String = gvr.DataKey("ContadoNumeroFolio").ToString
If tFolio.ToEntero = 0 Then tFolio = SiguienteFolioBancos(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero)
@@ -2073,6 +2072,36 @@ Partial Class ContabilidadC_RegPrePolizaS
#Region "COMPLEMENTO DE PAGO"
+ Private Sub LnkComplementoPago_Click(sender As Object, e As EventArgs) Handles LnkComplementoPago.Click
+ CargaComplementosPago()
+ RegistraScript("$('#ModalComplementoPagos').modal('show');")
+ End Sub
+
+ Private Sub CargaComplementosPago()
+
+ Dim ObjBancos As New ClsBancos
+ DVGenerarComplementoModal.Visible = False
+
+ If ObjBancos.GetComplementoPagosRep(-1, MinFecha, MaxFecha, -1, -1, 1, UsuarioActual.CveEmpresa, 2, CvePrePoliza:=CvePrePoliza) Then
+ Dim dtt As DataTable = Nothing
+ dtt = ObjBancos.DtResultados
+ If dtt.Rows.Count > 0 Then
+ UpComplementoPagos.Visible = True
+ 'GvComplementoPagos.Columns(7).Visible = True
+ ' si tiene el permiso para eliminar IE o editar IE
+ 'If UsuarioActual.TienePermisoProceso(85) OrElse UsuarioActual.TienePermisoProceso(99) Then GvComplementoPagos.Columns(8).Visible = True
+ Else
+ DVGenerarComplementoModal.Visible = True
+ End If
+ GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "FolioFiscal", "SerieFolioPago", "FechaComplemento", "Importe", "CveIE"})
+
+ End If
+ ObjBancos.Dispose()
+ GvComplementoPagos.DataBind()
+ UpComplementoPagos.Update()
+
+ End Sub
+
Private Sub GeneraTimbre(CvePrePoliza As Integer)
Dim Str As New StringBuilder
Dim Banco As New ClsBancos
@@ -2094,6 +2123,18 @@ Partial Class ContabilidadC_RegPrePolizaS
Alert(Str.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();")
End Sub
+ Protected Sub GvComplementoPagos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvComplementoPagos.RowDataBound
+
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ 'If e.Row.DataKey("Tipo") = "Ing" Then
+ e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolioPago"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
+ e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolioPago"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
+
+ 'End If
+ End If
+ End Sub
+
Private Sub MandaCorreo(NombreArchivo As String, Correo As String, Optional ConAlerta As Boolean = True)
Try
Dim Msg As String = ""
@@ -2127,13 +2168,9 @@ Partial Class ContabilidadC_RegPrePolizaS
End Try
End Sub
- Protected Sub LnkComplementoPago_Click(sender As Object, e As EventArgs)
- GeneraTimbre(CvePrePoliza)
- End Sub
#End Region
-
#Region "E X C E L"
@@ -2709,5 +2746,9 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
UpModalConcepto.Update()
End Sub
+
+ Protected Sub LnkEmitirComplemento_Click(sender As Object, e As EventArgs)
+ GeneraTimbre(CvePrePoliza)
+ End Sub
End Class
diff --git a/Contabilidad/RepBalanceGeneral.aspx.vb b/Contabilidad/RepBalanceGeneral.aspx.vb
index 2d320e959..1828a1d0c 100644
--- a/Contabilidad/RepBalanceGeneral.aspx.vb
+++ b/Contabilidad/RepBalanceGeneral.aspx.vb
@@ -293,6 +293,11 @@ Partial Class Contabilidad_RepBalanceGeneral
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
+ If UsuarioActual.Empresa.TipoContabilidad = 1 Then
+ Response.Redirect($"/Contabilidad2/RepSituacionFinanciera.aspx")
+ End If
+
+
If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then
BtnConsultar.Enabled = True
TabNormal.Enabled = True
diff --git a/Contabilidad/RepEstadoResultados.aspx.vb b/Contabilidad/RepEstadoResultados.aspx.vb
index fabfe41ef..c38cf3d20 100644
--- a/Contabilidad/RepEstadoResultados.aspx.vb
+++ b/Contabilidad/RepEstadoResultados.aspx.vb
@@ -145,6 +145,9 @@ Partial Class Contabilidad_RepEstadoResultados
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
+ If UsuarioActual.Empresa.TipoContabilidad = 1 Then
+ Response.Redirect($"/Contabilidad2/RepEstadoActividades.aspx")
+ End If
If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then
diff --git a/Contabilidad2/RepBalanzaComprobacion.aspx b/Contabilidad2/RepBalanzaComprobacion.aspx
index faff6a40a..9d0440a3a 100644
--- a/Contabilidad2/RepBalanzaComprobacion.aspx
+++ b/Contabilidad2/RepBalanzaComprobacion.aspx
@@ -116,75 +116,89 @@
-
-
+
+
-
+
diff --git a/Contratos/RepPresupuestosDetalle.aspx.vb b/Contratos/RepPresupuestosDetalle.aspx.vb
index 06966b86a..5788852bb 100644
--- a/Contratos/RepPresupuestosDetalle.aspx.vb
+++ b/Contratos/RepPresupuestosDetalle.aspx.vb
@@ -87,14 +87,15 @@ Partial Class Contratos_RepPresupuestosDetalle
Gpo = IfNull(Request("CveAgrupador"), -1).ToString.ToEntero
Dim Mensual = CBool(IfNull(Request("Mensual"), False))
Dim EsProyecto = CBool(IfNull(Request("EsProyecto"), False))
- If Agrupador = 1 Then Agrupador = 2 Else Agrupador = 1
+ 'If Agrupador = 1 Then Agrupador = 2 Else Agrupador = 1
DdlAgrupador.SelectedValueExist(Agrupador)
- DdlClasificacion.SelectedValueExist(CveClasificacion)
- If DdlAgrupador.SelectedValue.ToEntero = 2 Then
+ DdlClasificacion.SelectedValueExist(CveClasificacion)
+
+ If DdlAgrupador.SelectedValue.ToEntero = 1 Then
DdlClasificacion.SelectedValueExist(Gpo)
DdlProyecto.SelectedValueExist(CveProyecto)
DdlSubProyecto.SelectedValueExist(CveSubProyecto)
- ElseIf DdlAgrupador.SelectedValue.ToEntero = 1 Then
+ ElseIf DdlAgrupador.SelectedValue.ToEntero = 2 Then
If Not EsProyecto Then
Dim Dr As DataRow = GlobalDTSubProyectos(-1, Gpo)(0)
DdlProyecto.SelectedValueExist(Dr("CveProyecto"))
@@ -158,20 +159,20 @@ Partial Class Contratos_RepPresupuestosDetalle
e.Row.Cells(1).Text = "-"
End If
If e.Row.DBCampo("Ejercido").ToDecimal = 0 Then
- e.Row.Cells(2).Text = "-"
- End If
- If e.Row.DBCampo("EjercidoPorcentaje").ToDecimal = 0 Then
e.Row.Cells(3).Text = "-"
End If
- If e.Row.DBCampo("PorEjercer").ToDecimal = 0 Then
+ If e.Row.DBCampo("EjercidoPorcentaje").ToDecimal = 0 Then
e.Row.Cells(4).Text = "-"
End If
- If e.Row.DBCampo("PorEjercerPorcentaje").ToDecimal = 0 Then
+ If e.Row.DBCampo("PorEjercer").ToDecimal = 0 Then
e.Row.Cells(5).Text = "-"
End If
- If e.Row.DBCampo("Pagado").ToDecimal = 0 Then
+ If e.Row.DBCampo("PorEjercerPorcentaje").ToDecimal = 0 Then
e.Row.Cells(6).Text = "-"
End If
+ If e.Row.DBCampo("Pagado").ToDecimal = 0 Then
+ e.Row.Cells(7).Text = "-"
+ End If
If e.Row.RowIndex > 0 Then
Dim CveAgrupador = e.Row.DBCampo("CveAgrupador").ToEntero
Dim EsProyecto = False
@@ -185,9 +186,13 @@ Partial Class Contratos_RepPresupuestosDetalle
End If
EsProyecto = True
End If
- Dim Css = "Texto"
+ Dim Css = "Texto"
+
Dim Liga = $"/Contratos/RepPresupuestosDetalleCompras.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveConceptoContableNom={e.Row.DBCampo("CveConceptoContableNomFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}"
e.Row.Cells(0).Text = "" + e.Row.Cells(0).Text + ""
+
+ Dim LigaComprometido = $"/Contratos/RepPresupuestosDetalleCompras.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveConceptoContableNom={e.Row.DBCampo("CveConceptoContableNomFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}&Comprometido=1"
+ e.Row.Cells(2).Text = "" + e.Row.Cells(2).Text + ""
End If
End If
End Sub
diff --git a/Contratos/RepPresupuestosDetalleCompras.aspx b/Contratos/RepPresupuestosDetalleCompras.aspx
index a6f50fb94..f251ca390 100644
--- a/Contratos/RepPresupuestosDetalleCompras.aspx
+++ b/Contratos/RepPresupuestosDetalleCompras.aspx
@@ -219,7 +219,7 @@
-
Clasificacion:
+
Clasificación:
diff --git a/Contratos/RepPresupuestosDetalleCompras.aspx.vb b/Contratos/RepPresupuestosDetalleCompras.aspx.vb
index 08d386d3f..f1dafa0e4 100644
--- a/Contratos/RepPresupuestosDetalleCompras.aspx.vb
+++ b/Contratos/RepPresupuestosDetalleCompras.aspx.vb
@@ -2,11 +2,14 @@
Option Strict On
Imports System.Data
Imports Extensiones
+Imports Org.BouncyCastle.Asn1.Ocsp
Partial Class Contratos_RepPresupuestosDetalleCompras
- Inherits ClsPaginas
-
+ Inherits ClsPaginas
+
+
+
#Region "P R O P I E D A D E S"
-
+
Public Property Gpo() As Integer
Get
Return DirectCast(ViewState("Gpo"), Integer)
@@ -14,8 +17,20 @@ Partial Class Contratos_RepPresupuestosDetalleCompras
Set(ByVal value As Integer)
ViewState("Gpo") = value
End Set
- End Property
-
+ End Property
+
+ Public Property Comprometido As Boolean
+ Get
+ If ViewState("Comprometido") Is Nothing Then
+ ViewState("Comprometido") = False
+ End If
+ Return Boolean.Parse(ViewState("Comprometido").ToString)
+ End Get
+ Set(value As Boolean)
+ ViewState("Comprometido") = value
+ End Set
+ End Property
+
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -25,8 +40,8 @@ Partial Class Contratos_RepPresupuestosDetalleCompras
CargaDatos()
End If
- End Sub
-
+ End Sub
+
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
@@ -71,7 +86,11 @@ Partial Class Contratos_RepPresupuestosDetalleCompras
Dim CveProyecto = IfNull(Request("CveProyecto"), -1).ToString.ToEntero
Dim CveSubProyecto = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero
Dim CveTipoGasto = IfNull(Request("CveTipoGasto"), -1).ToString.ToEntero
- Dim Agrupador = IfNull(Request("Agrupador"), -1).ToString.ToEntero
+ Dim Agrupador = IfNull(Request("Agrupador"), -1).ToString.ToEntero
+
+ Comprometido = If(Request("Comprometido") IsNot Nothing AndAlso Request("Comprometido").ToEntero = 1, True, False)
+
+
Gpo = IfNull(Request("CveAgrupador"), -1).ToString.ToEntero
Dim EsProyecto = CBool(IfNull(Request("EsProyecto"), False))
If Agrupador = 1 Then Agrupador = 2 Else Agrupador = 1
@@ -106,7 +125,8 @@ Partial Class Contratos_RepPresupuestosDetalleCompras
End Sub
Private Sub CargaDatos()
Dim ObjPresupuestos As New ClsContratos
- If ObjPresupuestos.GetPresupuestosRepDetalleCompras(DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlTipoGasto.SelectedValue.ToEntero, TxtFiltrosFechaInicio.Text.ToDate, TxtFiltrosFechaFin.Text.ToDate, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
+ If ObjPresupuestos.GetPresupuestosRepDetalleCompras(DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlTipoGasto.SelectedValue.ToEntero, TxtFiltrosFechaInicio.Text.ToDate,
+ TxtFiltrosFechaFin.Text.ToDate, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Comprometido:=Comprometido) Then
GvDatos.DataSource = ObjPresupuestos.DtResultados
End If
ObjPresupuestos.Dispose()
@@ -131,15 +151,21 @@ Partial Class Contratos_RepPresupuestosDetalleCompras
Dim Liga = ""
Dim Css = "Texto"
- Dim TipoAgrupador As Integer = e.Row.DBCampo("TipoAgrupador").ToEntero()
- Select Case TipoAgrupador
- Case 1
- Liga = $"/Compras/Compras.aspx?&CveCompra={e.Row.DBCampo("CveCompra")}"
- Case 2
- Liga = $"/Contabilidad/RegPrePoliza.aspx?&CvePrePoliza={e.Row.DBCampo("CveCompra")}"
- Case Else
+
+ If Comprometido Then
+ Liga = $"/OC/OC.aspx?OC={e.Row.DBCampo("CveOrdenCompra")}"
+ Else
+ Dim TipoAgrupador As Integer = e.Row.DBCampo("TipoAgrupador").ToEntero()
+ Select Case TipoAgrupador
+ Case 1
+ Liga = $"/Compras/Compras.aspx?&CveCompra={e.Row.DBCampo("CveCompra")}"
+ Case 2
+ Liga = $"/Contabilidad/RegPrePoliza.aspx?&CvePrePoliza={e.Row.DBCampo("CveCompra")}"
+ Case Else
+
+ End Select
+ End If
- End Select
e.Row.Cells(0).Text = "" + e.Row.Cells(0).Text + ""
End If
End If
diff --git a/Empresas/186/Formatos/Consola.rdlc b/Empresas/186/Formatos/Consola.rdlc
index 39b8cb463..dc935ddee 100644
--- a/Empresas/186/Formatos/Consola.rdlc
+++ b/Empresas/186/Formatos/Consola.rdlc
@@ -1599,7 +1599,7 @@
- EQUIOP A PRESTAMO PARA CIRUGÍA
+ EQUIPO A PRESTAMO PARA CIRUGÍA
diff --git a/Empresas/Grales/Formatos/Polizas.rdlc b/Empresas/Grales/Formatos/Polizas.rdlc
index 42e9d4893..e77be5ab6 100644
--- a/Empresas/Grales/Formatos/Polizas.rdlc
+++ b/Empresas/Grales/Formatos/Polizas.rdlc
@@ -1488,6 +1488,295 @@
+
+ 2.44729cm
+
+
+
+
+ true
+ true
+
+
+
+
+ Usuario Registró:
+
+
+
+
+
+
+
+
+ =Fields!NombreUsuario.Value
+
+
+
+
+
+
+ UsuarioRegistro1
+
+ =IIF(IsNothing(Parameters!UsuarioRegistro.Value) OR LEN(CStr(Parameters!UsuarioRegistro.Value)) = 0, True, False)
+
+
+
+ Bottom
+ 1pt
+ 1pt
+ 1pt
+ 1pt
+
+
+ 3
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ Textbox13
+
+ =IIF(IsNothing(Parameters!UsuarioRegistro.Value) OR LEN(CStr(Parameters!UsuarioRegistro.Value)) = 0, True, False)
+
+
+
+ 1pt
+ 1pt
+ 1pt
+ 1pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ Textbox15
+
+ =IIF(IsNothing(Parameters!UsuarioRegistro.Value) OR LEN(CStr(Parameters!UsuarioRegistro.Value)) = 0, True, False)
+
+
+
+ 1pt
+ 1pt
+ 1pt
+ 1pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ Textbox16
+
+ =IIF(IsNothing(Parameters!UsuarioRegistro.Value) OR LEN(CStr(Parameters!UsuarioRegistro.Value)) = 0, True, False)
+
+
+
+ 1pt
+ 1pt
+ 1pt
+ 1pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ Textbox18
+
+ =IIF(IsNothing(Parameters!UsuarioRegistro.Value) OR LEN(CStr(Parameters!UsuarioRegistro.Value)) = 0, True, False)
+
+
+
+
+ Black
+
+ 1pt
+
+ 1pt
+ 1pt
+ 1pt
+ 1pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ Textbox19
+
+ =IIF(IsNothing(Parameters!UsuarioRegistro.Value) OR LEN(CStr(Parameters!UsuarioRegistro.Value)) = 0, True, False)
+
+
+
+
+
+
+ 1pt
+ 1pt
+ 1pt
+ 1pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ Textbox20
+
+ =IIF(IsNothing(Parameters!UsuarioRegistro.Value) OR LEN(CStr(Parameters!UsuarioRegistro.Value)) = 0, True, False)
+
+
+
+
+
+
+ 1pt
+ 1pt
+ 1pt
+ 1pt
+
+
+
+
+
+
@@ -1548,6 +1837,9 @@
Before
+
+ Before
+
@@ -1559,7 +1851,7 @@
true0.05076cm
- 3.18542cm
+ 5.63271cm19.38789cm
- 3.59805cm
+ 5.68347cm