Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
115
.gitignore
vendored
115
.gitignore
vendored
@@ -10,3 +10,118 @@
|
||||
/LogMail.txt
|
||||
/.vs
|
||||
/packages
|
||||
/Temp/637019018406489106-FormatoPS (1).xlsx
|
||||
/Temp/637025911245561139-FormatoAlmacenTest2.xlsx
|
||||
/Temp/637025910298823073-FormatoAlmacenTest2.xlsx
|
||||
/Temp/637025890843842072-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025890070124286-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025889649837823-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025888979809566-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025888317991027-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025886969280729-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025883478481189-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025881893726971-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025875318390368-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025873461693799-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025867243299753-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025866028329141-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025858967837880-FormatoAlmacen (8).xlsx
|
||||
/Temp/637025856623805153-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025854225974598-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025850746443741-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025849906896827-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025811751064573-FormatoAlmacen (9).xlsx
|
||||
/Temp/637025802306385270-FormatoAlmacen (9).xlsx
|
||||
/Temp/637024955677385188-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024223339157610-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024211080831453-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024208748075824-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024206124827330-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024198603668842-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024194937999485-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024187194477421-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024175396114926-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024174152414578-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024172516905613-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024172339379953-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024168678743644-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024167899990250-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024163796303799-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024162382548932-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024154734150595-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024152618695056-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024129146071459-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024111695874769-FormatoAlmacen(1).xlsx
|
||||
/Temp/637022418959236013-FormatoAlmacen (4).xlsx
|
||||
/Temp/637022412610855769-FormatoAlmacen (4).xlsx
|
||||
/Temp/637022411585353362-FormatoAlmacen (4).xlsx
|
||||
/Temp/637022404788752537-FormatoAlmacen (3).xlsx
|
||||
/Temp/637022403501450734-FormatoAlmacen (3).xlsx
|
||||
/Temp/637022402924630398-FormatoAlmacen (3).xlsx
|
||||
/Temp/637022401250489074-FormatoAlmacen (5).xlsx
|
||||
/Temp/637022398545213986-FormatoAlmacen (3).xlsx
|
||||
/Temp/637022382214133336-FormatoAlmacen (5).xlsx
|
||||
/Temp/637022380557097080-FormatoAlmacen (5).xlsx
|
||||
/Temp/637022379412790662-FormatoAlmacen (5).xlsx
|
||||
/Temp/637022378793902185-FormatoAlmacen (5).xlsx
|
||||
/Temp/637021654534481890-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021651345315739-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021616508913486-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021593875864770-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021592631992296-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021592488982043-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021560097934922-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021554559110062-FormatoPS (1).xlsx
|
||||
/Temp/637021550053083909-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021547214247040-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021545638924577-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021527971651311-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021527073950270-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021526064707043-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021522586485282-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021521403851473-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021519837377736-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021515778751967-FormatoAlmacen (3).xlsx
|
||||
/Temp/637020728341171393-FormatoAlmacen (2).xlsx
|
||||
/Temp/637020724850629405-FormatoAlmacen (2).xlsx
|
||||
/Temp/637020723186758192-FormatoAlmacen (2).xlsx
|
||||
/Temp/637020721382428289-FormatoAlmacen (2).xlsx
|
||||
/Temp/637019818530193505-FormatoPS (1).xlsx
|
||||
/Temp/637019811169546741-FormatoPS (1).xlsx
|
||||
/Temp/637019803848526814-FormatoPS (1).xlsx
|
||||
/Temp/637019796396388291-FormatoPS (1).xlsx
|
||||
/Temp/637019783731773074-FormatoPS (1).xlsx
|
||||
/Temp/637019781961714106-FormatoPS (1).xlsx
|
||||
/Temp/637019780290041928-FormatoPS (1).xlsx
|
||||
/Temp/637019777705293557-FormatoPS (1).xlsx
|
||||
/Temp/637019766664551609-FormatoPS (1).xlsx
|
||||
/Temp/637019765307733182-FormatoPS (1).xlsx
|
||||
/Temp/637019764041447352-FormatoPS (1).xlsx
|
||||
/Temp/637019759922681271-FormatoPS (1).xlsx
|
||||
/Temp/637019028539049368-FormatoPS (1).xlsx
|
||||
/Temp/637019027752495331-FormatoPS (1).xlsx
|
||||
/Temp/637019026870914833-FormatoPS (1).xlsx
|
||||
/Temp/637019020024023961-FormatoPS (1).xlsx
|
||||
/Temp/637019018783282466-FormatoPS (1).xlsx
|
||||
/Temp/637025921934403738-FormatoAlmacen (4)(1).xlsx
|
||||
/Temp/637025871940254054-FormatoAlmacenTest.xlsx
|
||||
/Temp/637025819297716436-FormatoAlmacen (9).xlsx
|
||||
/Temp/637025813094826506-FormatoAlmacen (9).xlsx
|
||||
/Temp/637025803627482072-FormatoAlmacen (9).xlsx
|
||||
/Temp/637024210197949659-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024207387517397-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024203939520361-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024200918571845-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024199786848948-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024188637374314-FormatoAlmacen (8).xlsx
|
||||
/Temp/637024170730017118-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024164939543846-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024164072145623-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024156159485931-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024153420640718-FormatoAlmacen(1).xlsx
|
||||
/Temp/637024148711869965-FormatoAlmacen(1).xlsx
|
||||
/Temp/637022414752610497-FormatoAlmacen (4).xlsx
|
||||
/Temp/637021629396074854-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021627402424201-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021547606916146-FormatoAlmacen (3).xlsx
|
||||
/Temp/637021529455078900-FormatoAlmacen (3).xlsx
|
||||
|
||||
@@ -2005,7 +2005,7 @@ Public Class ClsContPAQi
|
||||
''' <remarks></remarks>
|
||||
'''
|
||||
Public Function AddPoliza(TipoPol As Integer, Concepto As String, Cargos As Double, Abonos As Double, CveUsuario As Integer, FechaPoliza As Date, Optional pFolio As String = "-1",
|
||||
Optional pTipo As String = "", Optional Guid As String = "-1") As Integer
|
||||
Optional pTipo As String = "", Optional Guid As String = "-1", Optional CvePlantillaPoliza As Integer = -1) As Integer
|
||||
'Tipo As String, pFolioPoliza As Integer) As Boolean
|
||||
Dim Retorno As Integer = 0
|
||||
If Guid = "-1" Then Guid = System.Guid.NewGuid().ToString()
|
||||
@@ -2078,11 +2078,11 @@ Public Class ClsContPAQi
|
||||
|
||||
StrSQL.AppendLine(" INSERT INTO Polizas (Id, RowVersion, Ejercicio, Periodo, TipoPol, Folio, Clase, Impresa, ")
|
||||
StrSQL.AppendLine(" Concepto, Fecha, Cargos, Abonos, IdDiario, SistOrig, Ajuste, IdUsuario, ")
|
||||
StrSQL.AppendLine(" ConFlujo, ConCuadre, TimeStamp,Guid)")
|
||||
StrSQL.AppendLine(" ConFlujo, ConCuadre, TimeStamp,Guid,CvePlantillaPoliza)")
|
||||
StrSQL.AppendLine(" ")
|
||||
StrSQL.AppendLine(" VALUES (@IdPoliza, @RowVersion, @Ejercicio, @Periodo, @TipoPol, @Folio, @Clase, @Impresa, ")
|
||||
StrSQL.AppendLine(" @Concepto, @Fecha, ROUND(@Cargos,2), ROUND(@Abonos,2), @IdDiario, @SistOrig, @Ajuste, @IdUsuario, ")
|
||||
StrSQL.AppendLine(" @ConFlujo, @ConCuadre, @TimeStamp,@Guid)")
|
||||
StrSQL.AppendLine(" @ConFlujo, @ConCuadre, @TimeStamp,@Guid,@CvePlantillaPoliza)")
|
||||
StrSQL.AppendLine(" ")
|
||||
StrSQL.AppendLine(" EXEC PA_UpdateId 'Id_Poliza';")
|
||||
StrSQL.AppendLine(" ")
|
||||
@@ -2123,6 +2123,7 @@ Public Class ClsContPAQi
|
||||
.Add("@FechaPoliza", SqlDbType.DateTime).Value = FechaPoliza
|
||||
.Add("@pFolio", SqlDbType.VarChar).Value = pFolio
|
||||
.Add("@Guid", SqlDbType.VarChar).Value = Guid
|
||||
.Add("@CvePlantillaPoliza", SqlDbType.Int).Value = CvePlantillaPoliza
|
||||
.Add("@IdPoliza", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
@@ -7308,7 +7309,7 @@ Public Class ClsContPAQi
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetPolizasMasivo(Inicio As Date, Fin As Date, FolioI As Integer, FolioF As Integer, TipoPol As Integer, CveUsuario As Integer, CveSubProyecto As Integer, CveCuenta As Integer) As Boolean
|
||||
Public Function GetPolizasMasivo(Inicio As Date, Fin As Date, FolioI As Integer, FolioF As Integer, TipoPol As Integer, CveUsuario As Integer, CveSubProyecto As Integer, CveCuenta As Integer, CveGrupoPlantillaPoliza As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
StrSQL.Clear()
|
||||
@@ -7338,6 +7339,12 @@ Public Class ClsContPAQi
|
||||
StrSQL.Append(" AND (@CveSubProyecto = -1 OR ( MP.IdPoliza IN (SELECT IdPoliza FROM @DtSeg)) OR (@CveSubProyecto = -2 AND MP.IdSegNeg = 0) ) ")
|
||||
StrSQL.Append(" AND (@CveUsuario = -1 OR P.IdUsuario = @CveUsuario) ")
|
||||
StrSQL.Append(" AND (@Cvecuenta = -1 OR C.Id = @Cvecuenta) ")
|
||||
StrSQL.Append(" AND (@CveGrupoPlantillaPoliza = -1
|
||||
OR ( @CveGrupoPlantillaPoliza = 1 AND ISNULL(P.CvePlantillaPoliza,0) IN (1,22,43, 53, 60, 69, 74, 58, 59, 58, 59, 61, 62, 70,78, 89,94,95,96, 97,99,
|
||||
64,65,68,72,75,79,80,81,82,83,84,90,91,93,40,41,42,48,54,55,14,24,32,34,37) )
|
||||
OR ( @CveGrupoPlantillaPoliza = 2 AND ISNULL(P.CvePlantillaPoliza,0) IN (4,7,47,10,12,74) )
|
||||
OR ( @CveGrupoPlantillaPoliza = 3 And ISNULL(P.CvePlantillaPoliza,0) IN (2, 3, 5, 8, 9, 13,15,17,19,21, 36,44, 45, 49, 50, 51, 52, 56, 57, 67, 71,73,77,85,86,87,88, 92,98,76,23,38) )
|
||||
OR ( @CveGrupoPlantillaPoliza = 4 AND ISNULL(P.CvePlantillaPoliza,0) IN (6, 11,16, 63,46,47,39,100) ) )")
|
||||
StrSQL.Append(" ORDER BY P.Folio, MP.NumMovto ")
|
||||
StrSQL.Append(" END; ")
|
||||
|
||||
@@ -7353,6 +7360,8 @@ Public Class ClsContPAQi
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@cvecuenta", SqlDbType.Int).Value = CveCuenta
|
||||
.Add("@CveGrupoPlantillaPoliza", SqlDbType.Int).Value = CveGrupoPlantillaPoliza
|
||||
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -1050,7 +1050,7 @@ Public Class ClsContabilidad
|
||||
|
||||
|
||||
Dim tIdPoliza As Integer
|
||||
Dim CveTipoPoliza, FolioFijo As Integer
|
||||
Dim CveTipoPoliza, FolioFijo, CvePlantillaPoliza As Integer
|
||||
Dim Cargos As Decimal
|
||||
Dim Abonos As Decimal
|
||||
Dim NumPoliza As String = ""
|
||||
@@ -1087,6 +1087,7 @@ Public Class ClsContabilidad
|
||||
FolioFijo = Data.Rows(0)("FolioFijo").ToString.ToEntero
|
||||
TipoPoliza = Data.Rows(0)("TipoPoliza").ToString
|
||||
CodigoNumeroPoliza = Data.Rows(0)("CodigoNumeroPoliza").ToString
|
||||
CvePlantillaPoliza = Data.Rows(0)("CvePlantillaPoliza").ToString.ToEntero
|
||||
|
||||
'FolioFiscal = Data.Rows(0)("FolioFiscal").ToString
|
||||
'MetodoPagoSAT = Data.Rows(0)("ClaveSAT").ToString
|
||||
@@ -1106,7 +1107,7 @@ Public Class ClsContabilidad
|
||||
ObjConta.RemoveCausacionesIVA(-1, tIdPoliza)
|
||||
ObjConta.RemoveDevolucionesIVA(-1, tIdPoliza)
|
||||
Else
|
||||
tIdPoliza = ObjConta.AddPoliza(CveTipoPoliza, Concepto, Cargos, Abonos, CveUsuario, Fecha, FolioFijo.ToString, CodigoNumeroPoliza)
|
||||
tIdPoliza = ObjConta.AddPoliza(CveTipoPoliza, Concepto, Cargos, Abonos, CveUsuario, Fecha, FolioFijo.ToString, CodigoNumeroPoliza, CvePlantillaPoliza:=CvePlantillaPoliza)
|
||||
ContaFolio = ObjConta.Folio.ToString
|
||||
End If
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ Public Class ClsVentas
|
||||
Public Sub RollBack()
|
||||
SqlTransacc.Rollback()
|
||||
End Sub
|
||||
Private CveConexion As Integer = 0
|
||||
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
|
||||
|
||||
If TransaccionCompartida Is Nothing Then
|
||||
@@ -82,6 +83,7 @@ Public Class ClsVentas
|
||||
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
|
||||
Try
|
||||
SqlConexion.Open()
|
||||
ConexionAdd()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
|
||||
End Try
|
||||
@@ -102,6 +104,45 @@ Public Class ClsVentas
|
||||
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
|
||||
Data = New DataTable
|
||||
End Sub
|
||||
|
||||
#Region "Conexiones"
|
||||
|
||||
Private Sub ConexionAdd()
|
||||
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||
|
||||
DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsVentas',{0})", HttpContext.Current.Request.Url.Authority), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@CveConexion", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
CveConexion = SqlAdapter.SelectCommand.Parameters("@Opcion").Value.ToString.ToEntero
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ConexionClose()
|
||||
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
|
||||
|
||||
DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE WHERE CveConexion = ", CveConexion), CommandType.Text)
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Public Function GetVenta(CveVenta As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_VentasGet")
|
||||
|
||||
@@ -2780,23 +2780,17 @@ Namespace Modelos
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
If DtRemisionesRelacionadas Is Nothing Then
|
||||
If ObjVentas.GetRemisionesRelacionadas(ObjFactura.CveVenta, ObjFactura.TipoDocto) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
DtRemisionesRelacionadas = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjFactura.RemisionesLista.Count = 0 AndAlso (DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) Then
|
||||
For Each Row As DataRow In DtRemisionesRelacionadas.Rows
|
||||
ObjFactura.RemisionesLista.Add(Row("CveVenta").ToString().ToEntero())
|
||||
Next
|
||||
End If
|
||||
|
||||
'Si es Facturacion de una remision cancelamos, traspasamos saldos y agregamos evento a la bitacora
|
||||
If (DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) OrElse ObjFactura.RemisionesLista.Count > 0 Then
|
||||
|
||||
If ObjFactura.RemisionesLista.Count = 0 AndAlso (DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) Then
|
||||
For Each Row As DataRow In DtRemisionesRelacionadas.Rows
|
||||
ObjFactura.RemisionesLista.Add(Row("CveVenta").ToString().ToEntero())
|
||||
Next
|
||||
End If
|
||||
|
||||
If ObjFactura.RemisionesLista.Count > 0 Then
|
||||
For Each CveRemision As Integer In RemisionesLista
|
||||
If Not ObjConta.TraspasarSaldosRemision(CveRemision, ObjFactura.CvePrePoliza, ObjFactura.CveVenta) Then
|
||||
@@ -2817,25 +2811,30 @@ Namespace Modelos
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
'REGRESA SALDO A LAS REMISIONES QUE SE FACTURARON EN EL INGRESO QUE SE ESTA CANCELANDO
|
||||
If ObjFactura.TipoDocto = "Ing" And ValorMultiplicador = -1 AndAlso NuevaFactura <> 1 AndAlso Not SeCancelaRemisionProceso Then ' se debe de excluir cuando es refacturación
|
||||
For Each Dr As DataRow In DtRemisionesRelacionadas.Rows
|
||||
|
||||
Dim DebeCancelar As Boolean = CancelarRemisiones AndAlso ListaRemisionesCancelar.Any(Function(CveRemision) CveRemision = Dr("CveVenta").ToString.ToEntero())
|
||||
|
||||
If Not DebeCancelar Then
|
||||
If Not ObjConta.TraspasarSaldosRemision(Dr("CveVenta").ToString.ToEntero, ObjFactura.CvePrePoliza, ObjFactura.CveVenta, 1) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
If Not ObjEventos.AddEventoBitacora($"Facturación cancelada en: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=Dr("CveVenta").ToString.ToEntero) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If DtRemisionesRelacionadas Is Nothing Then
|
||||
If ObjVentas.GetRemisionesRelacionadas(ObjFactura.CveVenta, ObjFactura.TipoDocto) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
DtRemisionesRelacionadas = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
End If
|
||||
|
||||
'REGRESA SALDO A LAS REMISIONES QUE SE FACTURARON EN EL INGRESO QUE SE ESTA CANCELANDO
|
||||
If ObjFactura.TipoDocto = "Ing" And ValorMultiplicador = -1 AndAlso NuevaFactura <> 1 AndAlso Not SeCancelaRemisionProceso AndAlso DtRemisionesRelacionadas IsNot Nothing Then ' se debe de excluir cuando es refacturación
|
||||
For Each Dr As DataRow In DtRemisionesRelacionadas.Rows
|
||||
|
||||
Dim DebeCancelar As Boolean = CancelarRemisiones AndAlso ListaRemisionesCancelar.Any(Function(CveRemision) CveRemision = Dr("CveVenta").ToString.ToEntero())
|
||||
|
||||
If Not DebeCancelar Then
|
||||
If Not ObjConta.TraspasarSaldosRemision(Dr("CveVenta").ToString.ToEntero, ObjFactura.CvePrePoliza, ObjFactura.CveVenta, 1) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
If Not ObjEventos.AddEventoBitacora($"Facturación cancelada en: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=Dr("CveVenta").ToString.ToEntero) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
@@ -3583,6 +3582,13 @@ Namespace Modelos
|
||||
|
||||
Dim TieneAlmacen As Boolean = False
|
||||
|
||||
If ObjFactura.SaldoAlmacen <> 0 Then
|
||||
Retorno.Mensaje = "El pedido no se puede cancelar ya que tiene movimientos de almacén.<br/>Nota: Primero hay que hacer la devolución al almacén."
|
||||
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
||||
|
||||
Return Retorno
|
||||
End If
|
||||
|
||||
'VALIDA QUE LA FACTURA NO TENGA PAGOS
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Rem") AndAlso ObjFactura.Pagado > 0 Then
|
||||
Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados."
|
||||
@@ -3608,7 +3614,7 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
'LA VALIDACION DE SALDOS CUANDO ES REFACTURACION SE HACE ANTES ASI QUE SI ES REFACTURACION IGNORAMOS ESTA CONDICION, SI ES ANTICIPO VERIFICA QUE NO ESTÉ APLICADO
|
||||
If ObjFactura.TipoDocto = "Ant" AndAlso ObjFactura.Pagado > 0 AndAlso DTDocumentosRelacionados.Rows.Count > 0 Then
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Rem") AndAlso ObjFactura.Pagado > 0 AndAlso DTDocumentosRelacionados.Rows.Count > 0 Then
|
||||
Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados."
|
||||
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
||||
|
||||
@@ -3670,7 +3676,7 @@ Namespace Modelos
|
||||
Dim RevivirRemisiones = Not EsRefacturacion AndAlso ((TieneRemisionesRelacionadas AndAlso ListaRemisionesCancelar Is Nothing) OrElse (DtRemisionesRelacionadas.Rows.Count > ListaRemisionesCancelar.Count))
|
||||
|
||||
'REMISION YA SE DEBE HACER POR EL PROCESO DE DEVOLUCION DE ALMACEN
|
||||
If Not EsRefacturacion AndAlso (ObjFactura.SaldoAlmacen > 0 AndAlso ObjFactura.EsDevolucionVenta.Contiene(0, 1)) AndAlso Not RealizarDevolucionAlmacen And RevivirRemisiones = False Then
|
||||
If Not EsRefacturacion AndAlso (ObjFactura.SaldoAlmacen <> 0 AndAlso ObjFactura.EsDevolucionVenta.Contiene(0, 1)) AndAlso Not RealizarDevolucionAlmacen And RevivirRemisiones = False Then
|
||||
|
||||
Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene movimientos de inventario."
|
||||
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
|
||||
@@ -4190,7 +4196,8 @@ Namespace Modelos
|
||||
|
||||
End If
|
||||
|
||||
Dim CveEstatusRefacturacion As Integer = 0
|
||||
Dim CveEstatusRefacturacion As Integer = If(ObjFactura.CveEstatusRefacturacion <= 0, 0, ObjFactura.CveEstatusRefacturacion)
|
||||
|
||||
'ACTUALIZA ESTATUS
|
||||
If Not ErrorCancelar Then
|
||||
Select Case ObjFactura.TipoDocto
|
||||
@@ -4208,11 +4215,17 @@ Namespace Modelos
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion,
|
||||
CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd hh:mm:ss.mmm")) Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al guardar el estatus de cancelación."
|
||||
If CveEstatus.Contiene(4, 5) Then
|
||||
If Not ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion) Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al guardar el estatus de cancelación."
|
||||
End If
|
||||
Else
|
||||
If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion,
|
||||
CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd hh:mm:ss.mmm")) Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al guardar el estatus de cancelación."
|
||||
End If
|
||||
End If
|
||||
|
||||
If CancelarRemisiones Then
|
||||
@@ -4701,8 +4714,8 @@ Namespace Modelos
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "P R O P I E D A D E S"
|
||||
|
||||
#Region "P R O P I E D A D E S"
|
||||
Public Property CveEstatusRefacturacion As Integer = 0
|
||||
Public Property NuevaFactura As Integer
|
||||
Public Property EnviarCorreo As Boolean = False
|
||||
Public Property ErrorList As List(Of String)
|
||||
|
||||
@@ -33,7 +33,8 @@ Partial Class Bancos_CuentasBancariasDetalle
|
||||
CargarMoneda()
|
||||
ViewState("DTUsuarios") = Nothing
|
||||
|
||||
DdlUsuarios.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "Nombre")
|
||||
Dim tablaUsuariosAux As DataTable = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "Nombre", DistinctColumns:={"CveUsuario", "Nombre", "Usuario"})
|
||||
DdlUsuarios.DataSource = CargarDdlUsuarios(tablaUsuariosAux)
|
||||
DdlUsuarios.DataBind()
|
||||
|
||||
If Request("CveCuenta") IsNot Nothing AndAlso IsNumeric(Request("CveCuenta")) AndAlso Request("CveCuenta").ToEntero > 0 Then
|
||||
@@ -678,6 +679,27 @@ Partial Class Bancos_CuentasBancariasDetalle
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function CargarDdlUsuarios(UsuariosGlobal As DataTable) As DataTable
|
||||
Dim tablaUsuariosFormateada As DataTable = New DataTable("Usuarios")
|
||||
|
||||
Dim columnaNombre As DataColumn = New DataColumn("Nombre")
|
||||
columnaNombre.DataType = System.Type.GetType("System.String")
|
||||
Dim columnaCveUsuario As DataColumn = New DataColumn("CveUsuario")
|
||||
columnaCveUsuario.DataType = System.Type.GetType("System.String")
|
||||
|
||||
tablaUsuariosFormateada.Columns.Add(columnaNombre)
|
||||
tablaUsuariosFormateada.Columns.Add(columnaCveUsuario)
|
||||
|
||||
For Each eachRegistro As DataRow In UsuariosGlobal.Rows
|
||||
Dim renglonAux As DataRow = tablaUsuariosFormateada.NewRow()
|
||||
|
||||
renglonAux.Item("Nombre") = $"{eachRegistro.Item("Nombre")}({eachRegistro.Item("Usuario")})"
|
||||
renglonAux.Item("CveUsuario") = eachRegistro.Item("CveUsuario")
|
||||
|
||||
tablaUsuariosFormateada.Rows.Add(renglonAux)
|
||||
Next
|
||||
Return tablaUsuariosFormateada
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
@@ -3939,7 +3939,7 @@ Partial Class Bancos_IE
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Se presento un error al cancelar el complemento.")
|
||||
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Else
|
||||
ErrorCancelarComplemento = False
|
||||
|
||||
@@ -6207,7 +6207,6 @@ Partial Class Compras_Compras
|
||||
|
||||
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
'Conta ContPAQ
|
||||
If IdCtaContable = 0 Then
|
||||
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString)
|
||||
@@ -6224,9 +6223,8 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Dim ContienePSNeteoBonif As Boolean = False
|
||||
Dim ContienePSNeteoBonif As Boolean = False
|
||||
For Each Dr As DataRow In TmpDT.Rows
|
||||
If Dr("CveClasificacion").ToString.ToEntero.Contiene(20319) Then 'clasificación de Bonificación, no se incluirá en el neteo
|
||||
ContienePSNeteoBonif = True
|
||||
|
||||
@@ -84,6 +84,16 @@
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlCuenta" DataTextField="CodigoNombre" DataValueField="Id" CssClass="form-control input-sm select2me" runat="server"></asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 truncate" data-toggle="tooltip" data-placement="top" title="Grupo Plantilla">Grupo Plantilla:</label>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlGrupoPlantilla" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Compras" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Ventas" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Pago Compra" Value="3"></asp:ListItem>
|
||||
<asp:ListItem Text="Pago Venta" Value="4"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -40,7 +40,7 @@ Partial Class Contabilidad_PolizasImpresion
|
||||
|
||||
|
||||
Dim objcont As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
If objcont.GetPolizasMasivo(TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, foli, folf, ddlTipoPoliza.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlSegmentoNeg.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero) Then
|
||||
If objcont.GetPolizasMasivo(TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, foli, folf, ddlTipoPoliza.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlSegmentoNeg.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, DdlGrupoPlantilla.SelectedValue.ToEntero) Then
|
||||
If objcont.DtResultados.Rows.Count < 10000 Then
|
||||
|
||||
If objcont.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
4
LogTimbrado.txt
Normal file
4
LogTimbrado.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
.. PAC: 4 - Verificado : (5) 5 Certificado : (501) 506 Armado: (25) 531 Genera: (494) 1025 Timbrado: (748) 1773 ..20/08/2019:03:33 p. m.
|
||||
|
||||
.. PAC: 4 - Verificado : (2) 2 Certificado : (388) 390 Armado: (4) 394 Genera: (440) 834 Timbrado: (1030) 1864 Guardado: (361) 2225 Actualizado: (99) 2324 ..20/08/2019:03:39 p. m.
|
||||
@@ -17455,7 +17455,11 @@ Partial Class Ventas
|
||||
If resp.CveEstatus = 5 Then
|
||||
Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:="BtnEnviarMailCancelacion();", TextoConfirmacion:=" Si ", TextoCancelacion:=" <a onclick='Recargar()'>No</> ")
|
||||
Else
|
||||
Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:="BtnRefrescarPagina();")
|
||||
If Not EsRefacturacion Then
|
||||
Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:="BtnRefrescarPagina();")
|
||||
Else
|
||||
Response.Redirect($"/Ventas/RepCancelacionesPorRespuesta.aspx?CveVenta={Me.CveVenta}")
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjFactura.CveAlmacen = -1
|
||||
@@ -21442,6 +21446,11 @@ Partial Class Ventas
|
||||
CargaFormaPago(DdlMetodoPago33.SelectedValue.ToEntero)
|
||||
DdlFormaPago33.SelectedValueExist(dtSeleccionadas.FiltroPrimeroValor("CveFormaPago"))
|
||||
|
||||
DiasCredito = dtSeleccionadas.FiltroPrimeroValor("DiasCredito").ToEntero
|
||||
EsDiasCreditoFijo = CBool(dtSeleccionadas.FiltroPrimeroValor("EsDiasCreditoFijo"))
|
||||
|
||||
|
||||
|
||||
'validación, cuando las remisiones sean de una sucursal y el usuario solo tenga acceso a otra, deberá tener priodidad la sucursal de la que solo se factura
|
||||
If DdlSubProyectoDatos.Enabled = True Then
|
||||
DdlSubProyectoDatos.SelectedValueExist(dtSeleccionadas.FiltroPrimeroValor("CveSubProyecto"))
|
||||
@@ -21575,11 +21584,14 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
TxtFechaPago.Text = If(EsDiasCreditoFijo, Now.AddDays(DiasCredito).ToShortDateString, TxtFechaPago.Text)
|
||||
|
||||
UpRemisionesFacturas.Update()
|
||||
UpFacturar.Update()
|
||||
UpPS.Update()
|
||||
UpParametros.Update()
|
||||
UPEstimaciones.Update()
|
||||
UPCondicionesPago.Update()
|
||||
HuboCambioRemi = Not HuboCambioRemi
|
||||
RegistraScript("$('#DivRemisiones').modal('hide');", "DivRemisionesHide")
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user