+
+
diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx.vb b/Acumuladores/RepEntradasUsadosClientes.aspx.vb
index 8925785f9..b21eba707 100644
--- a/Acumuladores/RepEntradasUsadosClientes.aspx.vb
+++ b/Acumuladores/RepEntradasUsadosClientes.aspx.vb
@@ -49,7 +49,7 @@ Partial Class Acumuladores_RepEntradasUsadosClientes
Dim Acum As New ClsAcumuladores
If Acum.EntradasUsadosClientesRep(CveAlmacen, FechaI, FechaF, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
- GvDatos.DataSource = Acum.DtResultados.FiltraParametros("Codigo_Clientes <> 'Total:'") 'los renglones generados con esta caracteriztica son con un grouping set en la consulta, se pueden quitar
+ GvDatos.DataSource = Acum.DtResultados.FiltraParametros("Codigo_Clientes <> 'Total:'") 'los renglones generados con esta caracteriztica son con un grouping set en la consulta, se pueden quitar
DatosEntradasUsadosClientes = Acum.DtResultados.FiltraParametros("Codigo_Clientes <> 'Total:'")
End If
@@ -61,18 +61,11 @@ Partial Class Acumuladores_RepEntradasUsadosClientes
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- 'If e.Row.DBCampo("EsHeader").ToString = "-1" Or e.Row.DBCampo("Codigo").ToString = "" Then
- ' e.Row.CssClass = "SubTotales2"
- 'End If
- If e.Row.DBCampo("TipoHeader").ToString = "1" Then
- e.Row.CssClass = "Totales"
- ElseIf e.Row.DBCampo("TipoHeader").ToString = "2" Then
- e.Row.CssClass = "SubTotales"
- ElseIf e.Row.DBCampo("TipoHeader").ToString = "3" Then
- e.Row.CssClass = "SubTotales2"
- End If
- End If
+ If e.Row.DBCampo("EsHeader").ToString = "-1" Or e.Row.DBCampo("Codigo").ToString = "" Then
+ e.Row.CssClass = "SubTotales2"
+ End If
+ End If
End Sub
Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs)
@@ -96,4 +89,19 @@ Partial Class Acumuladores_RepEntradasUsadosClientes
End Sub
+ Public Sub CargarVentasGrupo(sender As Object, e As EventArgs)
+ Dim tempLink As LinkButton = CType(sender, LinkButton)
+ Dim renglon As GridViewRow = CType(tempLink.NamingContainer, GridViewRow)
+
+ LbCliente.Text = renglon.DataKey("NombreComercial")
+ LbTam.Text = renglon.DataKey("Codigo")
+ Dim ObjAcum As New ClsAcumuladores
+ If ObjAcum.GetUsadosClasificacionVentas(renglon.DataKey("CveCliente"), renglon.DataKey("Codigo"), TxtFechaI.Text, TxtFechaF.Text) Then
+ GvVentas.DataSource = ObjAcum.DtResultados
+ End If
+ ObjAcum.Dispose()
+ GvVentas.DataBind()
+
+ RegistraScript("$('#ModalVentasAvance').modal();")
+ End Sub
End Class
diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb
index 0a9418855..3720d4918 100644
--- a/App_Code/ClsAcumuladores.vb
+++ b/App_Code/ClsAcumuladores.vb
@@ -1039,6 +1039,29 @@ Public Class ClsAcumuladores
Return Retorno
End Function
+ Public Function GetUsadosClasificacionVentas(CveCliente As Integer, Codigo As String, FechaInicio As String, FechaFin As String) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ SqlDataAdapter("PA_Acum_UsadosClasificacionVentas")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As SqlException
+ OnError("Ocurrió un error al consultar los datos. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
#Region " IDisposable Support "
diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb
index 8113ab863..4dbde281c 100644
--- a/App_Code/ClsBancos.vb
+++ b/App_Code/ClsBancos.vb
@@ -3341,11 +3341,11 @@ Public Class ClsBancos
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "PagosCajaChica"
- Public Function GetPagosCajaChica(FechaI As String, FechaF As String, CveEmpresa As Integer, CveCuenta As Integer) As Boolean
+ Public Function GetPagosCajaChica(FechaI As String, FechaF As String, CveEmpresa As Integer, CveCuenta As Integer, Optional TipoPago As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_BancosCajaChicaPagosGet")
@@ -3354,6 +3354,7 @@ Public Class ClsBancos
.Add("@FechaF", SqlDbType.VarChar).Value = FechaF
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
+ .Add("@TipoChequeEfectivo", SqlDbType.Int).Value = TipoPago
End With
Try
@@ -3364,10 +3365,10 @@ Public Class ClsBancos
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "ACTIVOS FIJOS"
Public Function GetActivosFijosCreditos(CveCredito As Integer, CveActivoFijo As Integer) As Boolean
Dim Retorno As Boolean = False
diff --git a/App_Code/ClsCompProveedores.vb b/App_Code/ClsCompProveedores.vb
index b439b1ff9..bbbc1b8f1 100644
--- a/App_Code/ClsCompProveedores.vb
+++ b/App_Code/ClsCompProveedores.vb
@@ -1605,7 +1605,7 @@ Public Class ClsCompProveedores
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
- .Add("@CveTipoContrato", SqlDbType.VarChar).Value = TipoContrato
+ .Add("@TipoContrato", SqlDbType.VarChar).Value = TipoContrato
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
@@ -1684,6 +1684,228 @@ Public Class ClsCompProveedores
Return Retorno
End Function
+
+
+
+
+ Public Function AddContrato(Contrato As String, CveTipoContrato As Integer, CveSubProyecto As Integer, CveProveedor As Integer, CveRepresentanteLegal As Integer, FechaInicio As Date, FechaFin As Date, Estatus As Boolean,
+ CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Prov_SAT_ContratosAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@Contrato", SqlDbType.VarChar).Value = Contrato
+ .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ .Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .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 guardar el contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdateContrato(CveContrato As Integer, Contrato As String, CveTipoContrato As Integer, CveSubProyecto As Integer, CveProveedor As Integer, CveRepresentanteLegal As Integer, FechaInicio As Date,
+ FechaFin As Date, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Prov_SAT_ContratosUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveContrato", SqlDbType.Int).Value = CveContrato
+ .Add("@Contrato", SqlDbType.VarChar).Value = Contrato
+ .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ .Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .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 contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+ Public Function GetContrato(CveContrato As Integer, CveSubProyecto As Integer, CveProveedor As Integer, CveTipoContrato As Integer, CveRepresentanteLegal As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Prov_SAT_ContratosGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveContrato", SqlDbType.Int).Value = CveContrato
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
+ .Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal
+ .Add("@Estatus", SqlDbType.Int).Value = Estatus
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al Obtener los contratos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
+ Public Function RemoveContrato(CveContrato As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Prov_SAT_ContratosRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+
+ .Add("@CveContrato", SqlDbType.Int).Value = CveContrato
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar el contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
+
+ Public Function AddRePresentanteLegal(RepresentanteLegal As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Prov_SAT_CatRepresentanteLegalAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@RepresentanteLegal", SqlDbType.VarChar).Value = RepresentanteLegal
+ .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 agregar el representante.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
+ Public Function UpdateRePresentanteLegal(CveRepresentanteLegal As Integer, RepresentanteLegal As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Prov_SAT_CatRepresentanteLegalUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal
+ .Add("@RepresentanteLegal", SqlDbType.VarChar).Value = RepresentanteLegal
+ .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 representante.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function GetRePresentanteLegal(CveRepresentanteLegal As Integer, CveEmpresa As Integer, Optional CveProveedor As Integer = -1) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Prov_SAT_CatRepresentanteLegalGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los representantes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function RemoveRePresentanteLegal(CveRepresentanteLegal As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Prov_SAT_CatRepresentanteLegalRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar el representante.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
#End Region
' IDisposable
diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb
index 0c1a2d1b9..860bd5889 100644
--- a/App_Code/ClsContPAQi.vb
+++ b/App_Code/ClsContPAQi.vb
@@ -1074,7 +1074,7 @@ Public Class ClsContPAQi
StrSQL.AppendLine(" INNER JOIN Polizas p ON mp.IdPoliza = p.Id ")
StrSQL.AppendLine(" INNER JOIN Cuentas c ON c.Id = mp.IdCuenta ")
StrSQL.AppendLine(" INNER JOIN TiposPolizas t ON mp.TipoPol = t.Codigo ")
- StrSQL.AppendLine(" LEFT JOIN SIG_Resp_OIC.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ")
+ StrSQL.AppendLine(" LEFT JOIN SERVIDOR.Ventas.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ")
StrSQL.AppendLine(" LEFT JOIN SegmentosNegocio s ON mp.IdSegNeg = s.id ")
StrSQL.AppendLine(" WHERE (@IdPoliza = -1 OR mp.IdPoliza = @IdPoliza) ")
StrSQL.AppendLine(" AND (@Eje = -1 OR mp.Ejercicio = @Eje) ")
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 38165898b..c38c36938 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -4671,8 +4671,9 @@ Public Class ClsPaginas
PaginaDict.Add("/PortalProveedor/PortalProveedor.aspx".ToUpper(), 1201)
PaginaDict.Add("/Edoc/CatDocumentos.aspx".ToUpper(), 1205)
- PaginaDict.Add("/Edoc/CatTipoContratos.aspx".ToUpper(), -1)
- PaginaDict.Add("/Edoc/CatDocumentosContratos.aspx".ToUpper(), -1)
+ PaginaDict.Add("/Edoc/CatTipoContratos.aspx".ToUpper(), 1207)
+ PaginaDict.Add("/Edoc/CatDocumentosContratos.aspx".ToUpper(), 1208)
+ PaginaDict.Add("/Edoc/Contratos.aspx".ToUpper(), 1209)
'Portal
PaginaDict.Add("/AIMMGM/ConsultaCliente.aspx".ToUpper(), -1)
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index deaf7c5ac..596819afc 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -3914,14 +3914,14 @@ Public Class ClsVentas
#End Region
- Public Function RepIngresos(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, TipoDocto As String, CveSubProyecto As Integer) As Boolean
+ Public Function RepIngresos(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, TipoDocto As String, Cves_Subprotectos As String) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Ventas_RepIngresos", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@TipoDoc", SqlDbType.VarChar).Value = TipoDocto
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@Cves_Subprotectos", SqlDbType.VarChar).Value = Cves_Subprotectos
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index e0d5d3f62..08036f1b9 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -14,6 +14,7 @@ Imports System.Net
Imports System.IO.Compression
Imports System.Text
Imports System.Net.Http
+Imports System.Collections.Generic
Namespace Modelos
@@ -539,7 +540,64 @@ Namespace Modelos
Public Property CveEstatus As Integer
End Class
-
+ Public Function RegenerarPrePolizas(Optional TransaccionCompartida As SqlClient.SqlTransaction = Nothing, Optional ObjACTransac As ClsContPAQi = Nothing) As Boolean
+ Dim ErrorPrePolizas As Boolean = False
+
+ Dim ObjVentas As ClsVentas = Nothing
+ If TransaccionCompartida IsNot Nothing Then
+ ObjVentas = New ClsVentas(TransaccionCompartida)
+ Else
+ ObjVentas = New ClsVentas()
+ ObjVentas.IniciaTransacSQL()
+ End If
+
+ Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
+ Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
+ Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL())
+ Dim ObjAC As ClsContPAQi = Nothing
+
+ If ObjACTransac Is Nothing Then
+ If UsuarioActual.Empresa.UsaAC Then
+ ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
+ End If
+ Else
+ ObjAC = ObjACTransac
+ End If
+
+ ErrorPrePolizas = Not RegeneracionPolizas(Me, ObjVentas, ObjAC, ObjConta, ObjBancos, ObjEventos)
+
+ If TransaccionCompartida Is Nothing Then
+ ObjVentas.Commit()
+ ObjVentas.Dispose()
+ ObjBancos.Dispose()
+ ObjEventos.Dispose()
+ End If
+
+ If ObjACTransac Is Nothing Then
+ If ObjAC IsNot Nothing Then
+ ObjAC.Commit()
+ ObjAC.Dispose()
+ End If
+ End If
+
+ Return Not ErrorPrePolizas
+ End Function
+ Private Function RegeneracionPolizas(ObjFactura As Modelos.Factura, ByRef ObjVentas As ClsVentas, ByRef ObjAC As ClsContPAQi, ByRef ObjConta As ClsContabilidad, ObjBancos As ClsBancos, ObjEventos As ClsOIEventos) As Boolean
+ Dim ErrorPrePolizas As Boolean = False
+
+ 'REMOVEMOS LOS CONCEPTOS DE LA PREPOLIZA
+ ErrorPrePolizas = Not ObjConta.RemovePrePolizasDetalle(ObjFactura.CvePrePoliza, -1, ObjFactura.CveVenta, 2)
+
+ 'VUELVE A GENERAR LAS PREPOLIZAS
+ If Not ErrorPrePolizas Then
+ ErrorPrePolizas = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, ObjAC, ValorMultiplicador:=1, ObjBancos:=ObjBancos, ObjVentas:=ObjVentas, ObjEventos:=ObjEventos, DtRemisionesRelacionadas:=New DataTable, SeCancelaRemisionProceso:=False,
+ CancelarRemisiones:=False, ListaRemisionesCancelar:=New List(Of Integer))
+ End If
+
+ If Not ErrorPrePolizas Then ErrorPrePolizas = GuardarVentaImpuestosLocales(ObjFactura, ObjVentas, ObjConta, 1)
+
+ Return Not ErrorPrePolizas
+ End Function
Public Function EmitirFactura(Optional Timbrar As Boolean = True, Optional Transac As SqlClient.SqlTransaction = Nothing, Optional ObjContPaqTransac As ClsContPAQi = Nothing) As MMensajeFactura
Dim Retorno As New MMensajeFactura()
@@ -1059,7 +1117,7 @@ Namespace Modelos
Return Retorno
End Function
- Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = true) As Byte()
+ Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = True) As Byte()
Dim Url = New Uri(String.Format("http://{0}:{1}/Compras/PopUpVerFactura.aspx?P={2}", HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
Dim File As Byte() = Nothing
Try
@@ -6067,7 +6125,7 @@ Namespace Modelos
End Set
End Property
- Public ReadOnly Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable
+ Public ReadOnly Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa)
@@ -6085,7 +6143,7 @@ Namespace Modelos
GlobalDTProductosServiciosEquivalencias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
-
+
End Property
Property GlobalDTProveedorClasificacion(CveEmpresa As Integer) As DataTable
Get
diff --git a/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx
index db3f0d7a9..830a6df54 100644
--- a/Bancos/DepositosCaja.aspx
+++ b/Bancos/DepositosCaja.aspx
@@ -70,6 +70,15 @@
+
+
diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb
index 7898c801c..71e9a4b23 100644
--- a/Bancos/DepositosCaja.aspx.vb
+++ b/Bancos/DepositosCaja.aspx.vb
@@ -41,7 +41,7 @@ Partial Class Bancos_DepositosCaja
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
- ObjBancos.GetPagosCajaChica(FechaI, FechaF, UsuarioActual.CveEmpresa, DdlCajaChica.SelectedValue.ToEntero)
+ ObjBancos.GetPagosCajaChica(FechaI, FechaF, UsuarioActual.CveEmpresa, DdlCajaChica.SelectedValue.ToEntero, DdlTipoPago.SelectedValue.ToEntero)
GvFacturas.DataSource = ObjBancos.DtResultados
ObjBancos.Dispose()
diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb
index 1ce79752d..4a5e80e2b 100644
--- a/Bancos/PopIECompras.aspx.vb
+++ b/Bancos/PopIECompras.aspx.vb
@@ -617,8 +617,8 @@ Partial Class Bancos_PopIECompras
MovimientoPagar = New IEMovimiento
MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal
MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal
- MovimientoPagar.IVADeducible = dr("IVADeducible").ToString.ToDecimal
- MovimientoPagar.IVANoDeducible = dr("IVANoDeducible").ToString.ToDecimal
+ MovimientoPagar.IVADeducible = dr("IVADeducible").ToString.ToDecimal.RoundSQL
+ MovimientoPagar.IVANoDeducible = dr("IVANoDeducible").ToString.ToDecimal.RoundSQL
MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal
MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal
MovimientoPagar.Total = dr("Total").ToString.ToDecimal
@@ -1982,6 +1982,75 @@ Partial Class Bancos_PopIECompras
End If
End If
End If
+
+ Case 285 'Ret IVA x Acreditar Acreditable Servicios
+ If MovimientoPagar.ConceptoRetIVA = 5 Then
+ If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
+ ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
+ ImporteMX = ImporteMovimiento
+ ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
+ ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
+ ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
+ ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
+ ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
+ ImporteMX = ImporteMovimiento * tipoCambioCompra
+ ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
+ ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
+ ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
+ End If
+ ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
+ ImporteMX = Math.Round(ImporteMX, 2)
+ TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
+
+ If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
+
+ 'Conta ContPAQ
+ If IdCtaContRetIVA > 0 Then
+ IdCtaContable = IdCtaContRetIVA
+ ElseIf UsuarioActual.Empresa.Funcionalidad(578).ToEntero > 0 Then
+ IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
+ Else
+ If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
+ If ObjMov.DtResultados.Rows.Count > 0 Then
+ IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
+ End If
+ End If
+ End If
+ End If
+ Case 286 'Ret IVA Acreditable Servicio
+ If MovimientoPagar.ConceptoRetIVA = 5 Then
+ If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
+ ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
+ ImporteMX = ImporteMovimiento
+ ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
+ ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
+ ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
+ ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
+ ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
+ ImporteMX = ImporteMovimiento * tipoCambioCompra
+ ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
+ ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
+ ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
+ End If
+ ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
+ ImporteMX = Math.Round(ImporteMX, 2)
+ TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
+
+ If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
+
+ 'Conta ContPAQ
+ If IdCtaContRetIVAAcreditable > 0 Then
+ IdCtaContable = IdCtaContRetIVAAcreditable
+ ElseIf UsuarioActual.Empresa.Funcionalidad(582).ToEntero > 0 Then
+ IdCtaContable = UsuarioActual.Empresa.Funcionalidad(582).ToEntero
+ Else
+ If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
+ If ObjMov.DtResultados.Rows.Count > 0 Then
+ IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
+ End If
+ End If
+ End If
+ End If
'Case 16 'Ret ISR X Acreditar
' If MovimientoPagar.ConceptoRetISR = 1 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
@@ -2280,7 +2349,7 @@ Partial Class Bancos_PopIECompras
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
- ImporteMovimiento = MovimientoPagar.IVADeducible * PorcentajePago
+ ImporteMovimiento = (MovimientoPagar.IVADeducible * PorcentajePago).RoundSQL
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVADeducible * PorcentajePago)
@@ -2579,8 +2648,8 @@ Partial Class Bancos_PopIECompras
End If
ObjCreditos.Dispose()
Else
- IdCtaContable = CtaProveedor
- CveCuenta = CveCuentaProveedor
+ IdCtaContable = IdCuentaBancaria
+ CveCuenta = CveCuentaCliente
End If
Else
IdCtaContable = IdCtaContComplementaria
@@ -2675,6 +2744,8 @@ Partial Class Bancos_PopIECompras
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
ImporteMX = Math.Round(ImporteMX, 2)
TimpocambioGeneral = tipoCambioPago
+ IdCtaContable = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal).FiltroPrimeroValor("IdCtaContPersonal", "").ToEntero
+
Else
ImporteMovimiento = 0
End If
@@ -3146,7 +3217,7 @@ Partial Class Bancos_PopIECompras
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
If ObjMov.ValorPolizaDescuadre > 0 Then
- 'MsgError = ObjMov.MensajePolizaDescuadre
+ MsgError = ObjMov.MensajePolizaDescuadre
GuardaLogAD($"Bancos/PopIECompras | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
End If
End If
diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb
index 77a1c8d1b..6d0c5000c 100644
--- a/Bancos/ProveedoresAbonar.aspx.vb
+++ b/Bancos/ProveedoresAbonar.aspx.vb
@@ -1261,6 +1261,72 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
End If
+ Case 285 'Ret IVA x Acreditar Acreditable Servicios
+ If gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
+ If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
+ ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
+ importeMX = ImporteMovimiento
+ ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
+ ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
+ importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
+ ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
+ ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
+ importeMX = ImporteMovimiento * tipoCambioCompra
+ ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
+ ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
+ importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
+ End If
+ ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
+ importeMX = Math.Round(importeMX, 2)
+
+ If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
+
+ 'Conta ContPAQ
+ If IdCtaContRetIVA > 0 Then
+ IdCtaContable = IdCtaContRetIVA
+ ElseIf UsuarioActual.Empresa.Funcionalidad(578).ToEntero > 0 Then
+ IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
+ Else
+ If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
+ If ObjMov.DtResultados.Rows.Count > 0 Then
+ IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
+ End If
+ End If
+ End If
+ End If
+ Case 286 'Ret IVA Acreditable Servicio
+ If gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
+ If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
+ ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
+ importeMX = ImporteMovimiento
+ ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
+ ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
+ importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
+ ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
+ ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
+ importeMX = ImporteMovimiento * tipoCambioCompra
+ ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
+ ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
+ importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
+ End If
+ ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
+ importeMX = Math.Round(importeMX, 2)
+
+ If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
+
+ 'Conta ContPAQ
+ If IdCtaContRetIVAAcreditable > 0 Then
+ IdCtaContable = IdCtaContRetIVAAcreditable
+ ElseIf UsuarioActual.Empresa.Funcionalidad(582).ToEntero > 0 Then
+ IdCtaContable = UsuarioActual.Empresa.Funcionalidad(582).ToEntero
+ Else
+ If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
+ If ObjMov.DtResultados.Rows.Count > 0 Then
+ IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
+ End If
+ End If
+ End If
+ End If
'Case 16 'Ret ISR X Acreditar
' If gvr.DataKey("CveRetISRConcepto").ToEntero = 1 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index fd2af8bf0..c848d70b9 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -104,6 +104,15 @@ Partial Class Compras_Compras
Set(ByVal value As List(Of String))
ViewState("ListaDocumentos") = value
End Set
+ End Property
+
+ Public Property TieneAnticiposXML As Boolean
+ Get
+ TieneAnticiposXML = DirectCast(ViewState("TieneAnticiposXML"), Boolean)
+ End Get
+ Set(ByVal value As Boolean)
+ ViewState("TieneAnticiposXML") = value
+ End Set
End Property
Private Property DTOCTemp As DataTable
@@ -873,6 +882,7 @@ Partial Class Compras_Compras
Private Property Descuentos As Decimal = 0
+ Private Property Amortizaciones As Decimal = 0
Private Property EmisorRFC As String
Private Property ReceptorRFC As String
Private Property TrasladoIVA As Decimal = 0
@@ -1116,6 +1126,7 @@ Partial Class Compras_Compras
'ImgBtnBuscarOC.Attributes.Add("data-toggle", "tooltip")
'ImgBtnBuscarOC.Attributes.Add("data-placement", "top")
CargaDatosAgregarPS()
+ TieneAnticiposXML = False
Modalidad = ""
Version = ""
CveMetodoPago = -1
@@ -1405,8 +1416,11 @@ Partial Class Compras_Compras
End If
'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
- LblSaldoFactura.Text = If(CveCompra > 0, Saldo.FormatoNumero, TxtTotal.Text.FormatoNumero)
-
+ LblSaldoFactura.Text = If(CveCompra > 0, Saldo.FormatoNumero, TxtTotal.Text.FormatoNumero)
+ 'cuando es factura con amortizacion, el importe a descontar es el saldo que se debe de aplicar para la amortizacion
+ If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 Then
+ LblSaldoFactura.Text = TmpDT.SUMD("Descuento").ToString
+ End If
If UsuarioActual.CveEmpresa = 126 And CveCompra > 0 Then
LnkExportaGv.Visible = True
@@ -1829,6 +1843,20 @@ Partial Class Compras_Compras
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 = ""
@@ -2127,7 +2155,7 @@ Partial Class Compras_Compras
Private Sub ValidacionesTotalesXml()
Dim Msg As String = ""
- Dim SubtotalTemp = TmpDT.SUM("Total") + Math.Round(TmpDT.SUM("Descuento"), 2)
+ Dim SubtotalTemp = TmpDT.SUM("Total") + Math.Round(TmpDT.SUM("Descuento") + Math.Round(TmpDT.SUM("Amortizacion")), 2)
Dim DescuentosTemp = TmpDT.SUM("Descuento")
Dim Subtotal2Temp = TmpDT.SUM("Total")
Dim IVATemp = TmpDT.SUM("IVA")
@@ -4369,7 +4397,7 @@ Partial Class Compras_Compras
'METODO DE PREPOLIZA DE ALMACEN
If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
- Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
+ Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal
If ImporteAlmacen > 0 Then
If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
If (CveImportacion > 0 Or CveFlete > 0) Then
@@ -4403,10 +4431,17 @@ Partial Class Compras_Compras
End If
'hay amortización directa como descuento. RMF Temporal
If UsuarioActual.CveEmpresa = 119 Then
- If LblAmortizacion.Text.ToDouble > 0 AndAlso TxtDescuento.Text.ToDouble = 0 Then
- TxtDescuento.Text = LblAmortizacion.Text
- LblAmortizacion.Text = "0.00"
- End If
+ 'If LblAmortizacion.Text.ToDouble > 0 AndAlso TxtDescuento.Text.ToDouble = 0 Then
+ ' TxtDescuento.Text = LblAmortizacion.Text
+ ' LblAmortizacion.Text = "0.00"
+ 'End If
+
+ 'o si el descuento es igual a la amortizacion
+ 'If LblAmortizacion.Text.ToDouble = TxtDescuento.Text.ToDouble Then
+ ' TxtDescuento.Text = LblAmortizacion.Text
+ ' LblAmortizacion.Text = "0.00"
+ 'End If
+
End If
'Compra
@@ -6175,36 +6210,31 @@ Partial Class Compras_Compras
Else
importeMovimiento = 0
End If
- Case 285 'Perdida
-
-
- If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
- If ObjConta.DtResultados.Rows.Count > 0 Then
- IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
- CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacionSIG").ToString.ToEntero
+ Case 285 'Ret IVA 6% Servicios
+
+ IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
+
+ 'If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
+ ' If ObjConta.DtResultados.Rows.Count > 0 Then
+ ' IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
+ ' CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacionSIG").ToString.ToEntero
+ ' End If
+ 'End If
+
+
+ If DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then
+
+ If CveMoneda = 2 Then
+ importeMN = TmpDT.SUMD("RetIVA") * TxtTC.Text.ToDecimal
+ Else
+ importeMN = TmpDT.SUMD("RetIVA")
+ importeMovimiento = TmpDT.SUMD("RetIVA")
+
End If
+
+ Else
+ importeMovimiento = 0
End If
-
-
-
-
- If DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then
-
- If CveMoneda = 2 Then
- importeMN = TmpDT.SUMD("RetIVA") * TxtTC.Text.ToDecimal
- Else
- importeMN = TmpDT.SUMD("RetIVA")
- importeMovimiento = TmpDT.SUMD("RetIVA")
-
- End If
-
- Else
- importeMovimiento = 0
- End If
-
-
-
-
Case 6 'Compra
Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
@@ -6784,6 +6814,7 @@ Partial Class Compras_Compras
Else
ErrorPrepoliza = True
Exit For
+ Exit For
End If
' FLUCTUACION CAMBIARIA
@@ -7014,7 +7045,7 @@ Partial Class Compras_Compras
Exit For
End If
- If TxtTotal.Text.ToDouble > 0 Then
+ If TxtTotal.Text.ToDouble > 0 AndAlso TieneAnticiposXML = False Then
importeMNNC = importeMovimientoNC * tipoCambioActual * Multiplicador
IdCtaContable = CtaProveedorExtranjera ' CtaProveedorAnticiposExtranjera
CveCuenta = CveCuentaProveedorExtranjera 'CveCuentaProveedorAnticiposExtranjera
@@ -7116,7 +7147,7 @@ Partial Class Compras_Compras
ErrorPrepoliza = True
End If
- If TxtTotal.Text.ToDouble > 0 Then
+ If TxtTotal.Text.ToDouble > 0 AndAlso TieneAnticiposXML = False Then
Dim IdCtaContablePago As Integer = CtaProveedor
Dim CveCuentaPago As Integer = CveCuentaProveedor
Dim usacomplementariaProveedor As Boolean = False
@@ -7177,15 +7208,19 @@ Partial Class Compras_Compras
Dim PorcentajePagoAnt As Decimal = importeMovimiento / If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDecimal)
Dim ImporteIVA As Decimal = Math.Round(PorcentajePagoAnt * TxtIVA.Text.ToDecimal, 2)
- 'Agregamos el 14
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIVA, Referencia, 14, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), CveCuenta:=CveCuentaIvaxAcreditar, PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
- ErrorPrepoliza = True
- End If
- 'Agregamos el 19
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIVA, Referencia, 19, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
- ErrorPrepoliza = True
- End If
+ If ImporteIVA <> 0 Then
+ 'Agregamos el 14
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteIVA, Referencia, 14, Concepto, FechaMovimiento, CtaIvaxAcreditar, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), CveCuenta:=CveCuentaIvaxAcreditar, PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
+ ErrorPrepoliza = True
+ End If
+
+ 'Agregamos el 19
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteIVA, Referencia, 19, Concepto, FechaMovimiento, CtaIvaAcreditable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=ImporteIVA * tipoCambioActual * Multiplicador, ImporteME:=If(tipoCambioActual = 1, 0, ImporteIVA), PorcentajeImpuesto:=PorcentajeImpuestoAnticipo, Contabilizable:=SeContabiliza) Then
+ ErrorPrepoliza = True
+ End If
+ End If
+
End If
@@ -7210,7 +7245,19 @@ Partial Class Compras_Compras
Next
importeMovimiento = 0
- End If
+ End If
+
+
+ 'Case 205
+
+ ' If TxtTotal.Text.ToDecimal = 0 And DdlTipoComprobante.SelectedValue = "Fac" Then
+ ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, Row("IdCtaContable").ToString.ToEntero, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=True) Then
+ ' ErrorPrepoliza = True
+ ' Exit For
+ ' End If
+ ' End If
+
+
End Select
If ErrorPrepoliza Then
@@ -7490,10 +7537,11 @@ Partial Class Compras_Compras
End Select
- If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Ant.Importe, " ", CveConceptoAnt, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=Ant.Importe) Then
- ' ImporteAnticipo += Ant.Importe ' RESTO DEL IMPORTE POR SI QUEDA DIFERENCIA DE LA SUMA DE LOS ANTICIPOS Y EL PROVEEDOR TIENE QUE PAGAR
- 'movimiento de pago proveedor, --no se regisra porque no se registra el total de la compra como deuda del proveedor, solo lo que queda a deber
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoCompra, Ant.Importe, " ", CveConceptoPago, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=Ant.Importe) Then
+ If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Ant.Importe, " ", CveConceptoAnt, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompraNC, CveCompraAmortizacion:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=Ant.Importe) Then
+ ' ImporteAnticipo += Ant.Importe ' RESTO DEL IMPORTE POR SI QUEDA DIFERENCIA DE LA SUMA DE LOS ANTICIPOS Y EL PROVEEDOR TIENE QUE PAGAR
+ 'movimiento de pago proveedor, --no se regisra porque no se registra el total de la compra como deuda del proveedor, solo lo que queda a deber
+ 'si es l moviemiento es de amortizacion con descuento, no registra el pago, ya esta descontado
+ If TieneAnticiposXML = False AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoCompra, Ant.Importe, " ", CveConceptoPago, " ", TxtFechaPago.Text.ToDate, 0, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorLocal, CveAcreedor:=CveAcreedor, CveIE:=Ant.CveIE, CveColectiva:=CveColectiva, ImporteMX:=Ant.Importe) Then
ErrorMovtosCxP = True
End If
PorcentajePago = (Ant.Importe) / TxtTotal.Text.ToDecimal
@@ -7861,8 +7909,8 @@ Partial Class Compras_Compras
'ACTUALIZA CVEFACTURA
If Request("CveFactura") IsNot Nothing Then
- If Not ObjCompras.UpdateCompraFactura(CveCompra, Request("CveFactura").ToEntero, TxtSerie.Text.Trim, TxtFolio.Text.Trim) Then
- ErrorOC = True
+ If Not ObjCompras.UpdateCompraFactura(CveCompra, Request("CveFactura").ToEntero, TxtSerie.Text.Trim, TxtFolio.Text.Trim) Then
+ TieneError = True
End If
If UsuarioActual.Empresa.UsaAC Then
@@ -8119,9 +8167,11 @@ Partial Class Compras_Compras
Contador += 1
'If gvr.DataKey("Fecha").ToDate > Fecha Then Fecha = gvr.DataKey("Fecha").ToDate 'guardo la fecha mayor
Importe += gvr.FCTextBox("TxtAnticipo").Text.ToDouble
- If Math.Round(Importe, 2) - Math.Round(CompraSaldo, 2) > 0.01 Then gvr.FCTextBox("TxtAnticipo").Text = "" : gvr.FCCheckBox("Chk").Checked = False
+ If Math.Round(Importe, 2) - Math.Round(CompraSaldo, 2) > 0.01 Then gvr.FCTextBox("TxtAnticipo").Text = "" : gvr.FCCheckBox("Chk").Checked = False
+
End If
- Next
+ Next
+
Else
Contador = 1
End If
@@ -9055,7 +9105,8 @@ Partial Class Compras_Compras
Next
End If
- LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
+ LblAmortizacion.Text = ImporteAnticipo.FormatoNumero
+
UpPS.Update()
End If
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAnticipos"))
@@ -10107,6 +10158,7 @@ Partial Class Compras_Compras
If documento.Attributes("UUID").Value <> "" Then
ListaDocumentos.Add(documento.Attributes("UUID").Value)
End If
+ TieneAnticiposXML = True
Next
End If
End If
@@ -10275,10 +10327,11 @@ Partial Class Compras_Compras
e.Row.BackColor = Drawing.Color.LightGray
Else
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(3).ForeColor = Drawing.Color.Red
- If e.Row.DBCampo("Saldo").ToDouble = 0 Then e.Row.FCLiteral("LtlAnticipos").Text = ""
+ If e.Row.DBCampo("Saldo").ToDouble = 0 Then e.Row.FCLiteral("LtlAnticipos").Text = ""
+ Dim ImporteAmortizacion As Decimal = If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDecimal)
- e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2});", e.Row.FCTextBox("TxtAnticipo").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDouble)), e.Row.DBCampo("CveMoneda").ToEntero, If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), DdlMoneda.SelectedValue.ToEntero)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
- e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteConImpuestos"), TxtTotal.Text.ToDouble)), e.Row.DBCampo("CveMoneda").ToEntero, If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), DdlMoneda.SelectedValue.ToEntero)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
+ e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2});", e.Row.FCTextBox("TxtAnticipo").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, ImporteAmortizacion), e.Row.DBCampo("CveMoneda").ToEntero, If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), DdlMoneda.SelectedValue.ToEntero)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
+ e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), If(CveCompra > 0, Saldo, ImporteAmortizacion), e.Row.DBCampo("CveMoneda").ToEntero, If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble), DdlMoneda.SelectedValue.ToEntero)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
If ChkNCInv.Checked Then
e.Row.FCCheckBox("Chk").CssClass = "ChkAntNC"
@@ -10291,6 +10344,8 @@ Partial Class Compras_Compras
Entro = True
End If
Next
+ 'permite vincular otro folio fiscal.
+ Entro = True
If Not Entro Then e.Row.FCCheckBox("Chk").Enabled = False
End If
End If
@@ -10602,6 +10657,7 @@ Partial Class Compras_Compras
DTConceptos.Columns.Add("Descuento", GetType(Double))
DTConceptos.Columns.Add("IVA", GetType(Double))
DTConceptos.Columns.Add("Total", GetType(Double))
+ DTConceptos.Columns.Add("Amortizacion", GetType(Double))
End Sub
'Private Sub AddPS(Cantidad As Double, UM As String, PS As String, PU As Double, IVA As Double, Descuento As Double, Optional Total As Double = 0)
' Dim Row As DataRow = Nothing
@@ -11949,14 +12005,19 @@ Partial Class Compras_Compras
#End Region
#Region " AJUSTA IMPORTES "
- Private Sub AjustaImporteUltimoConcepto(ImporteAjuste As Decimal, Optional EsCarga As Boolean = False)
- 'Dim TempSubTotal = TxtSubTotal.Text.ToDouble
+ Private Sub AjustaImporteUltimoConcepto(ImporteAjuste As Decimal, Optional EsCarga As Boolean = False)
+ 'Dim TempSubTotal = TxtSubTotal.Text.ToDouble
+ Dim Amortizacion As Decimal = 0
+ If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 Then
+ Amortizacion = LblAmortizacion.Text.ToDecimal
+ End If
If TmpDT.Rows.Count > 0 Then ' si hay movimientos y si esta afectando al total, que se haga el ajuste
'Dim ImporteAjuste As Decimal = Total - (SubTotal2 + IVA - RetencionIVA - RetencionIVA - RetencionISR + IEPS + OtrosImpuestos)
Dim Indice As Integer = If(TmpDT.Rows(TmpDT.Rows.Count - 1)("CvePS").ToString = UsuarioActual.Empresa.Funcionalidad(112).ToString, TmpDT.Rows.Count - 2, TmpDT.Rows.Count - 1)
- Dim tPU As Decimal
-
+ Dim tPU As Decimal
+
+
If TmpDT.Rows(Indice)("Cantidad").ToString.ToDecimal > 0 Then
tPU = ImporteAjuste / TmpDT.Rows(Indice)("Cantidad").ToString.ToDecimal
Else
@@ -11973,7 +12034,7 @@ Partial Class Compras_Compras
Descuentos = TmpDT.SUM("Descuento").ToString.ToDecimal
End If
TxtSubTotal.Text = (SubTotal + Descuentos).FormatoNumero()
- TxtSubTotal2.Text = SubTotal.FormatoNumero
+ TxtSubTotal2.Text = (SubTotal - Amortizacion).FormatoNumero
TxtDescuento.Text = Descuentos.FormatoNumero()
SubTotalConceptos = SubTotal
GvPS.DataSource = TmpDT : GvPS.DataBind()
@@ -14851,8 +14912,12 @@ Partial Class Compras_Compras
'If DdlOCVinculaInv.SelectedValue.ToEntero = 237 And Not CveFlete > 0 Then Alert("Necesita vincular un flete si selecciona Factura de Flete", TipoMensaje.MsgAdvertencia) : Exit Sub
'If DdlOCVinculaInv.SelectedValue.ToEntero = 240 And Not CveImportacion > 0 Then Alert("Necesita vincular una Importación si selecciona Factura de Importación", TipoMensaje.MsgAdvertencia) : Exit Sub
- Dim SubTotalGV = 0.0D
- Dim SubTotalCompra = If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteSinImpuestos"), TmpDT.SUM("Total").ToString.ToDecimal)
+ Dim SubTotalGV = 0.0D
+ Dim Amortizacion As Decimal = TmpDT.SUMD("Total")
+ If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 Then
+ Amortizacion = TmpDT.SUMD("ImporteSinImpuestos")
+ End If
+ Dim SubTotalCompra As Decimal = Amortizacion
Dim DiferenciaPermitida = 1
Dim Cont = 0
For Each gvr As GridViewRow In GvOC1.Rows
@@ -14919,7 +14984,14 @@ Partial Class Compras_Compras
If gvr.FCTextBox("TxtCantidad").Text.ToDecimal > 0 Or VinculacionCompleta Then
TotalRows += 1
End If
- Next
+ Next
+
+ Dim TieneAmortizacion As Boolean = False
+
+ If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 Then
+ TieneAmortizacion = True
+ End If
+
For Each gvr As GridViewRow In GvOC1.Rows
If gvr.FCTextBox("TxtCantidad").Text.ToDecimal > 0 Or VinculacionCompleta Then
dr = DTOCGV.Rows(gvr.RowIndex)
@@ -14951,7 +15023,7 @@ Partial Class Compras_Compras
Dim RetISR As Double = dr("RetISRPorcentaje").ToString.ToDecimal
Dim IEPSPS As Double = dr("IEPSPSPorcentaje").ToString.ToDecimal
Dim IEPSPSIVA As Double = dr("IEPSPSIVAPorcentaje").ToString.ToDecimal
- Dim Descuento As Double = If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TxtDescuento.Text.ToDouble / TotalRows, gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal)
+ Dim Descuento As Double = If(TieneAmortizacion, TxtDescuento.Text.ToDouble / TotalRows, gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal)
'Dim Descuento As Double = gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal
Dim CveOrdenCompraDetalle As Integer = dr("CveOrdenCompraDetalle").ToString.ToEntero
Dim EntregaDirecta As Integer = dr("EntregaDirecta").ToString.ToEntero
@@ -15000,11 +15072,10 @@ Partial Class Compras_Compras
AddPS2(False)
'AJUSTE DE REDONDEO O DIFERENCIA PERMITIDA DE IMPORTE
- AjustaImporteUltimoConcepto((If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUMD("ImporteSinImpuestos"), TxtSubTotal2.Text.ToDouble) + TxtOtrosImpuestos.Text.ToDouble).ToDecimal - If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, TmpDT.SUM("ImporteSinImpuestos").ToString.ToDecimal, TmpDT.SUM("Total").ToString.ToDecimal))
- 'AjustaImporteUltimoConcepto(TxtSubTotal2.Text.ToDecimal + TxtOtrosImpuestos.Text.ToDecimal - (TmpDT.SUM("Total").ToString.ToDecimal))
-
-
-
+ AjustaImporteUltimoConcepto((If(TieneAmortizacion, TmpDT.SUMD("ImporteSinImpuestos"), TxtSubTotal2.Text.ToDouble) + TxtOtrosImpuestos.Text.ToDouble).ToDecimal - If(TieneAmortizacion, TmpDT.SUM("ImporteSinImpuestos").ToString.ToDecimal, TmpDT.SUM("Total").ToString.ToDecimal))
+ 'AjustaImporteUltimoConcepto(TxtSubTotal2.Text.ToDecimal + TxtOtrosImpuestos.Text.ToDecimal - (TmpDT.SUM("Total").ToString.ToDecimal))
+
+
BtnGuardar.Enabled = True
If Not CierrePeriodo Then
BtnGuardar.Visible = True
@@ -16480,6 +16551,16 @@ Partial Class Compras_Compras
Dim Amortizacion As Decimal = 0
If UsuarioActual.CveEmpresa = 119 Then
Amortizacion = LblAmortizacion.Text.Trim.ToDecimal
+ TxtSubTotal.Text = (TxtSubTotal.Text.ToDouble + Amortizacion).ToString
+ End If
+
+ Dim TieneAmortizacion As Boolean = False
+ If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 Then
+ TieneAmortizacion = True
+ End If
+
+ If CveCompra < 0 AndAlso Not TieneAmortizacion Then
+ LblAmortizacion.Text = "0.00"
End If
TempSubTotal = TxtSubTotal.Text.ToDouble
@@ -16491,7 +16572,7 @@ Partial Class Compras_Compras
TempIEPS = TxtIEPS.Text.ToDouble
TempRetIVA = TxtRetIVA.Text.ToDouble
TempRetISR = TxtRetISR.Text.ToDouble
- TempTotal = Math.Round(TempSubTotal2 + TempIVA + TempIEPS - TempRetIVA - TempRetISR - TxtOtrosImpuestos.Text.ToDouble, 2)
+ TempTotal = Math.Round(TempSubTotal2 + TempIVA + TempIEPS - TempRetIVA - TempRetISR - TxtOtrosImpuestos.Text.ToDouble - Amortizacion, 2)
DifTotales = TxtTotal.Text.ToDouble - TempTotal
Dim DiferenciaPermitida = 0.6
diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx
index bcbcf062c..ae72b0047 100644
--- a/Compras/Proveedores.aspx
+++ b/Compras/Proveedores.aspx
@@ -603,6 +603,51 @@
--%>
+
+
+
diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb
index 3036fa58f..b32464910 100644
--- a/Compras/Proveedores.aspx.vb
+++ b/Compras/Proveedores.aspx.vb
@@ -380,6 +380,9 @@ Partial Class Compras_Proveedores
End If
HlEvento.Visible = True
HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveProveedor=" & CveProveedor & "&TB_iframe=true&height=370&width=600;"
+
+ CargaRepresentantes()
+
Else
'Configuración de Modalidad Insert
@@ -500,6 +503,30 @@ Partial Class Compras_Proveedores
'ViewState("OUsuario") = "Usuario DESC"
End Sub
+
+ Private Sub CargaRepresentantes()
+
+ If CveProveedor > 0 Then
+
+ Dim ObjProveedores As New ClsCompProveedores
+
+ If ObjProveedores.GetRePresentanteLegal(-1, UsuarioActual.CveEmpresa, CveProveedor) Then
+
+ GvRepresentante.DataSource = ObjProveedores.DtResultados
+ Else
+ GvRepresentante.DataSource = Nothing
+ End If
+
+ ObjProveedores.Dispose()
+
+ GvRepresentante.DataBind()
+ End If
+
+
+ End Sub
+
+
+
Private Sub CargaCuentasContables(Optional IdCuentaPadre As Integer = -1)
If UsuarioActual.Empresa.UsaContabilidad Then
Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb
index a630bed96..b8638b6db 100644
--- a/Compras/ReembolsosComprobaciones.aspx.vb
+++ b/Compras/ReembolsosComprobaciones.aspx.vb
@@ -424,7 +424,7 @@ Partial Class Compras_ReembolsosComprobaciones
If UsuarioActual.CveEmpresa.Contiene(119) Then
- CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones1", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveCajaChica > 0 Then
If ObjMov.GetRetCuenta(30, CveCajaChica) Then
@@ -448,7 +448,7 @@ Partial Class Compras_ReembolsosComprobaciones
Else
If drp IsNot Nothing Then
If drp("IdPoliza").ToString.ToEntero > 0 Then
- CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones2", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
IdPoliza = drp("IdPoliza").ToString.ToEntero
Else
CvePrePolizaIERegistrado = drp("CvePrePoliza").ToString.ToEntero
@@ -464,14 +464,14 @@ Partial Class Compras_ReembolsosComprobaciones
End If
If ChkChequeExcedente.Checked Then
- CvePrePolizaExcedente = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ CvePrePolizaExcedente = ObjMov.AddPrePolizas("Compras/Comprobaciones3", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveIEExcedente = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaExcedente, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False))
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, TxtImporte.Text.ToDecimal, TxtObservaciones.Text, If(CveCajaChica > 0, 30, 29), TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEExcedente, CvePersonal:=CvePersonal, CveCompra:=-1, CveProveedor:=-1, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
MsgError = "Error al registrar detalle de concepto bancario"
End If
End If
ElseIf Not ChkReembolsarSinBancos.Checked Then
- CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones4", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveIERegistrado = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False))
'AGREGO PREPOLIZA IE BANCOS
@@ -506,7 +506,7 @@ Partial Class Compras_ReembolsosComprobaciones
End If
Else
- CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones5", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'SI ES CAJA CHICA REGISTRO IE CAJA CHICA
If CveCajaChica > 0 Then
@@ -635,7 +635,7 @@ Partial Class Compras_ReembolsosComprobaciones
CvePrePolizaPago = CvePrePolizaIERegistrado
'SE USARA PARA PODER ELIMINAR UNA COMPROBACION
- CvePrePolizaPagoOriginal = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, ImporteMovto, ImporteMovto, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", $"Compra: { gvr.DataKey("SerieFolio").ToString }", TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ CvePrePolizaPagoOriginal = ObjMov.AddPrePolizas("Compras/Comprobaciones6", 9, ImporteMovto, ImporteMovto, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", $"Compra: { gvr.DataKey("SerieFolio").ToString }", TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'registramos el nuevo IE
@@ -979,7 +979,7 @@ Partial Class Compras_ReembolsosComprobaciones
ImporteMovto = ImportePagar
If ImportePagar = ImporteOriginal Then
- CvePrePolizaPago = ObjMov.AddPrePolizas("Compras/Comprobaciones", 9, ImporteMovto, ImporteMovto, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", $"Compra: { gvr.DataKey("SerieFolio").ToString }", TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ CvePrePolizaPago = ObjMov.AddPrePolizas("Compras/Comprobaciones7", 9, ImporteMovto, ImporteMovto, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", $"Compra: { gvr.DataKey("SerieFolio").ToString }", TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'registramos el nuevo IE
If CveCajaChica > 0 Then
CveIEPago = 0
diff --git a/Compras/RepDocumentacionProveedor.aspx b/Compras/RepDocumentacionProveedor.aspx
index ad4776c3d..c6704dc1e 100644
--- a/Compras/RepDocumentacionProveedor.aspx
+++ b/Compras/RepDocumentacionProveedor.aspx
@@ -61,11 +61,11 @@
-
-
+
+ <%-- --%>
-
+ <%----%>
@@ -80,11 +80,11 @@
<%-- --%>
-
-
+
+ <%----%>
-
+ <%----%>
@@ -158,7 +158,7 @@
-
+
@@ -226,7 +226,7 @@
-
@@ -281,6 +281,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Compras/RepDocumentacionProveedor.aspx.vb b/Compras/RepDocumentacionProveedor.aspx.vb
index d89519107..d7322024f 100644
--- a/Compras/RepDocumentacionProveedor.aspx.vb
+++ b/Compras/RepDocumentacionProveedor.aspx.vb
@@ -37,9 +37,160 @@ Partial Class Proveedores_RepDocumentacionProveedor
Set(value As DataTable)
ViewState("DTHeaders") = value
End Set
- End Property
-
+ End Property
+
+
+
+#Region "UPLOAD"
+ Property CveDocumentacionElectronica As Integer
+ Get
+ If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("CvePersonalClienteDocumentacion"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("CvePersonalClienteDocumentacion") = value
+ End Set
+ End Property
+
+ Property CveDocumentacion As Integer
+ Get
+ If ViewState("CveDocumentacion") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("CveDocumentacion"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("CveDocumentacion") = value
+ End Set
+ End Property
+
+ Property Documentacion As String
+ Get
+ If ViewState("Documentacion") Is Nothing Then
+ Return "-1"
+ Else
+ Return ViewState("Documentacion").ToString
+ End If
+ End Get
+ Set(value As String)
+ ViewState("Documentacion") = value
+ End Set
+ End Property
+
+ Property AdjuntoDocumentacion As String
+ Get
+ If ViewState("AdjuntoDocumentacion") Is Nothing Then
+ Return ""
+ Else
+ Return ViewState("AdjuntoDocumentacion").ToString
+ End If
+ End Get
+ Set(value As String)
+ ViewState("AdjuntoDocumentacion") = value
+ End Set
+ End Property
+
+
+
+ Property DiasVigencia As Integer
+ Get
+ If ViewState("DiasVigencia") Is Nothing Then
+ Return 0
+ Else
+ Return DirectCast(ViewState("DiasVigencia"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("DiasVigencia") = value
+ End Set
+ End Property
+
+ Property AplicaFechaVencimiento As Boolean
+ Get
+ If ViewState("AplicaFechaVencimiento") Is Nothing Then
+ Return True
+ Else
+ Return DirectCast(ViewState("AplicaFechaVencimiento"), Boolean)
+ End If
+ End Get
+ Set(value As Boolean)
+ ViewState("AplicaFechaVencimiento") = value
+ End Set
+ End Property
+
+ Private Property FechaVigencia As Date
+ Get
+ If ViewState("FechaVigencia") Is Nothing Then
+ Return Nothing
+ Else
+ Return ViewState("FechaVigencia").ToString.ToDate
+ End If
+ End Get
+ Set(value As Date)
+ ViewState("FechaVigencia") = value
+ End Set
+ End Property
+
+ Property Estatus As Integer
+ Get
+ If ViewState("Estatus") Is Nothing Then
+ Return 0
+ Else
+ Return DirectCast(ViewState("Estatus"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("Estatus") = value
+ End Set
+ End Property
+
+ Property ObservacionDocumentacion As String
+ Get
+ If ViewState("ObservacionDocumentacion") Is Nothing Then
+ Return ""
+ Else
+ Return ViewState("ObservacionDocumentacion").ToString
+ End If
+ End Get
+ Set(value As String)
+ ViewState("ObservacionDocumentacion") = value
+ End Set
+ End Property
+
+ Private Property FechaLimite As Date
+ Get
+ If ViewState("FechaLimite") Is Nothing Then
+ Return Date.Now.AddDays(15)
+ Else
+ Return ViewState("FechaLimite").ToString.ToDate
+ End If
+ End Get
+ Set(value As Date)
+ ViewState("FechaLimite") = value
+ End Set
+ End Property
+
+
+ Property CveProveedor As Integer
+ Get
+ If ViewState("CveProveedor") Is Nothing Then
+ Return 0
+ Else
+ Return DirectCast(ViewState("CveProveedor"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("CveProveedor") = value
+ End Set
+ End Property
+#End Region
+
+
Private Sub Proveedores_RepDocumentacionProveedor_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaCombos()
@@ -125,7 +276,7 @@ Partial Class Proveedores_RepDocumentacionProveedor
Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
- Dim Documentacion As String = e.Row.DataKey("Documentacion")
+ Dim CveDocumentacionElectronica As Integer = e.Row.DataKey("CveDocumentacionElectronica").ToEntero
Dim ImgRechazar As LinkButton = e.Row.FCLinkButton("ImgRechazar")
@@ -185,9 +336,9 @@ Partial Class Proveedores_RepDocumentacionProveedor
ImgDownLoad.Visible = True
If extencion.Length > 0 Then
- ImgDownLoad.Text = String.Format(" ", linkDescarga, Documentacion & "." & extencion)
+ ImgDownLoad.Text = String.Format(" ", linkDescarga, CveDocumentacionElectronica & "." & extencion)
Else
- ImgDownLoad.Text = String.Format(" ", linkDescarga, Documentacion)
+ ImgDownLoad.Text = String.Format(" ", linkDescarga, CveDocumentacionElectronica)
End If
@@ -324,56 +475,149 @@ Partial Class Proveedores_RepDocumentacionProveedor
End Function
+ Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- 'Protected Sub BrnProcesar_Click(sender As Object, e As EventArgs)
+ ' Dim chkEstatus As CheckBox
+ CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero
+ CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero
+ Documentacion = GvRow.DataKey("Documentacion")
+ AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
+ CveProveedor = GvRow.DataKey("CveProveedor").ToEntero
+
+ 'DiasVigencia = GvRow.DataKey("DiasVigencia").ToString.ToEntero
+ Dim x As String = GvRow.DataKey("AplicaFechaVencimiento")
+ If GvRow.DataKey("AplicaFechaVencimiento") = "1" Then AplicaFechaVencimiento = True Else AplicaFechaVencimiento = False
+
+ If GvRow.DataKey("Adjunto").ToString.Length > 0 Then
+ FechaVigencia = GvRow.DataKey("Adjunto").ToString.ToDate
+ Else
+ FechaVigencia = Nothing
+ End If
+
+
+ Estatus = GvRow.DataKey("Estatus").ToEntero
+
+ 'If chkEstatus.Checked Then
+ ' Estatus = 1
+ 'Else
+ ' Estatus = 0
+ 'End If
+
+ ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper
+ FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
+
+ AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
+
+ LtlModalUploadTitulo.Text = "Subir " & Documentacion
+
+ UpModalTitleUploadDocumento.Update()
+
+ RegistraScript("$('#ModalUploadDoc').modal({ backdrop: 'static', keyboard: false});")
+
+ End Sub
- ' Dim objEdoc As New ClsEdocumentacion
- ' objEdoc.IniciaTransacSQL()
+ Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click
- ' Dim ErrorProceso As Boolean = False
+ Dim FileExtension As String = "-1"
+ Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos
+ Dim Filename As String = ""
+ Dim ErrorProceso As Boolean = False
- ' For Each GvRow As GridViewRow In GvDocumentos.Rows
+ If AplicaFechaVencimiento And DiasVigencia > 0 Then
+ FechaVigencia = DateTime.Today.AddDays(DiasVigencia)
+ End If
+
+ For Each fileItem As Archivo In Filesgral
- ' Dim RDBAcptar As RadioButton = GvRow.FCRadioButton("RDBAcptar")
- ' Dim RDBRechazar As RadioButton = GvRow.FCRadioButton("RDBRechazar")
- ' Dim ContactoMail As String = GvRow.DataKey("ContactoMail")
+ Try
+
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ Dim tempArray() As String
+ tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
+
- ' If RDBAcptar.Checked Or RDBRechazar.Checked Then
- ' Dim Estatus As Integer = If(RDBAcptar.Checked, 3, 1)
- ' Dim Obsebaciones As String = If(RDBAcptar.Checked, "", GvRow.FCTextBox("TxtObservaciones").Text)
+ Dim TempCveDocumentacionElectronica As Integer = 0
+ Dim objEdoc As New ClsEdocumentacion
+ objEdoc.IniciaTransacSQL()
+
+ If CveDocumentacionElectronica = -1 Then
+
+ CveDocumentacionElectronica = objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, "-1", UsuarioActual.CveUsuario, FechaLimite, FechaVigencia)
+
+ If CveDocumentacionElectronica > 0 Then
+ If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
+ ErrorProceso = True
+ End If
+ End If
+
+
+ Else
+ If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
+ ErrorProceso = True
+ End If
+ End If
- ' If Not objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, Estatus,
- ' If(Obsebaciones.Trim.Length > 0, Obsebaciones, GvRow.DataKey("Observacion")), "-1", UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate,
- ' GvRow.DataKey("FechaVigencia").ToDate) Then
- ' ErrorProceso = True
- ' Exit For
- ' Else
+ If Not ErrorProceso = True Then
+
+ Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & CveDocumentacionElectronica & "." & FileExtension
+ Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
+
+
+
+ Try
+ If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") Then
+ System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\")
+ End If
+
+ If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
+ File.Delete(rutaAdjuntoAnterior)
+ End If
+
+ If System.IO.File.Exists(rutaDestino) Then
+ System.IO.File.Delete(rutaDestino)
+ End If
+
+ System.IO.File.Move(fileItem.FileUrl, rutaDestino)
+ Catch ex As Exception
+ GuardaLog($"Error al gaurdar documento (moviendo archivo digital) --> Error{ ex.StackTrace}")
+ ErrorProceso = True
+ End Try
+ End If
+
+
+ If Not ErrorProceso Then
+ objEdoc.Commit()
+ Alert("Documento cargado correctamente")
+ Else
+ objEdoc.RollBack()
+ Alert("Error al cargar archivo", TipoMensaje.MsgError)
+ End If
+ objEdoc.Dispose()
+
+
+ CargaDocumentacion()
+
+ TxtFileDocumentacion.Text = ""
+ UPModalUploadDoc.Update()
+
+ Catch ex As Exception
+ OnError("Error al cargar archivo", ex)
+ End Try
+
+ Next
+
+ RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
+
+ End Sub
+
- ' If Estatus = 1 Then
- ' 'Enviar correo rechazo con obserbación
- ' End If
- ' End If
-
- ' Else
- ' 'Enviar correo archivo pediente
- ' End If
-
- ' Next
-
- ' If ErrorProceso Then
- ' objEdoc.RollBack()
- ' Else
- ' objEdoc.Commit()
- ' Alert("Proceso Terminado correctamente.")
- ' End If
-
- ' objEdoc.Dispose()
- 'End Sub
diff --git a/Edoc/CatDocumentos.aspx b/Edoc/CatDocumentos.aspx
index eaa6a2fed..a4dd193e9 100644
--- a/Edoc/CatDocumentos.aspx
+++ b/Edoc/CatDocumentos.aspx
@@ -1,4 +1,4 @@
-<%@ Page Title="RH - Catálogo de Documentos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentos.aspx.vb" Inherits="RH_CatDocumentos" %>
+<%@ Page Title="Catálogo de Documentos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentos.aspx.vb" Inherits="RH_CatDocumentos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
diff --git a/Edoc/CatTipoContratos.aspx b/Edoc/CatTipoContratos.aspx
index 422b85b15..ff3e1493a 100644
--- a/Edoc/CatTipoContratos.aspx
+++ b/Edoc/CatTipoContratos.aspx
@@ -1,4 +1,4 @@
-<%@ Page Title="RH - Catálogo de Géneros" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTipoContratos.aspx.vb" Inherits="Edoc_CatTipoContrato" %>
+<%@ Page Title="Tipo De Contrato" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTipoContratos.aspx.vb" Inherits="Edoc_CatTipoContrato" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
@@ -57,7 +57,7 @@
-
+
diff --git a/Edoc/CatTipoContratos.aspx.vb b/Edoc/CatTipoContratos.aspx.vb
index 6ba48e175..158eababc 100644
--- a/Edoc/CatTipoContratos.aspx.vb
+++ b/Edoc/CatTipoContratos.aspx.vb
@@ -43,6 +43,7 @@ Partial Class Edoc_CatTipoContrato
GvDatos.DataBind()
+ UpDatos.Update()
End Sub
@@ -89,7 +90,9 @@ Partial Class Edoc_CatTipoContrato
If Not ErrorProceso Then
- RegistraScript(String.Format("$('#{0}').modal('HIDE');", "DivAgregarTiposContrato"))
+
+ Alert($"Tipo Contrato { If(CveTipoContrato > 0, "Actualizado", "Agregado") } correctamente.")
+ RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposContrato"))
CargaDatos()
End If
diff --git a/Edoc/Contratos.aspx b/Edoc/Contratos.aspx
new file mode 100644
index 000000000..b49544a0c
--- /dev/null
+++ b/Edoc/Contratos.aspx
@@ -0,0 +1,285 @@
+<%@ Page Title="Contratos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Contratos.aspx.vb" Inherits="Proveedores_Contratos" %>
+<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
+
+
+
+
+
+
+
+ Contratos
+
+
+
+
+
+