diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index a6b8a70b9..3d1962323 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -67,6 +67,42 @@ + + + +
+
+
+ +
+
+
+ +
+ <%-- --%> + + + general + optima + motobateria + +
+ +
+ + + + + +
+
+
+
+
+
+
+
+
@@ -77,12 +113,12 @@ -
+
- + + +   + + + + +   + +   @@ -201,9 +246,9 @@
- +
- +
@@ -216,10 +261,27 @@
  +
+
+   + + general + optima + motobateria + + +
+
+
+ + + + +
<%--
diff --git a/Acumuladores/CatFoliosGarantia.aspx.vb b/Acumuladores/CatFoliosGarantia.aspx.vb index ef5209ca0..795b00dfc 100644 --- a/Acumuladores/CatFoliosGarantia.aspx.vb +++ b/Acumuladores/CatFoliosGarantia.aspx.vb @@ -38,7 +38,7 @@ Partial Class Acumuladores_CatFoliosGarantia If Not Page.IsPostBack Then CargaSubProyectos() - CargadatosGvFolioGarantia() + CargadatosGvFolioGarantia(-1, "-1") End If End Sub @@ -53,11 +53,11 @@ Partial Class Acumuladores_CatFoliosGarantia DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1")) End Sub - Private Sub CargadatosGvFolioGarantia() + Private Sub CargadatosGvFolioGarantia(EstatusValor As Integer, tipoFolioValor As String) Dim objAcum As New ClsAcumuladores - If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa) Then + If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=EstatusValor, TipoFolio:=tipoFolioValor) Then GvFolioGarantia.DataSource = objAcum.DtResultados Else GvFolioGarantia.DataSource = Nothing @@ -116,7 +116,7 @@ Partial Class Acumuladores_CatFoliosGarantia If Not Actualizar Then - If ObjAcum.FoliosGarantiaAdd(TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero) Then + If ObjAcum.FoliosGarantiaAdd(TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero) Then TxtFolioGarantia.Text = "" ChkEstatus.Checked = True @@ -125,7 +125,7 @@ Partial Class Acumuladores_CatFoliosGarantia 'TxtCompra.Text = "" 'TxtPuntos.Text = "" - CargadatosGvFolioGarantia() + CargadatosGvFolioGarantia(-1, "-1") RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarFolioGarantia"), "jsHideModalFolioGarantia") UpGral.Update() @@ -135,7 +135,8 @@ Partial Class Acumuladores_CatFoliosGarantia Alert("Ocurrió un error al guardar el Folio de Garantía", TipoMensaje.MsgError) End If Else - If ObjAcum.FoliosGarantiaUpdate(CveFolioGarantia, TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, DdlSubProyectos.SelectedValue.ToEntero) Then + If ObjAcum.FoliosGarantiaUpdate(CveFolioGarantia, TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, DdlSubProyectos.SelectedValue.ToEntero, + DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero) Then TxtFolioGarantia.Text = "" ChkEstatus.Checked = True @@ -144,7 +145,7 @@ Partial Class Acumuladores_CatFoliosGarantia 'TxtCompra.Text = "" 'TxtPuntos.Text = "" - CargadatosGvFolioGarantia() + CargadatosGvFolioGarantia(-1, "-1") UpModalFolioGarantia.Update() RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarFolioGarantia"), "jsHideModalFolioGarantia") @@ -171,7 +172,7 @@ Partial Class Acumuladores_CatFoliosGarantia Dim CveCapacitador As Integer = GvRow.DataKey("CveFolioGarantia") If objAcum.FoliosGarantiaRemove(CveCapacitador, UsuarioActual.CveEmpresa) Then - CargadatosGvFolioGarantia() + CargadatosGvFolioGarantia(-1, "-1") Alert("Capacitador Eliminó Correctamente ", TipoMensaje.MsgInformacion) Else @@ -180,7 +181,7 @@ Partial Class Acumuladores_CatFoliosGarantia objAcum.Dispose() - CargadatosGvFolioGarantia() + CargadatosGvFolioGarantia(-1, "-1") CveFolioGarantia = -1 @@ -198,6 +199,8 @@ Partial Class Acumuladores_CatFoliosGarantia TxtFolioGarantia.Text = GvRow.DataKey("FolioGarantia") ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False) + TxtLimite.Text = GvRow.DataKey("Limite") + DdlTipoFolioModal.SelectedValue = GvRow.DataKey("tipoFolio") 'TxtCargo.Text = GvRow.DataKey("Cargo").ToDecimal.ToString("###,###,###.00") 'TxtBonificacion.Text = GvRow.DataKey("Bonificacion").ToDecimal.ToString("###,###,###.00") 'TxtCompra.Text = GvRow.DataKey("Compra").ToDecimal.ToString("###,###,###.00") @@ -221,6 +224,8 @@ Partial Class Acumuladores_CatFoliosGarantia #End Region - + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargadatosGvFolioGarantia(DdlEstatus.SelectedValue.ToEntero, DdlTipoFolio.SelectedValue) + End Sub End Class diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx b/Acumuladores/RepEntradasUsadosClientes.aspx index 36a2fb0f6..c2da0c83c 100644 --- a/Acumuladores/RepEntradasUsadosClientes.aspx +++ b/Acumuladores/RepEntradasUsadosClientes.aspx @@ -72,15 +72,77 @@ - + - - - + + + + + + + + + + + + + + diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx.vb b/Acumuladores/RepEntradasUsadosClientes.aspx.vb index 8925785f9..75e36daaf 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('show');RecargaAvances = true;") + End Sub End Class diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index 56eb8028b..3720d4918 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -483,7 +483,7 @@ Public Class ClsAcumuladores #Region " FOLIOS GARANTÍA " - Public Function FoliosGarantiaGet(CveFolioGarantia As Integer, CveEmpresa As Integer, Optional Estatus As Integer = -1) As Boolean + Public Function FoliosGarantiaGet(CveFolioGarantia As Integer, CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional TipoFolio As String = "-1") As Boolean Dim Retorno As Boolean = False 'Data = New DataTable @@ -493,6 +493,7 @@ Public Class ClsAcumuladores .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia .Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@tipoFolio", SqlDbType.VarChar).Value = TipoFolio End With Try @@ -507,7 +508,7 @@ Public Class ClsAcumuladores Return Retorno End Function - Public Function FoliosGarantiaAdd(FolioGarantia As String, Estatus As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer) As Boolean + Public Function FoliosGarantiaAdd(FolioGarantia As String, Estatus As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoFolio As String, Limite As Integer) As Boolean Dim Retorno As Boolean = False 'Data = New DataTable @@ -520,6 +521,8 @@ Public Class ClsAcumuladores .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@TipoFolio", SqlDbType.VarChar).Value = TipoFolio + .Add("@Limite", SqlDbType.Int).Value = Limite End With @@ -535,7 +538,7 @@ Public Class ClsAcumuladores Return Retorno End Function - Public Function FoliosGarantiaUpdate(CveFolioGarantia As Integer, FolioGarantia As String, Estatus As Integer, CveUsuario As Integer, CveSubProyecto As Integer) As Boolean + Public Function FoliosGarantiaUpdate(CveFolioGarantia As Integer, FolioGarantia As String, Estatus As Integer, CveUsuario As Integer, CveSubProyecto As Integer, TipoFolio As String, Limite As Integer) As Boolean Dim Retorno As Boolean = False 'Data = New DataTable @@ -548,6 +551,8 @@ Public Class ClsAcumuladores .Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@TipoFolio", SqlDbType.VarChar).Value = TipoFolio + .Add("@Limite", SqlDbType.Int).Value = Limite End With @@ -1034,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 56585d092..2f2e2794e 100644 --- a/App_Code/ClsCompProveedores.vb +++ b/App_Code/ClsCompProveedores.vb @@ -1549,6 +1549,364 @@ Public Class ClsCompProveedores #End Region +#Region "TIPOS CONTRATOS" + + Public Function GetTiposContratos(CveTipoContrato As Integer, CveEmpresa As Integer, Estatus As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_CatTipoContratosGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Estatus", SqlDbType.Int).Value = Estatus + End With + + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el los tipos de contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function AddTiposContratos(TipoContrato As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_CatTipoContratosAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@TipoContrato", SqlDbType.VarChar).Value = TipoContrato + .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 agregar el tipo de contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function UpdateTiposContratos(CveTipoContrato As Integer, TipoContrato As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_CatTipoContratosUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato + .Add("@TipoContrato", SqlDbType.VarChar).Value = TipoContrato + .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 tipo de contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function RemoveTiposContratos(CveTipoContrato As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_CatTipoContratosRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato + .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 tipo de contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function GetTiposContratosDcumentos(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_CatTipoContratosDocumentosGet") + + With SqlAdapter.SelectCommand.Parameters + .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 tipo de contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdateTiposContratosDocumentos(CveTipoContrato As Integer, CveDocumentacion As Integer, Requerido As Boolean) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_CatTipoContratosDocumentosUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato + .Add("@CveDocumentacion", SqlDbType.Int).Value = CveDocumentacion + .Add("@Requerido", SqlDbType.Bit).Value = Requerido + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al Obtener los actualizar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + 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) 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 + + 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 #Region " IDisposable Support " diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb index d49f988a3..b850d1078 100644 --- a/App_Code/ClsEdocumentacion.vb +++ b/App_Code/ClsEdocumentacion.vb @@ -153,7 +153,7 @@ Public Class ClsEdocumentacion Public Function DocumentacionAdd(Documentacion As String, DocumentacionFormato As String, CveDocumentacionTipo As Integer, Estatus As Integer, Orden As Integer, Requerido As Integer, - DiasLimite As Integer, AplicaDiasLimite As Boolean, AplicaFechaVencimiento As Boolean, CveEmpresa As Integer) As Boolean + DiasLimite As Integer, AplicaDiasLimite As Boolean, AplicaFechaVencimiento As Boolean, CveEmpresa As Integer, Optional Periodicidad As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Edoc_DocumentacionAdd") @@ -169,6 +169,7 @@ Public Class ClsEdocumentacion .Add("@DiasLimite", SqlDbType.Int).Value = DiasLimite .Add("@AplicaDiasLimite", SqlDbType.Bit).Value = AplicaDiasLimite .Add("@AplicaFechaVencimiento", SqlDbType.Bit).Value = AplicaFechaVencimiento + .Add("@Periodicidad", SqlDbType.Int).Value = Periodicidad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -187,7 +188,7 @@ Public Class ClsEdocumentacion End Function - Public Function DocumentacionUpdate(CveDocumentacion As Integer, Documentacion As String, DocumentacionFormato As String, CveDocumentacionTipo As Integer, Estatus As Integer, Orden As Integer, Requerido As Integer, DiasLimite As Integer, AplicaDiasLimite As Boolean, AplicaFechaVencimiento As Boolean, CveEmpresa As Integer) As Boolean + Public Function DocumentacionUpdate(CveDocumentacion As Integer, Documentacion As String, DocumentacionFormato As String, CveDocumentacionTipo As Integer, Estatus As Integer, Orden As Integer, Requerido As Integer, DiasLimite As Integer, AplicaDiasLimite As Boolean, AplicaFechaVencimiento As Boolean, CveEmpresa As Integer, Optional Periodicidad As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Edoc_DocumentacionUpdate") @@ -204,6 +205,7 @@ Public Class ClsEdocumentacion .Add("@DiasLimite", SqlDbType.Int).Value = DiasLimite .Add("@AplicaDiasLimite", SqlDbType.Bit).Value = AplicaDiasLimite .Add("@AplicaFechaVencimiento", SqlDbType.Bit).Value = AplicaFechaVencimiento + .Add("@Periodicidad", SqlDbType.Int).Value = Periodicidad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With @@ -452,35 +454,61 @@ Public Class ClsEdocumentacion End Try Return Retorno - End Function + End Function + + Public Function DocumentacionElectronicaAuditoriaGet(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional Modulo As Integer = 3, Optional Estatus As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Edoc_DocumentacionElectronicaAuditoriaGet") - 'Public Function DocumentacionGet(CveDocumentacionTipo As Integer, CveEmpresa As Integer) As Boolean + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Modulo", SqlDbType.Int).Value = Modulo + .Add("@Estatus", SqlDbType.Int).Value = Estatus + End With - ' Dim Retorno As Boolean = False + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar los registros de documentación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try - ' DataAdapter("PA_Edoc_DocumentacionGet") - - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@CveDocumentacionTipo", SqlDbType.Int).Value = CveDocumentacionTipo - ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - ' End With - - ' Try - ' SqlAdapter.Fill(Data) - ' Retorno = True - ' Catch ex As Exception - ' OnError("Ocurrió un error al consultar la documentación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ' End Try - - ' Return Retorno - ' End Function + Return Retorno + End Function + + + + 'Public Function DocumentacionGet(CveDocumentacionTipo As Integer, CveEmpresa As Integer) As Boolean + + ' Dim Retorno As Boolean = False + + ' DataAdapter("PA_Edoc_DocumentacionGet") + + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveDocumentacionTipo", SqlDbType.Int).Value = CveDocumentacionTipo + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' End With + + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al consultar la documentación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' End Try + + ' Return Retorno + ' End Function #End Region - - - + + + #Region " IDisposable Support " - ' IDisposable + ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) If Not disposedValue Then If disposing Then diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index d64782ccb..8121ebca4 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -133,6 +133,26 @@ Public Class ClsGenerales End With End Sub + Public Function IEPSxEntidadFed(cveEstado As Int32, tasaIEPS As Decimal, fechaInicio As String, fechaFin As String, cveEmpresa As Int32, Agrupador As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_GralIepsPorEntidadFederativa", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveEstado", SqlDbType.Int).Value = (cveEstado) + .Add("@TasaIEPS", SqlDbType.Decimal).Value = (tasaIEPS) + .Add("@FechaInicio", SqlDbType.VarChar).Value = (fechaInicio) + .Add("@FechaFin", SqlDbType.VarChar).Value = (fechaFin) + .Add("@Agrupador", SqlDbType.Int).Value = (Agrupador) + .Add("@CveEmpresa", SqlDbType.Int).Value = (cveEmpresa) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de IEPS por entidad federativa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function Public Function RepConciliacionSatDetalleGET(cveEmpresa As Int32, tipoDocto As String, fechaI As String, fechaF As String, RegistroEn As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_RepConciliacionSatDetalleGET", CommandType.StoredProcedure) @@ -369,9 +389,12 @@ Public Class ClsGenerales End Function - Public Function GetGralPaqueteriasGuiasTipo() As Boolean + Public Function GetGralPaqueteriasGuiasTipo(Optional CveEmpresa As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_PaqueteriasGuiasTipoGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -381,6 +404,54 @@ Public Class ClsGenerales Return Retorno End Function + + Public Function AddGralPaqueteriasGuiasTipo(PaqueteriaGuiaTipo As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_PaqueteriasGuiasTipoAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@PaqueteriaGuiaTipo", SqlDbType.VarChar).Value = PaqueteriaGuiaTipo + .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 en el Catálogo de Paqueterias Guias Tipos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RemoveGralPaqueteriasGuiasTipo(CvePaqueteriaGuiaTipo As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_PaqueteriasGuiasTipoDelete") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePaqueteriaGuiaTipo", SqlDbType.Int).Value = CvePaqueteriaGuiaTipo + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar en el Catálogo de Paqueterias Guias Tipos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function UpdateGralPaqueteriasGuiasTipo(CvePaqueteriaGuiaTipo As Integer, PaqueteriaGuiaTipo As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_PaqueteriasGuiasTipoUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePaqueteriaGuiaTipo", SqlDbType.Int).Value = CvePaqueteriaGuiaTipo + .Add("@PaqueteriaGuiaTipo", SqlDbType.VarChar).Value = PaqueteriaGuiaTipo + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar en el Catálogo de Paqueterias Guias Tipos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function #End Region #Region "P L A N T I L L A S C O N T R A T O S" diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index b0d91b2b5..c38c36938 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3517,6 +3517,7 @@ Public Class ClsPaginas PaginaDict.Add("/Inicio.aspx".ToUpper(), -1) PaginaDict.Add("/reporteador.aspx".ToUpper(), -1) + PaginaDict.Add("/General/CATIEPSxEntidadFed.aspx".ToUpper(), 719) PaginaDict.Add("/GPS/RepArrastre.aspx".ToUpper(), 718) PaginaDict.Add("/Ventas/RepConciliacionEmitidosSat.aspx".ToUpper(), -1) PaginaDict.Add("/Ventas/RepConciliacionSat.aspx".ToUpper(), 716) @@ -3956,6 +3957,10 @@ Public Class ClsPaginas PaginaDict.Add("/Compras/RepPUESinPago.aspx".ToUpper(), 675) PaginaDict.Add("/Compras/RepReqOCCompraInv.aspx".ToUpper(), 689) PaginaDict.Add("/Compras/RepComprasPrecios.aspx".ToUpper(), 690) + PaginaDict.Add("/Compras/RepDocumentacionProveedor.aspx".ToUpper(), 1206) + PaginaDict.Add("/Compras/CatPaqueteriasGuiasTipo.aspx".ToUpper(), 753) + + #End Region 'CONTABILIDAD @@ -4663,9 +4668,14 @@ Public Class ClsPaginas 'Portal Cliente/Proveedor PaginaDict.Add("/PortalCliente/PortalCliente.aspx".ToUpper(), 1101) - PaginaDict.Add("/PortalProveedor/PortalProveedor.aspx".ToUpper(), 1201) - - 'Portal + PaginaDict.Add("/PortalProveedor/PortalProveedor.aspx".ToUpper(), 1201) + + PaginaDict.Add("/Edoc/CatDocumentos.aspx".ToUpper(), 1205) + 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) PaginaDict.Add("/Portal/ConsultaCliente.aspx".ToUpper(), -1) PaginaDict.Add("/Proveedores/PortalProveedor.aspx".ToUpper(), -1) @@ -4682,6 +4692,7 @@ Public Class ClsPaginas + 'Orden Produccion' 'RMA @@ -4865,12 +4876,23 @@ Public Class ClsPaginas Case "S" : Retorno = 1203 Case Else : Retorno = 1202 End Select + End If + + If Pagina.ToUpper() = ("/Ventas/Ventas.aspx").ToUpper() Then + Select Case Request("Op") + Case "Cot" : Retorno = 366 + Case "Rem" : Retorno = 2018 + Case Else : Retorno = 6 + End Select + End If + + If Pagina.ToUpper() = ("/Ventas/RepVentas.aspx").ToUpper() Then + Select Case Request("Op") + Case "Cot" : Retorno = 367 + Case Else : Retorno = 9 + End Select End If - ' End If - - - 'PaginaDict = Nothing Return Retorno End Function 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 3a75dc1df..e0d5d3f62 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -449,7 +449,6 @@ Namespace Modelos Private Sub IniciaValoresVentas(Optional EsCancelacion As Boolean = False) If CveVenta > 0 AndAlso CveEmpresa > 0 Then Me.DtAnticipos = New DataTable() - Me.DtAntNCVinculadas = New DataTable() Me.DtPagos = New DataTable() Me.DtRemisiones = New DataTable() Me.DtInventario = New DataTable() @@ -483,7 +482,7 @@ Namespace Modelos If TipoDocto.Contiene("Ing", "Ant", "Rem") Then 'carga as notas de credito vinculadas If ObjVentas.GetVentasAntNC(CveVenta, -1) Then - Me.DtAntNCVinculadas = ObjVentas.DtResultados.Copy() + Me.DtAnticipos = ObjVentas.DtResultados.Copy() End If End If @@ -493,7 +492,7 @@ Namespace Modelos End If If TipoDocto.Contiene("Ant") AndAlso EsCancelacion Then - EsNCAmortizacion = True + Me.EsNCAmortizacion = True End If If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion:=EsNCAmortizacion) Then @@ -2418,9 +2417,18 @@ Namespace Modelos CveCuenta = ObjFactura.Cliente.CveCuentaAnticipos CveSubProyectoContabilizar = CveSubProyectoVenta + Dim CveVenta As Integer = ObjFactura.CveVenta + Dim CveVentaAmortizacion As Integer = row2("CveVenta").ToString().ToEntero + + 'SI ES FACTURA EN 0 Y TIENE ANTICIPOS + If (ObjFactura.Total = 0 AndAlso UsuarioActual.CveEmpresa.Contiene(72) AndAlso ObjFactura.TipoDocto.Contiene("Ing")) AndAlso row2("TipoDocto").ToString() = "Ant" Then + CveVenta = row2("CveVenta").ToString().ToEntero + CveVentaAmortizacion = ObjFactura.CveVenta + End If + If importeMovimiento <> 0 Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, - CveVenta:=ObjFactura.CveVenta, CveVentaAmortizacion:=row2("CveVenta").ToString().ToEntero, CveCliente:=ObjFactura.CveCliente, + CveVenta:=CveVenta, CveVentaAmortizacion:=CveVentaAmortizacion, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True @@ -5213,8 +5221,7 @@ Namespace Modelos Public Property DtDeduccion As Data.DataTable Public Property DtFirmas As Data.DataTable Public Property DtDesgloseImpuestos As Data.DataTable - Public Property DtDocumentosRelacionados As Data.DataTable - Public Property DtAntNCVinculadas As Data.DataTable + Public Property DtDocumentosRelacionados As Data.DataTable Public Property DtNCVinculadas As Data.DataTable Public Property DtAnticipos As Data.DataTable 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 @@
+ +
+ + + + + +
+
@@ -114,7 +123,8 @@ Importe seleccionado: $00.00
- +
+ @@ -141,6 +151,12 @@ + + + + + + @@ -152,6 +168,7 @@ +
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/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 98a4713c9..6d0c5000c 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -720,7 +720,7 @@ Partial Class Bancos_ProveedoresAbonar Valida.Verificar(gvr.DataKey("UUID"), gvr.DataKey("RFC"), UsuarioActual.Empresa.RFC, gvr.DataKey("Original").ToDecimal) - If UsuarioActual.CveEmpresa < 2 Then + If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa < 2 Then Valida.EsValida = 1 End If diff --git a/Compras/CatPaqueteriasGuiasTipo.aspx b/Compras/CatPaqueteriasGuiasTipo.aspx new file mode 100644 index 000000000..7345ed5c3 --- /dev/null +++ b/Compras/CatPaqueteriasGuiasTipo.aspx @@ -0,0 +1,98 @@ +<%@ Page Title="Compras - Catálogo de Paquetería" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPaqueteriasGuiasTipo.aspx.vb" Inherits="Comp_CatPaqueteriasGuiasTipo" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de Paqueterías + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    + +   +
    +
    + + + +
    + + + + + +
    + + +
    + + + +
    +
    +
    + + \ No newline at end of file diff --git a/Compras/CatPaqueteriasGuiasTipo.aspx.vb b/Compras/CatPaqueteriasGuiasTipo.aspx.vb new file mode 100644 index 000000000..b606e5df0 --- /dev/null +++ b/Compras/CatPaqueteriasGuiasTipo.aspx.vb @@ -0,0 +1,82 @@ +Imports System.Data +Imports System.Linq +Imports Extensiones + +Partial Class Comp_CatPaqueteriasGuiasTipo + Inherits ClsPaginas + + Private Property CvePaqueteriaGuiaTipo() As Integer 'Guardamos el ID de registro para saber cual registro Editar + Get + Return If(IsNothing(ViewState("CvePaqueteriaGuiaTipo")), -1, CInt(ViewState("CvePaqueteriaGuiaTipo"))) + End Get + Set + ViewState("CvePaqueteriaGuiaTipo") = Value + End Set + End Property + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaDatos() + End If + End Sub + + Public Sub CargaDatos() + Dim ObjGenerales As New ClsGenerales + If ObjGenerales.GetGralPaqueteriasGuiasTipo(UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjGenerales.DtResultados + End If + ObjGenerales.Dispose() + GvDatos.DataBind() + End Sub + + Protected Sub BtnAgregarPaqueteria_Click(sender As Object, e As EventArgs) Handles BtnAgregarPaqueteria.Click + BtnEditarTiposDModal.Visible = False + BtnAgregarTiposDModal.Visible = True + UpModalTiposD.Update() + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) + End Sub + + Protected Sub BtnAgregarTiposDModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarTiposDModal.Click + Dim ObjGeneral As New ClsGenerales + If ObjGeneral.AddGralPaqueteriasGuiasTipo(TxtPaqueteria.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")) + CargaDatos() + UpDatos.Update() + Alert("Agregado Correctamente") + End If + ObjGeneral.Dispose() + End Sub + + Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting + Dim ObjGeneral As New ClsGenerales + If ObjGeneral.RemoveGralPaqueteriasGuiasTipo(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then + CargaDatos() + UpDatos.Update() + Alert("Eliminado con exito") + End If + ObjGeneral.Dispose() + End Sub + + Public Sub GvDatos_RowEditing(sender As Object, e As EventArgs) + BtnEditarTiposDModal.Visible = True + BtnAgregarTiposDModal.Visible = False + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) 'obtenemos el renglon que acabamos de seleccionar + TxtPaqueteria.Text = GvRow.DataKey("PaqueteriaGuiaTipo") + CvePaqueteriaGuiaTipo = GvRow.DataKey("CvePaqueteriaGuiaTipo") + + UpModalTiposD.Update() + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) + End Sub + + Protected Sub BtnEditarTiposDModal_Click(sender As Object, e As EventArgs) Handles BtnEditarTiposDModal.Click + Dim ObjGeneral As New ClsGenerales + If ObjGeneral.UpdateGralPaqueteriasGuiasTipo(CvePaqueteriaGuiaTipo, TxtPaqueteria.Text) Then + CargaDatos() + UpDatos.Update() + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")) + Alert("Actualizado con exito") + End If + ObjGeneral.Dispose() + End Sub +End Class diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index b8aeeea9b..f8ad52e6f 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -7245,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 @@ -10129,12 +10141,15 @@ Partial Class Compras_Compras EmisorRFC = ValorXML(node, "RFC") 'EmisorNombre = ValorXML(node, "nombre") End If - node = XMLDoc.SelectSingleNode(String.Format("//{0}:Receptor", Prefijo), namespaces) + + node = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) + node = XMLDoc.SelectSingleNode(String.Format("//{0}:Receptor", Prefijo), namespaces) + If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then ReceptorRFC = ValorXML(node, "RFC") End If - If UsuarioActual.CveEmpresa.Contiene(119) Then + If UsuarioActual.CveEmpresa.Contiene(119, 7) Then node = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then If ValorXML(node, "TipoRelacion").ToString.Contiene("04", "07") Then diff --git a/Compras/RepDocumentacionProveedor.aspx b/Compras/RepDocumentacionProveedor.aspx new file mode 100644 index 000000000..c6704dc1e --- /dev/null +++ b/Compras/RepDocumentacionProveedor.aspx @@ -0,0 +1,371 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepDocumentacionProveedor.aspx.vb" Inherits="Proveedores_RepDocumentacionProveedor" %> + + + + + + + + + Reporte documentación + + + + + + + + +
  • + +
  • + +
    + + + +
    + +
    + + + + + + + +
    +
    +
    + + "> + +
    +
    +
    + +
    Proveedor:
    +
    + + +
    + +
    Fecha Inicio
    +
    +
    + + + + +
    + + + + + <%-- --%> + + + <%----%> + +
    + +
    Fecha Fin
    +
    +
    + + + + +
    + <%-- --%> + + + + <%----%> + + + <%----%> + +
    + + +
    Estatus
    + +
    + + + Todos + Pendiente + Entregado + Completado + + +
    + + +
    + +
    +
    +
    > + + + +
    +
    +
    +
    + + + + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%-- + + + + --%> + + + +
    + + +
    +
    +
    + + + +
    +
    + + + + + + + +
    + + + + + diff --git a/Compras/RepDocumentacionProveedor.aspx.vb b/Compras/RepDocumentacionProveedor.aspx.vb new file mode 100644 index 000000000..d7322024f --- /dev/null +++ b/Compras/RepDocumentacionProveedor.aspx.vb @@ -0,0 +1,624 @@ +Option Strict On + + +Imports System.Data +Imports System.IO +Imports Extensiones +Imports GemBox.Spreadsheet + + + + +Partial Class Proveedores_RepDocumentacionProveedor + Inherits ClsPaginas + + Private Property DTDatos As DataTable + Get + If ViewState("DTDatos") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTDatos"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTDatos") = value + End Set + End Property + + + Private Property DTHeaders As DataTable + Get + If ViewState("DTHeaders") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTHeaders"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTHeaders") = value + End Set + 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() + + 'TxtFechaI.Text = Now.AddMonths(-3).ToString("dd/MM/yyyy") + 'TxtFechaF.Text = Now.ToString("dd/MM/yyyy") + + TxtFechaI.Text = "" + TxtFechaF.Text = "" + + LnkDescargarExcel.Visible = False + End If + 'ExportaExcel() + End Sub + + Private Sub CargaCombos() + + + DdlProveedores.setEsWebService(True) + DdlProveedores.Attributes.Add("data-metodo", "getproveedores") + DdlProveedores.SelectedText = "Todos" + DdlProveedores.SelectedValue = "-1" + + End Sub + + + Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click + CargaDocumentacion() + End Sub + + + Private Sub CargaDocumentacion() + + Dim CveProveedor As Integer = -1 + + Dim FechaInicio As Date + Dim FechaFin As Date + + If TxtFechaI.Text = "" Then + FechaInicio = MinFecha + Else + FechaInicio = TxtFechaI.Text.ToDate + End If + + If TxtFechaF.Text = "" Then + FechaFin = MaxFecha + Else + FechaFin = TxtFechaF.Text.ToDate + End If + + If DdlProveedores.txtValue.Value.ToEntero > 0 Then + CveProveedor = DdlProveedores.txtValue.Value.ToEntero + End If + + Dim obEDoc As New ClsEdocumentacion + + If obEDoc.DocumentacionElectronicaAuditoriaGet(CveProveedor, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 3, DdlEstatus.SelectedValue.ToEntero) Then + GvDocumentos.DataSource = obEDoc.DtResultados + Else + GvDocumentos.DataSource = Nothing + End If + + obEDoc.Dispose() + + GvDocumentos.DataBind() + UPGvDocumentos.Update() + + + + End Sub + + + + + + Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound + + + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString + Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + 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 CveDocumentacionElectronica As Integer = e.Row.DataKey("CveDocumentacionElectronica").ToEntero + + Dim ImgRechazar As LinkButton = e.Row.FCLinkButton("ImgRechazar") + + Dim ImgAceptar As LinkButton = e.Row.FCLinkButton("ImgAceptar") + + Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido")) + 'Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus") + 'Dim RDBAcptar As RadioButton = e.Row.FCRadioButton("RDBAcptar") + 'Dim RDBRechazar As RadioButton = e.Row.FCRadioButton("RDBRechazar") + + Dim separado As Char() = ".".ToCharArray + Dim array() As String = Adjunto.Split(separado) + Dim extencion As String = "" + + Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString.ToEntero + Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False) + Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False) + + txtFechaLimite.Visible = If(AplicaDiasLimite, True, False) + txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False) + + + + If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + If DateTime.Today > e.Row.DBCampo("FechaVigencia").ToString.ToDateTime Then + txtFechaVigencia.ForeColor = Drawing.Color.Red + End If + End If + + + If array.Length > 0 Then + extencion = array(array.Length - 1) + End If + + 'If e.Row.DBCampo("Estatus").ToString.ToEntero = 3 Then + ' RDBAcptar.Checked = True + 'Else + ' chkEstatus.Checked = False + 'End If + + txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString.ToDate.ToString("dd/MM/yyyy") + + If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + End If + + Dim scripMascara = "$('#" & txtFechaLimite.ClientID & "').mask('00/00/0000');$('#" & txtFechaVigencia.ClientID & "').mask('00/00/0000');" + RegistraScript(scripMascara, "scriptMascara") + + If Adjunto.Trim.Length > 0 Then + + Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Edoc/Proveedor/" & e.Row.DataKey("CveProveedor") & "/" & Adjunto + Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Edoc/Proveedor/" & e.Row.DataKey("CveProveedor") & "/" & Adjunto + + If File.Exists(linkDescargaArchivo) Then + ImgDownLoad.Visible = True + + If extencion.Length > 0 Then + ImgDownLoad.Text = String.Format(" ", linkDescarga, CveDocumentacionElectronica & "." & extencion) + Else + ImgDownLoad.Text = String.Format(" ", linkDescarga, CveDocumentacionElectronica) + End If + + + If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(2, 3) Then + ImgRechazar.Visible = True + End If + + + If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(2) Then + ImgAceptar.Visible = True + End If + + 'If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(3) Then + ' chkEstatus.Checked = True + 'End If + + Else + ImgDownLoad.Visible = False + End If + + Else + ImgDownLoad.Visible = False + End If + + If requerido Then + ImgRequired.Text = " " + End If + + 'chkEstatus.Checked = ImgDownLoad.Visible + + End If + End Sub + + Protected Sub ImgRechazar_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim Obsebaciones As String = GvRow.FCTextBox("TxtObservaciones").Text + If Obsebaciones.Trim.Length = 0 Then + Alert("Debe de proporcionar una obserbación o motivo de rechazo.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim Correo As String = GvRow.DataKey("ContactoMail") + Dim Documentacion As String = GvRow.DataKey("Documentacion") + Dim Obserbaciones As String = GvRow.FCTextBox("TxtObservaciones").Text + + Dim Adjunto As String = GvRow.DataKey("Adjunto") + Dim CveProveedor As Integer = GvRow.DataKey("CveProveedor").ToEntero + Dim Archivo As String = UsuarioActual.Empresa.Ruta & $"Edoc\Proveedor\{CveProveedor}\{Adjunto}" + + + Dim objEdoc As New ClsEdocumentacion + Dim ErrorProceso As Boolean = False + + objEdoc.IniciaTransacSQL() + + If objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, 1, + If(Obsebaciones.Trim.Length > 0, Obsebaciones, GvRow.DataKey("Observacion")), "-1", + UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate, GvRow.DataKey("FechaVigencia").ToDate) Then + + Try + File.Delete(Archivo) + Catch ex As Exception + ErrorProceso = True + End Try + + If Not ErrorProceso Then + + Dim Cuerpo As String = $"

    Por medio del presente correo se le notifica que el documento {Documentacion}   ha sido rechazado por la siguiente causa: {Obserbaciones}  por favor ingrese nuevamente al portal  y agréguelo nuevamente. 

    +

    Atentamente:

    +

    Saludos.

    " + + If Not MandaCorreo(Correo, $"{ UsuarioActual.Empresa.Empresa } documento Rechazado", Cuerpo) Then + ErrorProceso = True + End If + + Alert($"El documento {GvRow.DataKey("Documentacion") } fue rechazado.") + + End If + + + Else + ErrorProceso = True + End If + + If ErrorProceso Then + objEdoc.RollBack() + Else + objEdoc.Commit() + End If + + objEdoc.Dispose() + + CargaDocumentacion() + + End Sub + + Protected Sub ImgAceptar_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim objEdoc As New ClsEdocumentacion + + If objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, 3, + "", "-1", UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate, GvRow.DataKey("FechaVigencia").ToDate) Then + Alert("Dcumento Aceptado.") + End If + + + objEdoc.Dispose() + + CargaDocumentacion() + End Sub + + Private Function MandaCorreo(Para As String, Asunto As String, Body As String) As Boolean + Dim Respuesta As Boolean = False + + Dim Mail As New ClsSisMail() + + Para = If(Para IsNot Nothing, Para, "") + Asunto = If(Asunto IsNot Nothing, Asunto, "") + Body = If(Body IsNot Nothing, Body, "") + + Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail) + + If Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=ListaArchivos) Then + Respuesta = True + End If + + Return Respuesta + + + End Function + + + Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + ' 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 + + Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click + + Dim FileExtension As String = "-1" + Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos + Dim Filename As String = "" + Dim ErrorProceso As Boolean = False + + If AplicaFechaVencimiento And DiasVigencia > 0 Then + FechaVigencia = DateTime.Today.AddDays(DiasVigencia) + End If + + For Each fileItem As Archivo In Filesgral + + 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()) + + + + 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 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 + + + + + + + +End Class diff --git a/Edoc/CatDocumentos.aspx b/Edoc/CatDocumentos.aspx new file mode 100644 index 000000000..a4dd193e9 --- /dev/null +++ b/Edoc/CatDocumentos.aspx @@ -0,0 +1,353 @@ +<%@ 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" %> + + + + + + + + + Catálogo de Documentos + + + + +
  • + +
  • + <%--
  • + Etiquetas +
  • --%> +
    +
    +
    + + + + + + + + + +
    +
    +
    + + Documentación +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + +
    + +
    + + + +
    + + +
    +
    + + + + + + + + + + + + + + + +
    + + + diff --git a/Edoc/CatDocumentos.aspx.vb b/Edoc/CatDocumentos.aspx.vb new file mode 100644 index 000000000..2858a24c0 --- /dev/null +++ b/Edoc/CatDocumentos.aspx.vb @@ -0,0 +1,414 @@ + + +Imports System.Data +Imports System.Linq +Imports Extensiones +Imports System.IO + +Partial Class RH_CatDocumentos + Inherits ClsPaginas + + Private Property DTDocumentacion As DataTable + Get + If ViewState("DTDocumentacion") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTDocumentacion"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTDocumentacion") = 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 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 + + Private Property DocumentacionTipo As String + Get + If ViewState("DocumentacionTipo") Is Nothing Then + Return "" + Else + Return ViewState("DocumentacionTipo").ToString + End If + End Get + Set(value As String) + + End Set + End Property + + + Private Property CveDocumentacionTipo As Integer + Get + If ViewState("CveDocumentacionTipo") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("CveDocumentacionTipo"), Integer) + End If + End Get + + Set(value As Integer) + ViewState("CveDocumentacionTipo") = value + End Set + End Property + + + Property ActualizarDocumentacion As Boolean + Get + If ViewState("ActualizarDocumentacion") Is Nothing Then + Return True + Else + Return DirectCast(ViewState("ActualizarDocumentacion"), Boolean) + End If + End Get + Set(value As Boolean) + ViewState("ActualizarDocumentacion") = value + End Set + End Property + + Property Estatus As Boolean + Get + If ViewState("Estatus") Is Nothing Then + Return 0 + Else + Return DirectCast(ViewState("Estatus"), Boolean) + End If + End Get + Set(value As Boolean) + ViewState("Estatus") = value + End Set + End Property + + + Property DocumentacionFormato As String + Get + If ViewState("DocumentacionFormato") Is Nothing Then + Return "" + Else + Return ViewState("DocumentacionFormato").ToString + End If + End Get + Set(value As String) + ViewState("DocumentacionFormato") = value + End Set + End Property + + Property Requerido As Boolean + Get + If ViewState("Requerido") Is Nothing Then + Return True + Else + Return DirectCast(ViewState("Requerido"), Boolean) + End If + End Get + Set(value As Boolean) + ViewState("Requerido") = value + End Set + End Property + + + Property Orden As Integer + Get + If ViewState("Orden") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("Orden"), Integer) + End If + End Get + Set(value As Integer) + ViewState("Orden") = value + End Set + End Property + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaDocumentacion() + CargaComboDocumentacion() + End If + End Sub + + +#Region "D O C U M E N T A C I O N" + + Protected Sub BtnAgregarDocumento_Click(sender As Object, e As EventArgs) Handles BtnAgregarDocumento.Click + ResetFormDocumentacion() + RegistraScript("$('#divAgregarDocumentacion').modal({ backdrop: 'static', keyboard: false});") + End Sub + + Private Sub ResetFormDocumentacion() + + Txtdocumentacion.Text = "" + TxtOrden.Text = "" + TxtPeriodicidad.Text = "" + TxtDiasLimite.Text = "" + BtnAgregarDocumentoModal.Text = "Agregar" + LtlTituloModalDocumentacion.Text = "Agregar documentación" + 'TxtDocumentacionFormato.Text = "" + DdlDocumentacionTipo.SelectedIndex = 0 + chkEstatus.Checked = True + chkRequerido.Checked = True + + ActualizarDocumentacion = False + UpModalDocumentacion.Update() + End Sub + + Private Sub CargaDocumentacion() + + Dim objRH As New ClsEdocumentacion + + If objRH.DocumentacionGet(-1, -1, -1, UsuarioActual.Empresa.CveEmpresa) Then + + DTDocumentacion = objRH.DtResultados + GvDocumentos.DataSource = objRH.DtResultados + Else + DTDocumentacion = Nothing + GvDocumentos.DataSource = Nothing + End If + + objRH.Dispose() + GvDocumentos.DataBind() + UPGvDocumentos.Update() + + End Sub + + Private Sub CargaComboDocumentacion() + Dim objDocumentacion As New ClsEdocumentacion + + If objDocumentacion.DocumentacionTipoGet(UsuarioActual.CveEmpresa) Then + + DdlDocumentacionTipo.DataSource = objDocumentacion.DtResultados + + End If + + objDocumentacion.Dispose() + DdlDocumentacionTipo.DataBind() + DdlDocumentacionTipo.Items.Insert(0, New ListItem("Seleccione un tipo", "-1")) + End Sub + + Public Sub Edit_ClickDocumentacion(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + CveDocumentacion = GvRow.DataKey("CveDocumentacion") + Documentacion = GvRow.DataKey("Documentacion") + DocumentacionFormato = GvRow.DataKey("DocumentacionFormato") + CveDocumentacionTipo = GvRow.DataKey("CveDocumentacionTipo") + DocumentacionTipo = GvRow.DataKey("DocumentacionTipo") + Orden = GvRow.DataKey("Orden") + Estatus = GvRow.DataKey("Estatus") + Requerido = GvRow.DataKey("Requerido") + + + Txtdocumentacion.Text = Documentacion + TxtOrden.Text = Orden + + TxtDiasLimite.Text = GvRow.DataKey("DiasLimite") + ChkAplicaDiasLimite.Checked = GvRow.DataKey("AplicaDiasLimite") + TxtPeriodicidad.Text = GvRow.DataKey("Periodicidad") + + ChkAplicaFechaVencimiento.Checked = GvRow.DataKey("AplicaFechaVencimiento") + + DdlDocumentacionTipo.SelectedValueExist(CveDocumentacionTipo) + chkEstatus.Checked = Estatus + chkRequerido.Checked = Requerido + + + LtlTituloModalDocumentacion.Text = "Actualizar Documento: " & Documentacion + BtnAgregarDocumentoModal.Text = "Actualizar" + + UpModalDocumentacion.Update() + ActualizarDocumentacion = True + + RegistraScript("$('#divAgregarDocumentacion').modal({ backdrop: 'static', keyboard: false});") + + End Sub + + Private Function GuardarArchivo(_CveDocumentacion As Integer) As String + + Dim respuesta As String = "" + + Dim FileExtension As String = "-1" + Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos + Dim Filename As String = "" + + For Each fileItem As Archivo In Filesgral + Try + respuesta = fileItem.filenameO + 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()) + + Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Formatos\" & _CveDocumentacion & "_" & fileItem.filenameO + Dim docAnterior As String = UsuarioActual.Empresa.Ruta & "Formatos\" & _CveDocumentacion & "_" & DocumentacionFormato + + If DocumentacionFormato.Trim.Length > 0 Then + If File.Exists(docAnterior) Then + File.Delete(docAnterior) + End If + End If + + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "\Formatos") Then + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "\Formatos") + + 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 + OnError("Error al cargar archivo", ex) + End Try + TxtFileDocumentacion.Text = "" + UpModalDocumentacion.Update() + Next + + + Return respuesta + End Function + + Public Sub Remove_ClickDocumentacion(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion") + Dim _documetacionFormato As String = GvRow.DataKey("DocumentacionFormato") + + + + Dim objEdoc As New ClsEdocumentacion + + If objEdoc.DocumentacionRemove(_CveDocumentacion, UsuarioActual.Empresa.CveEmpresa) Then + EliminarDocumentoDisco(_documetacionFormato) + Alert("Documento eliminado correctamente", TipoMensaje.MsgInformacion) + CargaDocumentacion() + End If + End Sub + + Private Sub EliminarDocumentoDisco(documento As String) + + Dim archivo As String = UsuarioActual.Empresa.Ruta & "Formatos\" & documento + + If File.Exists(archivo) Then + File.Delete(archivo) + End If + + End Sub + + + Protected Sub BtnAgregarDocumentoModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarDocumentoModal.Click + + Dim objRH As New ClsEdocumentacion + Dim intCompleto As Integer = 0 + Dim _estatus As Integer = 0 + Dim _requerido As Integer = 0 + Dim _formato As String = "" + + + If chkEstatus.Checked Then + _estatus = 1 + End If + + If chkRequerido.Checked Then + _requerido = 1 + End If + + If ActualizarDocumentacion Then + + _formato = GuardarArchivo(CveDocumentacion) + If objRH.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, ChkAplicaDiasLimite.Checked, ChkAplicaFechaVencimiento.Checked, UsuarioActual.Empresa.CveEmpresa, + TxtPeriodicidad.Text.ToEntero) Then + + RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion")) + Alert("Documento Actualizado correctamente.", TipoMensaje.MsgInformacion) + CargaDocumentacion() + End If + + Else + If objRH.DocumentacionAdd(Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, ChkAplicaDiasLimite.Checked, ChkAplicaFechaVencimiento.Checked, UsuarioActual.Empresa.CveEmpresa, TxtPeriodicidad.Text.ToEntero) Then + + CveDocumentacion = objRH.DtResultados(0)(0).ToString.ToEntero + _formato = GuardarArchivo(CveDocumentacion) + If objRH.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, ChkAplicaDiasLimite.Checked, ChkAplicaFechaVencimiento.Checked, UsuarioActual.Empresa.CveEmpresa, + TxtPeriodicidad.Text.ToEntero) Then + + End If + + RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion")) + Alert("Documento agregado correctamente.", TipoMensaje.MsgInformacion) + CargaDocumentacion() + End If + End If + + ActualizarDocumentacion = False + + End Sub + + + Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString.ToEntero + Dim DocumetacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString + Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim separado As Char() = {"."} + Dim array() As String = DocumetacionFormato.Split(separado) + Dim extencion As String = "" + + If array.Length > 0 Then + extencion = array(array.Length - 1) + End If + + If DocumetacionFormato.Trim.Length > 0 Then + + Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & _CveDocumentacion & "_" & DocumetacionFormato + Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato + If File.Exists(linkDescargaArchivo) Then + ImgDownLoad.Visible = True + If extencion.Length > 0 Then + ImgDownLoad.Text = String.Format(" ", linkDescarga, DocumetacionFormato) + Else + ImgDownLoad.Text = String.Format(" ", linkDescarga, DocumetacionFormato) + End If + Else + ImgDownLoad.Visible = False + End If + + Else + ImgDownLoad.Visible = False + End If + + End If + + End Sub + +#End Region + + +End Class + diff --git a/Edoc/CatDocumentosContratos.aspx b/Edoc/CatDocumentosContratos.aspx new file mode 100644 index 000000000..96906ac70 --- /dev/null +++ b/Edoc/CatDocumentosContratos.aspx @@ -0,0 +1,113 @@ +<%@ Page Title="Documentos Contratos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentosContratos.aspx.vb" Inherits="Edoc_CatDocumentosContratos" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Documentos Contratos + + + + <%-- +
  • + +
  • + +
    --%> +
    +
    + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/Edoc/CatDocumentosContratos.aspx.vb b/Edoc/CatDocumentosContratos.aspx.vb new file mode 100644 index 000000000..9d9e86c54 --- /dev/null +++ b/Edoc/CatDocumentosContratos.aspx.vb @@ -0,0 +1,52 @@ +Option Strict On + +Imports System.Data +Imports System.Linq +Imports Extensiones + +Partial Class Edoc_CatDocumentosContratos + Inherits ClsPaginas + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + CargaDatos() + End If + + End Sub + + + Private Sub CargaDatos() + + Dim ObjProv As New ClsCompProveedores + + If ObjProv.GetTiposContratosDcumentos(UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjProv.DtResultados + Else + GvDatos.DataSource = Nothing + End If + + ObjProv.Dispose() + + GvDatos.DataBind() + + End Sub + + + Protected Sub ChkRequerido_CheckedChanged(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, CheckBox).NamingContainer, GridViewRow) + + Dim CveTipoContrato As Integer = GvRow.DataKey("CveTipoContrato").ToEntero + Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToEntero + Dim ChkRequerido As CheckBox = GvRow.FCCheckBox("ChkRequerido") + + Dim ObjProv As New ClsCompProveedores + + ObjProv.UpdateTiposContratosDocumentos(CveTipoContrato, CveDocumentacion, ChkRequerido.Checked) + + ObjProv.Dispose() + + End Sub + +End Class diff --git a/Edoc/CatTipoContratos.aspx b/Edoc/CatTipoContratos.aspx new file mode 100644 index 000000000..ff3e1493a --- /dev/null +++ b/Edoc/CatTipoContratos.aspx @@ -0,0 +1,122 @@ +<%@ 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" %> + + + + + + + + Catálogo Tipos de Contrato + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/Edoc/CatTipoContratos.aspx.vb b/Edoc/CatTipoContratos.aspx.vb new file mode 100644 index 000000000..158eababc --- /dev/null +++ b/Edoc/CatTipoContratos.aspx.vb @@ -0,0 +1,126 @@ +Option Strict On + +Imports System.Data +Imports System.Linq +Imports Extensiones + +Partial Class Edoc_CatTipoContrato + Inherits ClsPaginas + + Protected Property CveTipoContrato As Integer + Get + If ViewState("CveTipoContrato") Is Nothing Then + Return -1 + Else + Return ViewState("CveTipoContrato").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("CveTipoContrato") = value + End Set + End Property + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + CargaDatos() + End If + + End Sub + + + Private Sub CargaDatos() + + Dim ObjProv As New ClsCompProveedores + + If ObjProv.GetTiposContratos(-1, UsuarioActual.CveEmpresa, -1) Then + GvDatos.DataSource = ObjProv.DtResultados + Else + GvDatos.DataSource = Nothing + End If + + ObjProv.Dispose() + + GvDatos.DataBind() + + UpDatos.Update() + End Sub + + + Protected Sub BtnAgregarMotivo_Click(sender As Object, e As EventArgs) Handles BtnAgregarTipoContrato.Click + + CveTipoContrato = -1 + TxtTipoContrato.Text = "" + ChkEstatus.Checked = True + + UpModalTiposContrato.Update() + + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposContrato")) + End Sub + + Protected Sub LnkGvActualizar_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + + CveTipoContrato = GvRow.DataKey("CveTipoContrato").ToEntero + TxtTipoContrato.Text = GvRow.DataKey("TipoContrato") + ChkEstatus.Checked = Boolean.Parse(GvRow.DataKey("Estatus").ToString) + UpModalTiposContrato.Update() + + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposContrato")) + + End Sub + + Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregarTiposDModal.Click + + Dim ObjProv As New ClsCompProveedores + Dim ErrorProceso As Boolean = False + + If CveTipoContrato = -1 Then + If Not ObjProv.AddTiposContratos(TxtTipoContrato.Text, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + ErrorProceso = True + End If + Else + + If Not ObjProv.UpdateTiposContratos(CveTipoContrato, TxtTipoContrato.Text, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + ErrorProceso = True + End If + + End If + + + If Not ErrorProceso Then + + Alert($"Tipo Contrato { If(CveTipoContrato > 0, "Actualizado", "Agregado") } correctamente.") + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposContrato")) + CargaDatos() + + End If + + + + ObjProv.Dispose() + End Sub + + Protected Sub LnkGvEliminar_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim ErrorProceso As Boolean = False + Dim CveTipoContratoEliminar As Integer = GvRow.DataKey("CveTipoContrato").ToEntero + + Dim ObjProv As New ClsCompProveedores + + If ObjProv.RemoveTiposContratos(CveTipoContratoEliminar, UsuarioActual.CveEmpresa) Then + Alert("Tipo Contrato eliminado correctamente") + Else + ErrorProceso = True + End If + + If Not ErrorProceso Then + CargaDatos() + End If + + + ObjProv.Dispose() + + End Sub +End Class 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 + + + + + +
  • + +
  • +
    +
    +
    + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/Edoc/Contratos.aspx.vb b/Edoc/Contratos.aspx.vb new file mode 100644 index 000000000..153298752 --- /dev/null +++ b/Edoc/Contratos.aspx.vb @@ -0,0 +1,277 @@ +Option Strict On + +Imports System.Data +Imports System.Linq +Imports Extensiones + +Partial Class Proveedores_Contratos + Inherits ClsPaginas + + Protected Property CveContrato As Integer + Get + If ViewState("CveContrato") Is Nothing Then + Return -1 + Else + Return ViewState("CveContrato").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("CveContrato") = value + End Set + End Property + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + CargaDatos() + CargaCombos() + + End If + + End Sub + + + Private Sub CargaDatos() + + Dim ObjProv As New ClsCompProveedores + + If ObjProv.GetContrato(-1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjProv.DtResultados + Else + GvDatos.DataSource = Nothing + End If + + ObjProv.Dispose() + GvDatos.DataBind() + + UpDatos.Update() + + End Sub + + Private Sub CargaCombos() + 'CargaProveedores + DdlProveedores.setEsWebService(True) + DdlProveedores.Attributes.Add("data-metodo", "getproveedores") + DdlProveedores.SelectedText = "Todos" + DdlProveedores.SelectedValue = "-1" + + + DdlSubProyecto.Items.Clear() + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + DdlSubProyecto.DataBind() + DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + + + DdlTipoContrato.Items.Clear() + + Dim ObjProveedor As New ClsCompProveedores + + + If ObjProveedor.GetTiposContratos(-1, UsuarioActual.CveEmpresa, 1) Then + DdlTipoContrato.DataSource = ObjProveedor.DtResultados + End If + + ObjProveedor.Dispose() + + DdlTipoContrato.DataBind() + + DdlTipoContrato.Items.Insert(0, New ListItem("Seleccione", "-1")) + + CargaRepresentantes() + + End Sub + + + + + Protected Sub BtnAgregarContratoModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarContratoModal.Click + + CveContrato = -1 + ChkEstatus.Checked = True + + TxtContrato.Text = "" + + DdlProveedores.txtValue.Value = "" + DdlProveedores.txtText.Value = "" + + DdlTipoContrato.SelectedValueExist("-1") + DdlSubProyecto.SelectedValueExist("-1") + DDlRePresentanteLegal.SelectedValueExist("-1") + + TxtFechaInicio.Text = "" + TxtFechaFin.Text = "" + ChkEstatus.Checked = True + + BtnAgregarModalContrato.Text = "Agregar" + + UpModalContrato.Update() + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarContrato")) + + End Sub + + Protected Sub LnkGvActualizar_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + + CveContrato = GvRow.DataKey("CveContrato").ToEntero + + TxtContrato.Text = GvRow.DataKey("Contrato") + + DdlProveedores.txtValue.Value = GvRow.DataKey("CveProveedor") + DdlProveedores.txtText.Value = GvRow.DataKey("NombreComercial") + DdlTipoContrato.SelectedValueExist(GvRow.DataKey("CveTipoContrato")) + DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto")) + DDlRePresentanteLegal.SelectedValueExist(GvRow.DataKey("CveRepresentanteLegal")) + + TxtFechaInicio.Text = GvRow.DataKey("FechaInicio").ToString.ToDate().ToString("dd/MM/yyyy") + TxtFechaFin.Text = GvRow.DataKey("FechaFin").ToString.ToDate().ToString("dd/MM/yyyy") + + ChkEstatus.Checked = Boolean.Parse(GvRow.DataKey("Estatus")) + + + BtnAgregarModalContrato.Text = "Actualizar" + + UpModalContrato.Update() + + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarContrato")) + + End Sub + + Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregarModalContrato.Click + + If DdlProveedores.txtValue.Value.ToEntero <= 0 Then + Alert("Debe seleccionar un proveedor", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim ObjProv As New ClsCompProveedores + ObjProv.IniciaTransacSQL() + + Dim ErrorProceso As Boolean = False + + If CveContrato = -1 Then + If Not ObjProv.AddContrato(TxtContrato.Text, DdlTipoContrato.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlProveedores.txtValue.Value.ToEntero, DDlRePresentanteLegal.SelectedValue.ToEntero, + TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + ErrorProceso = True + End If + Else + If Not ObjProv.UpdateContrato(CveContrato, TxtContrato.Text, DdlTipoContrato.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlProveedores.txtValue.Value.ToEntero, DDlRePresentanteLegal.SelectedValue.ToEntero, + TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + ErrorProceso = True + End If + End If + + If Not ErrorProceso Then + + ObjProv.Commit() + ObjProv.Dispose() + + If CveContrato > 0 Then + Alert("Contrato Actualizado Correctamente.") + Else + Alert("Contrato Agregado Correctamente.") + End If + + + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarContrato")) + CargaDatos() + + Else + + ObjProv.RollBack() + ObjProv.Dispose() + + End If + + + + + + End Sub + + Protected Sub LnkGvEliminar_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim ErrorProceso As Boolean = False + Dim CveTipoContratoEliminar As Integer = GvRow.DataKey("CveTipoContrato").ToEntero + + Dim ObjProv As New ClsCompProveedores + + If ObjProv.RemoveContrato(CveTipoContratoEliminar, UsuarioActual.CveEmpresa) Then + Alert("Tipo Contrato eliminado correctamente") + Else + ErrorProceso = True + End If + + ObjProv.Dispose() + + If Not ErrorProceso Then + CargaDatos() + End If + + + + + End Sub + Protected Sub BtnCatRepresentantes_Click(sender As Object, e As EventArgs) + TxtRepresentanteLegal.Text = "" + + RegistraScript(String.Format("$('#{0}').modal('show');", "DivAgregarContrato2"), "frm2") + UpModalRepresentante.Update() + End Sub + + Protected Sub BtnAgregarRepresentante_Click(sender As Object, e As EventArgs) + + Dim ObjProv As New ClsCompProveedores + + If ObjProv.AddRePresentanteLegal(TxtRepresentanteLegal.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + Alert("Se agrego representante correctamente.") + TxtRepresentanteLegal.Text = "" + End If + + ObjProv.Dispose() + + CargaRepresentantes() + + End Sub + + Private Sub CargaRepresentantes() + + Dim ObjProv As New ClsCompProveedores + + + If ObjProv.GetRePresentanteLegal(-1, UsuarioActual.CveEmpresa) Then + GvRepresentante.DataSource = ObjProv.DtResultados + DDlRePresentanteLegal.DataSource = ObjProv.DtResultados + Else + GvRepresentante.DataSource = Nothing + End If + + ObjProv.Dispose() + + DDlRePresentanteLegal.Items.Clear() + DDlRePresentanteLegal.DataBind() + DDlRePresentanteLegal.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + + GvRepresentante.DataBind() + + UpModalRepresentante.Update() + UpModalContrato.Update() + End Sub + + Protected Sub LnkGvRepresentantesEliminar_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim CveRepresentanteLegal As Integer = GvRow.DataKey("CveRepresentanteLegal").ToEntero + Dim ObjProv As New ClsCompProveedores + + If ObjProv.RemoveRePresentanteLegal(CveRepresentanteLegal, UsuarioActual.CveEmpresa) Then + Alert("Representante eliminado correctamente.") + End If + + ObjProv.Dispose() + + CargaRepresentantes() + + End Sub +End Class diff --git a/Empresas/141/Formatos/Factura.rdlc b/Empresas/141/Formatos/Factura.rdlc index 671af6634..98de34936 100644 --- a/Empresas/141/Formatos/Factura.rdlc +++ b/Empresas/141/Formatos/Factura.rdlc @@ -1099,7 +1099,7 @@ - =Fields!PS.Value & " " & Fields!Obs.Value + =Fields!PS.Value & System.Environment.NewLine & IIF(Fields!Obs.Value <> "","Observaciones: ","") & Fields!Obs.Value - 20.5093cm + 20.50931cm + + + + + + Textbox6 + + + + + + Gray + 2pt + 2pt + 2pt + 1pt + + + + @@ -57,9 +97,6 @@ 3.17009cm - - 6.13624cm - @@ -135,41 +172,6 @@ - - - - true - - - - - =Fields!TipoAlmacen.Value - - - - - - - TipoAlmacen - - - =IIF(Fields!Almacen.Value="Total","#67809F","White") - 2pt - 2pt - 1pt - 1pt - - - - @@ -256,46 +258,6 @@ - - - 0.3751cm - - - true - true - - - - - Tipo Almacén - - - - - - - Textbox42 - - - Gray - 2pt - 2pt - 2pt - 1pt - - - - - @@ -344,6 +306,44 @@ + + + + 6.13624cm + + + true + true + + + + + =Fields!TipoAlmacen.Value + + + + + + =IIF(Fields!Almacen.Value="Total","#67809F","White") + 2pt + 2pt + 1pt + 1pt + + + + + + @@ -371,11 +371,13 @@ - Filtros - 0.17638cm + 0.20788cm 0.6cm 18.70841cm 1 @@ -676,6 +678,7 @@ + 0cm 0cm 19.26933cm 5 diff --git a/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc b/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc index 37cfca530..d2db328a8 100644 --- a/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc +++ b/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc @@ -372,7 +372,7 @@ - =IIf(Fields!PS.Value = "", "Folio: " & Fields!FolioSalida.Value, Fields!Cantidad.Value) + =IIf(Fields!PS.Value = "", IIf(Fields!FolioSalida.Value > 0,"Folio: " & Fields!FolioSalida.Value,"Total General"), Fields!Cantidad.Value) - true diff --git a/Empresas/Grales/Formatos/Traslado.rdlc b/Empresas/Grales/Formatos/Traslado.rdlc index 626b3516a..d94b0fd55 100644 --- a/Empresas/Grales/Formatos/Traslado.rdlc +++ b/Empresas/Grales/Formatos/Traslado.rdlc @@ -490,6 +490,215 @@ + + 0.44125cm + + + + + true + true + + + + + =Sum(Fields!Cantidad.Value) + + + + + + + Textbox20 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + Total Productos + + + + + + + Textbox21 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox23 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox37 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox41 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + + + + + + + + Textbox42 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + @@ -509,13 +718,19 @@ + + + + + + Before DsInventarios 0.07056cm 0.00711cm - 0.73434cm + 1.17559cm 19.56807cm - 0.42708in + 0.68252in +
    + + IEPS Por Entidad Federativa + + + + +
  • + PDF +
  • +
  • + Excel +
  • +
    + + + + + +
    +
    +
    + + +
    +
    +
    + +
    + + + + +
    + +
    + + + + + + +
    + +
    + + +
    +
    + Fecha Inicio +
    +
    +
    + + + + +
    + + + +
    +
    + Fecha Fin +
    +
    +
    + + + + +
    + + + +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + diff --git a/General/CATIEPSxEntidadFed.aspx.cs b/General/CATIEPSxEntidadFed.aspx.cs new file mode 100644 index 000000000..23354850a --- /dev/null +++ b/General/CATIEPSxEntidadFed.aspx.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using Microsoft.Reporting.WebForms; +using System.Data; +public partial class General_CATIEPSxEntidadFed : ClsPaginas +{ + #region Propiedades + private int RAgrupador + { + get { return (ViewState["RAgrupador"] == null) ? 1 : Convert.ToInt32(ViewState["RAgrupador"]); } + set { ViewState["RAgrupador"] = value; } + } + private int RcveEstado + { + get { return (ViewState["RcveEstado"] == null) ? 0 : Convert.ToInt32(ViewState["RcveEstado"]); } + set { ViewState["RcveEstado"] = value; } + } + private decimal RtasaIEPS + { + get { return (ViewState["RtasaIEPS"] == null) ? 0 : Convert.ToDecimal(ViewState["RtasaIEPS"]); } + set { ViewState["RtasaIEPS"] = value; } + } + private string RfechaInicio + { + get { return (ViewState["RfechaInicio"] == null) ? "-1" : (ViewState["RfechaInicio"]).ToString(); } + set { ViewState["RfechaInicio"] = value; } + } + private string RfechaFin + { + get { return (ViewState["RfechaFin"] == null) ? "-1" : (ViewState["RfechaFin"]).ToString(); } + set { ViewState["RfechaFin"] = value; } + } + private DataTable DtIEPS{ + get { return (ViewState["DtIEPS"] == null) ? null : (DataTable)(ViewState["DtIEPS"]); } + set { ViewState["DtIEPS"] = value; } + } + + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + DdlEstado.DataSource = get_GlobalDTEstado("Mex"); + DdlEstado.DataBind(); + + + DdlEstado.Items.Insert(0, new ListItem("Seleccione", "-1")); + RcveEstado = Request["cveEstado"] == null ? -1 : Request["cveEstado"].ToString().ToEntero(); + RtasaIEPS = Request["tasaIEPS"] == null ? -1 : Request["tasaIEPS"].ToString().ToDecimal(); + RfechaInicio = Request["fechaInicio"] == null ? string.Format("01/{0:MM/yyyy}", DateTime.Now.AddMonths(-1)) : Request["fechaInicio"].ToString(); + RfechaFin = Request["fechaFin"] == null ? string.Format("{0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth()) : Request["fechaFin"].ToString(); + DdlEstado.SelectedValueExist(RcveEstado.ToString()); + DdlIeps.SelectedValueExist(RtasaIEPS.ToString()); + TxtIEPSfechaInicio.Text = $"{RfechaInicio:dd/MM/yyyy}"; + TxtIEPSfechaFin.Text = $"{RfechaFin:dd/MM/yyyy}"; + + RfechaInicio = RfechaInicio.ToDate().ToString("yyyy/MM/dd"); + RfechaFin = RfechaFin.ToDate().ToString("yyyy/MM/dd"); + CargaIEPSxEntidadFed(); + } + } + protected void CargaIEPSxEntidadFed() + { + ClsGenerales ObjIEPS = new ClsGenerales(); + ObjIEPS.IEPSxEntidadFed(RcveEstado, RtasaIEPS, RfechaInicio, RfechaFin, 119, RAgrupador); + GVIEPSxEntidadFed.DataSource = ObjIEPS.DtResultados; + DtIEPS = ObjIEPS.DtResultados; + ObjIEPS.Dispose(); + GVIEPSxEntidadFed.DataBind(); + upDatosIEPS.Update(); + + } + + protected void GVIEPSxEntidadFed_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + int cveGrupo = e.Row.DBCampo("CveGrupo").ToEntero(); + if (cveGrupo == 1) + { + e.Row.CssClass = "Titulos"; + } + if (cveGrupo == 2) + { + e.Row.CssClass = "Totales"; + } + } + } + protected void BtnIEPSFiltrar_Click(object sender, EventArgs e) + { + + RAgrupador = DdlAgrupador.SelectedValue.ToEntero(); + RcveEstado = DdlEstado.SelectedValue.ToEntero(); + RtasaIEPS = DdlIeps.SelectedValue.ToDecimal(); + RfechaInicio = TxtIEPSfechaInicio.Text.ToDate().ToString("yyyy/MM/dd"); + RfechaFin = TxtIEPSfechaFin.Text.ToDate().ToString("yyyy/MM/dd"); + + CargaIEPSxEntidadFed(); + } + + protected void LnkExcel_Click(object sender, EventArgs e) + { + GVIEPSxEntidadFed.ExportToExcelx("IEPS porEntidad Federativa"); + } + + protected void LnkPDF_Click(object sender, EventArgs e) + { + List paramList = new List(); + paramList.Add(new ReportParameter("Logo", String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa))); + paramList.Add(new ReportParameter("FechaInicio", TxtIEPSfechaInicio.Text)); + paramList.Add(new ReportParameter("FechaFin", TxtIEPSfechaFin.Text)); + paramList.Add(new ReportParameter("Agrupador", DdlAgrupador.SelectedValue)); + paramList.Add(new ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)); + paramList.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); + paramList.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString("d/M/yyyy"))); + + ImprimirPDF("Empresas/Grales/Formatos/CatIepsEntidadFed.rdlc", DtIEPS, paramList,"IEPS por entidades federativa",RDSName:"DsInventarios"); + } +} diff --git a/General/CatDocumentacionTipo.aspx b/General/CatDocumentacionTipo.aspx index 3cffb0787..dba6be481 100644 --- a/General/CatDocumentacionTipo.aspx +++ b/General/CatDocumentacionTipo.aspx @@ -100,7 +100,8 @@ Catalogo Documentacion Tipo Seleccione uno Recursos Humanos - Clientes + Clientes + Proveedor diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 7906f4e00..ede60a241 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -807,6 +807,8 @@ Partial Class Inventarios_RecepcionAlmacen End If End Sub Private Sub CargaCompra(pCveCompra As Integer, pCveProveedor As Integer) + CargaAlmacenes(-1) + Dim ObjCompras As New ClsCompras Dim ObjInventario As New ClsInventarios @@ -838,16 +840,34 @@ Partial Class Inventarios_RecepcionAlmacen CargaAlmacenes(-1, "21,2") End If RecibidaCompleta = False + + Dim CargaSoloUsados As Boolean = False If ObjInventario.RecepcionAlmacenGet(pCveCompra, BuscaEntregaDirecta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then + Dim DtRecepcion As DataTable = Nothing + Dim NumUsados = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = True").ToEntero() + Dim NumProductos = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = False").ToEntero() + + 'SI LA COMPRA TIENE PRODUCTOS Y USADOS SOLO MOSTRAR LOS PRODUCTOS + If NumProductos > 0 AndAlso NumUsados > 0 Then + DtRecepcion = ObjInventario.DtResultados.FiltraParametros("EsUsado = False") + 'SI LA COMPRA TIENE PUROS USADOS, MOSTRAR LOS USADOS Y CARGAR LOS ALMACENES + ElseIf NumProductos = 0 AndAlso NumUsados > 0 Then + CargaSoloUsados = True + DtRecepcion = ObjInventario.DtResultados.Copy() + CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22") + Else + DtRecepcion = ObjInventario.DtResultados.Copy() + End If + DtDatosDetalle = Nothing CreaDtDetalle() DtDatosLoteDetalle = Nothing CreaDtLoteDetalle() - CreaDTInv(ObjInventario.DtResultados) + CreaDTInv(DtRecepcion) BtnGuardar.Visible = True 'cuando están todos los detalles de la compra, nos indica que se va a recibir la totalidad de la compra - If ObjInventario.DtResultados.Rows.Count = ObjInventario.DtResultados.Rows(0)("NumDetalles").ToString.ToEntero Then + If DtRecepcion.Rows.Count = DtRecepcion.Rows(0)("NumDetalles").ToString.ToEntero Then RecibidaCompleta = True End If @@ -869,8 +889,8 @@ Partial Class Inventarios_RecepcionAlmacen LtAdvertencia.Text = "La mercancía tendra salida inmediata por ser entrega directa al cliente" DivAdvertencia.Visible = True EntregaDirecta = True - CveCliente = ObjInventario.DtResultados.Rows(0)("CveCliente").ToString.ToEntero - CveVendedor = ObjInventario.DtResultados.Rows(0)("CveVendedor").ToString.ToEntero + CveCliente = DtRecepcion.Rows(0)("CveCliente").ToString.ToEntero + CveVendedor = DtRecepcion.Rows(0)("CveVendedor").ToString.ToEntero If DtInv.COUNT("EntregaDirecta") <> DtInv.Rows.Count Then @@ -884,7 +904,7 @@ Partial Class Inventarios_RecepcionAlmacen Alert("No hay productos pendientes de surtir de esta compra. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Else - If ObjInventario.DtResultados.Rows(0)("CveVendedor").ToString.ToEntero > 0 And ObjInventario.DtResultados.Rows(0)("CveCliente").ToString.ToEntero > 0 Then + If DtRecepcion.Rows(0)("CveVendedor").ToString.ToEntero > 0 And DtRecepcion.Rows(0)("CveCliente").ToString.ToEntero > 0 Then If DtInv.SUM("EntregaDirecta") > 0 Then ''ENTREGA DIRECTA 'LtAdvertencia.Text = "La mercancía tendra salida inmediata por ser entrega directa al cliente" @@ -892,9 +912,9 @@ Partial Class Inventarios_RecepcionAlmacen 'EntregaDirecta = True Else 'APARTADO - 'If UsuarioActual.CveUsuario.Contiene(100) Or (ObjInventario.DtResultados.Rows(0)("CveUsuarioOC").ToString.ToEntero = 1559 And ObjInventario.DtResultados.Rows(0)("FechaIngOC").ToString.ToDateTime > "2017-04-24 12:00".ToDateTime) Then + 'If UsuarioActual.CveUsuario.Contiene(100) Or (DtRecepcion .Rows(0)("CveUsuarioOC").ToString.ToEntero = 1559 And DtRecepcion .Rows(0)("FechaIngOC").ToString.ToDateTime > "2017-04-24 12:00".ToDateTime) Then If UsuarioActual.Empresa.Funcionalidad(148) = "1" Then - CveAlmacenApartado = ObjInventario.DtResultados.Rows(0)("CveAlmacenApartado").ToString.ToEntero + CveAlmacenApartado = DtRecepcion.Rows(0)("CveAlmacenApartado").ToString.ToEntero DivAdvertencia.Visible = True Apartado = True @@ -903,7 +923,11 @@ Partial Class Inventarios_RecepcionAlmacen LtAdvertencia.Text = "No se puede recibir la mercancía por ser de apartados y no contar con un almacen de apartado." Else LtAdvertencia.Text = "La mercancía sera traspasada ha apartados" - CargaAlmacenes(ObjInventario.DtResultados.Rows(0)("CveSubProyecto").ToString.ToEntero) + If CargaSoloUsados Then + CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22") + Else + CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero) + End If End If End If 'End If @@ -912,19 +936,19 @@ Partial Class Inventarios_RecepcionAlmacen End If - Dim CantidadFaltante As Double = ObjInventario.DtResultados.SUM("CantidadC", "CantidadF > 0") + Dim CantidadFaltante As Double = DtRecepcion.SUM("CantidadC", "CantidadF > 0") If UsuarioActual.Empresa.UsaAC AndAlso CantidadFaltante > 0 Then PnlAC.Visible = True CargaAC() - LbTotalPorDevengar.Text = ObjInventario.DtResultados.SUM("Total", "CantidadF > 0").FormatoNumero + LbTotalPorDevengar.Text = DtRecepcion.SUM("Total", "CantidadF > 0").FormatoNumero End If 'Existencias If TipoMovimiento = 2 Then If ObjInventario.ComprasDevolucionExistenciasGet(CveCompraSurtir) Then - DtExistencias = ObjInventario.DtResultados + DtExistencias = DtRecepcion Else Alert("No se pudieron cargar las existencias del movimiento de entrada, por lo cual no se podra hacer la devolución.", TipoMensaje.MsgError) BtnGuardar.Enabled = False diff --git a/Inventarios/RepAlmacen.aspx b/Inventarios/RepAlmacen.aspx index 5d4b16180..3edf19640 100644 --- a/Inventarios/RepAlmacen.aspx +++ b/Inventarios/RepAlmacen.aspx @@ -161,6 +161,11 @@ <%# Eval("Almacen") %> + + + + + @@ -171,11 +176,6 @@ - - - - - diff --git a/Inventarios/RepAlmacen.aspx.vb b/Inventarios/RepAlmacen.aspx.vb index 0285cdfd0..57284f8ca 100644 --- a/Inventarios/RepAlmacen.aspx.vb +++ b/Inventarios/RepAlmacen.aspx.vb @@ -85,10 +85,10 @@ Partial Class Inventarios_RepAlmacen Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim StrFiltro As New StringBuilder - If TxtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio : {0}", TxtFechaI.Text.ToDate.ToShortDateString) - If TxtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin : {0}", TxtFechaF.Text.ToDate.ToShortDateString) - If DdlTipoAlmacen.GetSelectedText <> "" Then StrFiltro.AppendFormat(" Tipo Almacen: {0}", DdlTipoAlmacen.GetSelectedText) - If DdlModalidadFiltro.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Modalidad: {0}", DdlModalidadFiltro.SelectedItem) + If TxtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio : {0}", TxtFechaI.Text.ToDate.ToShortDateString) Else StrFiltro.AppendFormat(" Fecha Inicio : Sin Considerar") + If TxtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin : {0}", TxtFechaF.Text.ToDate.ToShortDateString) Else StrFiltro.AppendFormat(" Fecha Fin : Sin Considerar") + If DdlTipoAlmacen.GetSelectedText <> "" Then StrFiltro.AppendFormat(" Tipo Almacen: {0}", DdlTipoAlmacen.GetSelectedText) Else StrFiltro.AppendFormat(" Tipo Almacen: Todos") + If DdlModalidadFiltro.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Modalidad: {0}", DdlModalidadFiltro.SelectedItem) Else StrFiltro.AppendFormat(" Modalidad: Todas") Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) diff --git a/Inventarios/RepTraspasoAlmacen.aspx.vb b/Inventarios/RepTraspasoAlmacen.aspx.vb index 773324e70..1a9d2d59c 100644 --- a/Inventarios/RepTraspasoAlmacen.aspx.vb +++ b/Inventarios/RepTraspasoAlmacen.aspx.vb @@ -100,13 +100,16 @@ Partial Class RepTraspasoAlmacen If e.Row.RowType = DataControlRowType.DataRow Then 'Cuando es titulo - If e.Row.DBCampo("PS").ToString.Trim = "" Then + If e.Row.DBCampo("PS").ToString.Trim = "" And e.Row.DBCampo("FechaMovto") <> "" Then e.Row.CssClass = "Totales" e.Row.Cells(0).Text = String.Format("Folio: {0} ", e.Row.DBCampo("FolioSalida"), e.Row.DBCampo("CveMovimientoSalida")) e.Row.Cells(1).Text = String.Format("{0}", e.Row.DBCampo("FechaMovto").ToString.ToDate.ToShortDateString) e.Row.Cells(3).Text = String.Format("Almacen Origen: {0}     Almacen Destino: {1}       Responsable: {2}", e.Row.DBCampo("Almacen"), e.Row.DBCampo("AlmacenDestino"), e.Row.DBCampo("Recibio")) + ElseIf e.Row.DBCampo("FechaMovto") = "" Then + e.Row.CssClass = "Totales" + e.Row.Cells(0).Text = "Total General" End If End If diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index d206c81a1..3be76f987 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1511,6 +1511,7 @@ Partial Class Inventarios_TraspasoAlmacen End If Dim ObjInventario As New ClsInventarios + Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) ObjInventario.IniciaTransacSQL() Dim CveMovimientoEntrada As Integer = 0 Dim Folio = 0 @@ -1518,31 +1519,58 @@ Partial Class Inventarios_TraspasoAlmacen Dim TextoError = "" Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate - CveMovimientoEntrada = ObjInventario.AddMovimiento(GvDatosRecepcion.Rows(0).DataKey("CveAlmacenDestino").ToEntero, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, - Observaciones:=TxtObservacionesRecepcion.Text.Trim, Recibio:=TxtRecibio.Text, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenDestino").ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G") + CveMovimientoEntrada = ObjInventario.AddMovimiento(GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, + Observaciones:=TxtObservacionesRecepcion.Text.Trim, Recibio:=TxtRecibio.Text, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, + CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G") + + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, TxtObservacionesRecepcion.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CvePrePoliza <= 0 Then + TextoError = "No se pudo generar la Poliza para la cancelacion" + ErrorMovInv = True + End If + Folio = ObjInventario.Folio - If CveMovimientoEntrada <= 0 Then + If CveMovimientoEntrada <= 0 And Not ErrorMovInv Then TextoError = "No se pudo generar el movimiento de entrada correctamente" ErrorMovInv = True Else Dim CveMovimientoDetalleSalida As Integer = 0 + Dim importe As Double = 0 If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then For Each Dr As DataRow In ObjInventario.DtResultados.Rows CveMovimientoDetalleSalida = Dr("CveMovimientoDetalle").ToString.ToEntero + Dim Cantidad As Double = Dr("Cantidad").ToString.ToDouble + Dim PrecioUnitario As Double = Dr("PU").ToString.ToDouble If CveMovimientoDetalleSalida <= 0 Then ErrorMovInv = True TextoError = "Ocurrió un error al guardar los movimientos de salida" Exit For End If - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PrecioUnitario, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then ErrorMovInv = True TextoError = "Ocurrió un error al guardar los movimientos de entrada" Exit For End If + importe += Cantidad * PrecioUnitario Next End If + If Not ErrorMovInv Then + Dim ImporteDecimal As Decimal = importe.ToDecimal + Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, + CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ImporteDecimal) Then + ErrorMovInv = True + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, + CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ImporteDecimal) Then + ErrorMovInv = True + End If + End If + End If If Not ErrorMovInv Then @@ -1565,8 +1593,10 @@ Partial Class Inventarios_TraspasoAlmacen UPDatosAlmacen.Update() Else ObjInventario.RollBack() + ObjConta.RollBack() Alert(TextoError, TipoMensaje.MsgError) End If + ObjConta.Dispose() ObjInventario.Dispose() CargaRecepcion() End Sub diff --git a/Planeacion/CatSubProyectos.aspx.vb b/Planeacion/CatSubProyectos.aspx.vb index 217c9a811..f2d679fd2 100644 --- a/Planeacion/CatSubProyectos.aspx.vb +++ b/Planeacion/CatSubProyectos.aspx.vb @@ -83,8 +83,8 @@ Partial Class CatSubProyectos Private Sub RecargaGlobal() Dim ObjSubProyectos As New ClsSubProyectos - If ObjSubProyectos.GetSubProyectos() Then - GlobalDTSubProyectos(-1) = ObjSubProyectos.DtResultados + If ObjSubProyectos.GetSubProyectos(UsuarioActual.CveEmpresa) Then + GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjSubProyectos.DtResultados End If ObjSubProyectos.Dispose() End Sub @@ -400,6 +400,7 @@ Partial Class CatSubProyectos RecargaGlobal() Else ObjSubproyectos.RollBack() + RecargaGlobal() End If 'se regeneran los subproyectos diff --git a/PortalProveedor/PortalProveedor.aspx b/PortalProveedor/PortalProveedor.aspx index ad0b81226..912ae99df 100644 --- a/PortalProveedor/PortalProveedor.aspx +++ b/PortalProveedor/PortalProveedor.aspx @@ -798,10 +798,190 @@ + <%---2020/02/06 - Auditoria--%> + + + + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + --%> + + <%-- + + + + --%> + + +
    + + +
    +
    +
    + + + + +
    +
    +
    +
    + - + @@ -853,6 +1033,16 @@ }); }); + + + function RestrictSpace() { + + if (event.keyCode == 32) { + event.returnValue = false; + return false; + } + } + - e + diff --git a/PortalProveedor/PortalProveedor.aspx.vb b/PortalProveedor/PortalProveedor.aspx.vb index fbc7a3673..9b5100c61 100644 --- a/PortalProveedor/PortalProveedor.aspx.vb +++ b/PortalProveedor/PortalProveedor.aspx.vb @@ -2,12 +2,13 @@ Option Strict On Imports System.Data +Imports System.IO Imports Extensiones Imports Microsoft.Reporting.WebForms Partial Class Portal_PortalProveedor - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "PROPIEDADES" Private Property CveProveedor As Integer Get @@ -102,10 +103,149 @@ Partial Class Portal_PortalProveedor Set(value As DataTable) ViewState("DTGvAH") = value End Set - End Property - + End Property + #End Region - + +#Region " D O C U M E N T A C I O N" + + + + 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 + + +#End Region + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -114,8 +254,9 @@ Partial Class Portal_PortalProveedor ViewState("Orden") = "" CargaDatos() - - 'CARGAN PESTANIAS SEGUN PERMISOS + CargaDocumentacion() + + 'CARGAN PESTANIAS SEGUN PERMISOS If UsuarioActual.TienePermisoProceso(236) Then ' CARGA TAB HISTORIAL DE VENTAS TabHistorial.Visible = True CargaHistorial("-1", 20) @@ -147,11 +288,11 @@ Partial Class Portal_PortalProveedor If UsuarioActual.CvePlataforma = 7 Then TabContraseña.Visible = True End If - End Sub - - + End Sub + + #Region "C A R G A - D A T O S" - + Protected Sub CargaDatos() GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimero($"CveProveedor = {CveProveedor}") Dim ObjProveedor As New ClsCompProveedores() @@ -169,8 +310,8 @@ Partial Class Portal_PortalProveedor End If ObjProveedor.Dispose() - End Sub - + End Sub + #Region "CARGA GRIDS" Private Sub CargaHistorial(SerieSucursal As String, SelectTop As Integer) Dim ObjProveedores As New ClsCompProveedores() @@ -308,9 +449,9 @@ Partial Class Portal_PortalProveedor GvBancosCuentas.DataBind() UpCuentasBancos.Update() - End Sub + End Sub #End Region - + #Region "ROW DATA BOUND" Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -448,13 +589,13 @@ Partial Class Portal_PortalProveedor End If Archivo = Nothing Alert("No se encontro el documento") - End Sub + End Sub #End Region - - + + #End Region - - + + #Region " BTNS VER MÁS" Protected Sub BtnVerMasVentas_Click(sender As Object, e As EventArgs) @@ -506,289 +647,289 @@ Partial Class Portal_PortalProveedor GvCxPHistorial.DataBind() ' UpDatos.Update() - End Sub - + End Sub + #End Region - - + + #Region "Usuarios Portal" - - 'Private Sub CargaUsuariosPortal() - ' Dim ObjUsrs As New ClsSisUsuarios() - ' If ObjUsrs.GetUsuariosPortal(-1, -1, CveProveedor) Then - ' Dim dtUsr As DataTable = ObjUsrs.DtResultados - ' 'Dim dr As DataRow = dtUsr.FiltroPrimero(String.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)) - ' 'If dr IsNot Nothing Then - - ' ' If True Then TabHistorial.Visible = True 'dr("Permiso1").ToString = "True" - ' ' If True Then TabCxP.Visible = True - ' ' If True Then TabAnticipos.Visible = True - ' ' If True Then TabBancos.Visible = True - ' ' If True Then TabSistema.Visible = True - - ' 'End If - - ' 'dtUsr = dtUsr '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) - - ' ViewState("OrdenUsuarios") = "" - ' GvUsuariosPortal.DataSource = dtUsr - ' ViewState("DTUsuariosProveedor") = dtUsr - ' Else - ' GvUsuariosPortal.DataSource = Nothing - ' ViewState("DTUsuariosProveedor") = Nothing - ' End If - ' ObjUsrs.Dispose() - ' GvUsuariosPortal.DataBind() - 'End Sub - - - 'Private Sub CargaGridUsuarios(Orden As String) - ' If CType(ViewState("DTUsuariosProveedor"), DataTable).Rows.Count > 0 Then - ' If Orden <> String.Empty Then - ' Dim DV As New DataView(CType(ViewState("DTUsuariosProveedor"), DataTable), "", Orden, DataViewRowState.CurrentRows) - ' GvUsuariosPortal.DataSource = DV.ToTable() '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) - ' DV.Dispose() - ' Else - ' GvUsuariosPortal.DataSource = CType(ViewState("DTUsuariosProveedor"), DataTable) '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) - ' End If - ' End If - ' GvUsuariosPortal.DataBind() - ' UPPUsuarios.Update() - 'End Sub - - ''ajustar el tamaño de las celdas de la GvUsuarios Portal - 'Protected Sub GvUsuariosPortal_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvUsuariosPortal.RowDataBound - ' If e.Row.RowType = DataControlRowType.DataRow Then - - ' 'El usuario Admin no se puede editar ni eliminar - ' If e.Row.DataKey("Nombre") = "Admin" Then - ' e.Row.FCLinkButton("imgE").Visible = False - ' e.Row.FCLinkButton("imgD").Visible = False - ' e.Row.FCLinkButton("imgC").Visible = False - ' End If - - ' If e.Row.RowIndex = 0 Then - ' '' e.Row.Cells(0).Width = Unit.Pixel(120) - ' 'e.Row.Cells(0).Width = Unit.Pixel(120) - ' 'e.Row.Cells(1).Width = Unit.Pixel(150) - ' 'e.Row.Cells(2).Width = Unit.Pixel(55) - ' 'e.Row.Cells(3).Width = Unit.Pixel(55) - ' 'e.Row.Cells(4).Width = Unit.Pixel(55) - ' 'e.Row.Cells(5).Width = Unit.Pixel(55) - ' 'e.Row.Cells(6).Width = Unit.Pixel(55) - ' 'e.Row.Cells(7).Width = Unit.Pixel(55) - - ' 'e.Row.Cells(8).Width = Unit.Pixel(75) - ' 'e.Row.Cells(9).Width = Unit.Pixel(100) - ' 'e.Row.Cells(10).Width = Unit.Pixel(150) - ' End If - ' End If - 'End Sub - - ''Editar usuarios - 'Protected Sub GvUsuariosPortal_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles GvUsuariosPortal.RowEditing - ' GvUsuariosPortal.EditIndex = e.NewEditIndex - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - - 'Protected Sub GvUsuariosPortal_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs) Handles GvUsuariosPortal.RowUpdating - ' Dim ObjUsuario As New ClsSisUsuarios - ' Dim Nombre, Correo As String - ' Dim Estatus As Boolean - ' Dim gvr As GridViewRow = GvUsuariosPortal.Rows(e.RowIndex) - - ' 'Usuario = gvr.FCLiteral("LtlUUsuario").Text.Trim - ' Nombre = gvr.FCTextBox("TxtUsuarioPortalEdit").Text.Trim - ' Correo = gvr.FCTextBox("TxtCorreoEdit").Text.Trim - ' Estatus = gvr.FCCheckBox("ChkEstatus").Checked - - ' Dim CveUsuarioPortal As Integer = gvr.DataKey("CveUsuario").ToEntero - ' Dim pCveProveedor As Integer = gvr.DataKey("CveProveedor").ToEntero - - ' If ObjUsuario.UpdateUsuarioPortal(Correo, Nombre, Correo, Estatus, "-1", -1, CveProveedor, CveUsuarioPortal, UsuarioActual.CveUsuario) Then - ' GvUsuariosPortal.EditIndex = -1 - ' ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) - ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados - ' End If - ' ObjUsuario.Dispose() - - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - - 'End Sub - - ''Cancelar Edición - 'Protected Sub GvUsuariosPortal_RowCancelingEdit(ByVal sender As Object, ByVal e As GridViewCancelEditEventArgs) Handles GvUsuariosPortal.RowCancelingEdit - ' GvUsuariosPortal.EditIndex = -1 - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - - ''Restablecer contraseña - 'Protected Sub GvUsuariosPortal_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvUsuariosPortal.RowCommand - - ' If e.CommandName = "RestablecerContraseña" Then - ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero - ' Dim Usuario As New ClsSisUsuarios - ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then - ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") - - ' If Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, CType(dr("Estatus"), Boolean), ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then - ' GvUsuariosPortal.EditIndex = -1 - ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) - ' Alert("Contraseña Restablecida.
    La nueva contraseña es: """ & ContraseñaPredeterminada & "") - ' End If - ' End If - ' Usuario.Dispose() - ' End If - - ' If e.CommandName = "ReenviarCorreo" Then - ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero - ' Dim Usuario As New ClsSisUsuarios - ' Usuario.IniciaTransacSQL() - ' Dim TieneError = False - - ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then - ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") - - ' 'ACTUALIZA USUARIO, CONTRASEÑA Y ESTATUS - ' If Not Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, True, ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then - ' TieneError = True - ' Alert("Ocurrió un error al actualizar el usuario. Por favor vuelva a intentar.", TipoMensaje.MsgError) - ' End If - - ' 'MANDA CORREO ACTIVACION - ' If Not TieneError Then - ' Dim ObjParametro As SisParametro = GlobalDTParametros(SisParametros.URL) - ' Dim Liga As String = ObjParametro.Cadena1 & "LogIn.aspx" - ' Dim LigaActivar = Liga & "?p=" & Encripta("CveU=" & cveUsuarioPortal & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks & "&CveE=" & UsuarioActual.CveEmpresa) - - ' Dim ObjMail As New ClsSisMail() - - ' If dr("Correo").ToString <> "" Then - ' Dim Correos As String() = dr("Correo").ToString.Split(New Char() {";"c}) - ' Dim Texto = "" - ' For Each Correo As String In Correos - ' Texto = String.Format("Direccion de Acceso: Portal del Proveedor
    Usuario: {2}
    Haga click para activar su cuenta Activar", Liga, CveProveedor, dr("Usuario").ToString, LigaActivar) - ' 'If Not ObjMail.MandaCorreo(EmpresaNotificaciones, Correo, "Activación de cuenta", "", "", {""}, Texto) Then - ' If Not ObjMail.SendMail(EmpresaNotificaciones, Correo, "Activación de cuenta", Texto) Then - ' Alert("Error al mandar el correo. Por favor vuelva a intentar", TipoMensaje.MsgError) - ' TieneError = True - ' Exit For - ' End If - ' Next - - ' Else - ' Alert("No se ha registrado ningún correo al usuario.", TipoMensaje.MsgAdvertencia) - ' TieneError = True - ' End If - ' End If - - ' If Not TieneError Then - ' Usuario.Commit() - ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados - ' Alert(String.Format("Se envio correo al usuario y se restablecio contraseña .
    La nueva contraseña es: ""{0}""", ContraseñaPredeterminada), TipoMensaje.MsgInformacion) - ' Else - ' Usuario.RollBack() - ' End If - - ' End If - ' Usuario.Dispose() - ' End If - - 'End Sub - - ''Eliminar Usuarios - 'Protected Sub GvUsuariosPortal_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GvUsuariosPortal.RowDeleting - ' Dim Usuario As New ClsSisUsuarios - ' If Usuario.RemoveUsuarioPortal(GvUsuariosPortal.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then - ' GvUsuariosPortal.EditIndex = -1 - ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados - ' End If - ' Usuario.Dispose() - ' Alert("Usuario Eliminado") - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - - ''Agregar Usuario - 'Protected Sub LnkAgregarUsuario_Click(sender As Object, e As EventArgs) Handles LnkAgregarUsuario.Click - ' Dim ObjUsuario As New ClsSisUsuarios - ' Dim CvePlataforma As Integer = 7 - - ' ObjUsuario.IniciaTransacSQL() - - ' Dim CveUsuario As Integer = ObjUsuario.AddUsuarioPortal(TxtCorreo.Text.Trim, ContraseñaPredeterminadaEncriptada, TxtNombrePortal.Text.Trim, TxtCorreo.Text.Trim, -1, CveProveedor, CvePlataforma, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - - ' If CveUsuario > 0 Then - ' If ObjUsuario.UpdateUsuariosModulos(CveUsuario, 1201, True, UsuarioActual.CveUsuario) Then - ' If ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) Then - ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados.FiltraParametros("Nombre <> 'Admin' AND CveUsuario <> " & UsuarioActual.CveUsuario) - ' End If - - ' TxtNombrePortal.Text = "" - ' TxtCorreo.Text = "" - ' Alert("Usuario Creado.
    El usuario accesará con la contraseña '" & ContraseñaPredeterminada & "'") - ' ObjUsuario.Commit() - ' Else - ' ObjUsuario.RollBack() - ' End If - ' Else - ' ObjUsuario.RollBack() - ' Alert("No se ha podido registrar al nuevo Usuario, Verifique si el Usuario ya está registrado") - ' End If - - ' ObjUsuario.Dispose() - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - + + 'Private Sub CargaUsuariosPortal() + ' Dim ObjUsrs As New ClsSisUsuarios() + ' If ObjUsrs.GetUsuariosPortal(-1, -1, CveProveedor) Then + ' Dim dtUsr As DataTable = ObjUsrs.DtResultados + ' 'Dim dr As DataRow = dtUsr.FiltroPrimero(String.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)) + ' 'If dr IsNot Nothing Then + + ' ' If True Then TabHistorial.Visible = True 'dr("Permiso1").ToString = "True" + ' ' If True Then TabCxP.Visible = True + ' ' If True Then TabAnticipos.Visible = True + ' ' If True Then TabBancos.Visible = True + ' ' If True Then TabSistema.Visible = True + + ' 'End If + + ' 'dtUsr = dtUsr '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) + + ' ViewState("OrdenUsuarios") = "" + ' GvUsuariosPortal.DataSource = dtUsr + ' ViewState("DTUsuariosProveedor") = dtUsr + ' Else + ' GvUsuariosPortal.DataSource = Nothing + ' ViewState("DTUsuariosProveedor") = Nothing + ' End If + ' ObjUsrs.Dispose() + ' GvUsuariosPortal.DataBind() + 'End Sub + + + 'Private Sub CargaGridUsuarios(Orden As String) + ' If CType(ViewState("DTUsuariosProveedor"), DataTable).Rows.Count > 0 Then + ' If Orden <> String.Empty Then + ' Dim DV As New DataView(CType(ViewState("DTUsuariosProveedor"), DataTable), "", Orden, DataViewRowState.CurrentRows) + ' GvUsuariosPortal.DataSource = DV.ToTable() '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) + ' DV.Dispose() + ' Else + ' GvUsuariosPortal.DataSource = CType(ViewState("DTUsuariosProveedor"), DataTable) '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) + ' End If + ' End If + ' GvUsuariosPortal.DataBind() + ' UPPUsuarios.Update() + 'End Sub + + ''ajustar el tamaño de las celdas de la GvUsuarios Portal + 'Protected Sub GvUsuariosPortal_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvUsuariosPortal.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + + ' 'El usuario Admin no se puede editar ni eliminar + ' If e.Row.DataKey("Nombre") = "Admin" Then + ' e.Row.FCLinkButton("imgE").Visible = False + ' e.Row.FCLinkButton("imgD").Visible = False + ' e.Row.FCLinkButton("imgC").Visible = False + ' End If + + ' If e.Row.RowIndex = 0 Then + ' '' e.Row.Cells(0).Width = Unit.Pixel(120) + ' 'e.Row.Cells(0).Width = Unit.Pixel(120) + ' 'e.Row.Cells(1).Width = Unit.Pixel(150) + ' 'e.Row.Cells(2).Width = Unit.Pixel(55) + ' 'e.Row.Cells(3).Width = Unit.Pixel(55) + ' 'e.Row.Cells(4).Width = Unit.Pixel(55) + ' 'e.Row.Cells(5).Width = Unit.Pixel(55) + ' 'e.Row.Cells(6).Width = Unit.Pixel(55) + ' 'e.Row.Cells(7).Width = Unit.Pixel(55) + + ' 'e.Row.Cells(8).Width = Unit.Pixel(75) + ' 'e.Row.Cells(9).Width = Unit.Pixel(100) + ' 'e.Row.Cells(10).Width = Unit.Pixel(150) + ' End If + ' End If + 'End Sub + + ''Editar usuarios + 'Protected Sub GvUsuariosPortal_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles GvUsuariosPortal.RowEditing + ' GvUsuariosPortal.EditIndex = e.NewEditIndex + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + + 'Protected Sub GvUsuariosPortal_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs) Handles GvUsuariosPortal.RowUpdating + ' Dim ObjUsuario As New ClsSisUsuarios + ' Dim Nombre, Correo As String + ' Dim Estatus As Boolean + ' Dim gvr As GridViewRow = GvUsuariosPortal.Rows(e.RowIndex) + + ' 'Usuario = gvr.FCLiteral("LtlUUsuario").Text.Trim + ' Nombre = gvr.FCTextBox("TxtUsuarioPortalEdit").Text.Trim + ' Correo = gvr.FCTextBox("TxtCorreoEdit").Text.Trim + ' Estatus = gvr.FCCheckBox("ChkEstatus").Checked + + ' Dim CveUsuarioPortal As Integer = gvr.DataKey("CveUsuario").ToEntero + ' Dim pCveProveedor As Integer = gvr.DataKey("CveProveedor").ToEntero + + ' If ObjUsuario.UpdateUsuarioPortal(Correo, Nombre, Correo, Estatus, "-1", -1, CveProveedor, CveUsuarioPortal, UsuarioActual.CveUsuario) Then + ' GvUsuariosPortal.EditIndex = -1 + ' ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) + ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados + ' End If + ' ObjUsuario.Dispose() + + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + + 'End Sub + + ''Cancelar Edición + 'Protected Sub GvUsuariosPortal_RowCancelingEdit(ByVal sender As Object, ByVal e As GridViewCancelEditEventArgs) Handles GvUsuariosPortal.RowCancelingEdit + ' GvUsuariosPortal.EditIndex = -1 + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + + ''Restablecer contraseña + 'Protected Sub GvUsuariosPortal_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvUsuariosPortal.RowCommand + + ' If e.CommandName = "RestablecerContraseña" Then + ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero + ' Dim Usuario As New ClsSisUsuarios + ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then + ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") + + ' If Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, CType(dr("Estatus"), Boolean), ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then + ' GvUsuariosPortal.EditIndex = -1 + ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) + ' Alert("Contraseña Restablecida.
    La nueva contraseña es: """ & ContraseñaPredeterminada & "") + ' End If + ' End If + ' Usuario.Dispose() + ' End If + + ' If e.CommandName = "ReenviarCorreo" Then + ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero + ' Dim Usuario As New ClsSisUsuarios + ' Usuario.IniciaTransacSQL() + ' Dim TieneError = False + + ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then + ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") + + ' 'ACTUALIZA USUARIO, CONTRASEÑA Y ESTATUS + ' If Not Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, True, ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then + ' TieneError = True + ' Alert("Ocurrió un error al actualizar el usuario. Por favor vuelva a intentar.", TipoMensaje.MsgError) + ' End If + + ' 'MANDA CORREO ACTIVACION + ' If Not TieneError Then + ' Dim ObjParametro As SisParametro = GlobalDTParametros(SisParametros.URL) + ' Dim Liga As String = ObjParametro.Cadena1 & "LogIn.aspx" + ' Dim LigaActivar = Liga & "?p=" & Encripta("CveU=" & cveUsuarioPortal & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks & "&CveE=" & UsuarioActual.CveEmpresa) + + ' Dim ObjMail As New ClsSisMail() + + ' If dr("Correo").ToString <> "" Then + ' Dim Correos As String() = dr("Correo").ToString.Split(New Char() {";"c}) + ' Dim Texto = "" + ' For Each Correo As String In Correos + ' Texto = String.Format("Direccion de Acceso: Portal del Proveedor
    Usuario: {2}
    Haga click para activar su cuenta Activar", Liga, CveProveedor, dr("Usuario").ToString, LigaActivar) + ' 'If Not ObjMail.MandaCorreo(EmpresaNotificaciones, Correo, "Activación de cuenta", "", "", {""}, Texto) Then + ' If Not ObjMail.SendMail(EmpresaNotificaciones, Correo, "Activación de cuenta", Texto) Then + ' Alert("Error al mandar el correo. Por favor vuelva a intentar", TipoMensaje.MsgError) + ' TieneError = True + ' Exit For + ' End If + ' Next + + ' Else + ' Alert("No se ha registrado ningún correo al usuario.", TipoMensaje.MsgAdvertencia) + ' TieneError = True + ' End If + ' End If + + ' If Not TieneError Then + ' Usuario.Commit() + ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados + ' Alert(String.Format("Se envio correo al usuario y se restablecio contraseña .
    La nueva contraseña es: ""{0}""", ContraseñaPredeterminada), TipoMensaje.MsgInformacion) + ' Else + ' Usuario.RollBack() + ' End If + + ' End If + ' Usuario.Dispose() + ' End If + + 'End Sub + + ''Eliminar Usuarios + 'Protected Sub GvUsuariosPortal_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GvUsuariosPortal.RowDeleting + ' Dim Usuario As New ClsSisUsuarios + ' If Usuario.RemoveUsuarioPortal(GvUsuariosPortal.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then + ' GvUsuariosPortal.EditIndex = -1 + ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados + ' End If + ' Usuario.Dispose() + ' Alert("Usuario Eliminado") + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + + ''Agregar Usuario + 'Protected Sub LnkAgregarUsuario_Click(sender As Object, e As EventArgs) Handles LnkAgregarUsuario.Click + ' Dim ObjUsuario As New ClsSisUsuarios + ' Dim CvePlataforma As Integer = 7 + + ' ObjUsuario.IniciaTransacSQL() + + ' Dim CveUsuario As Integer = ObjUsuario.AddUsuarioPortal(TxtCorreo.Text.Trim, ContraseñaPredeterminadaEncriptada, TxtNombrePortal.Text.Trim, TxtCorreo.Text.Trim, -1, CveProveedor, CvePlataforma, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + ' If CveUsuario > 0 Then + ' If ObjUsuario.UpdateUsuariosModulos(CveUsuario, 1201, True, UsuarioActual.CveUsuario) Then + ' If ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) Then + ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados.FiltraParametros("Nombre <> 'Admin' AND CveUsuario <> " & UsuarioActual.CveUsuario) + ' End If + + ' TxtNombrePortal.Text = "" + ' TxtCorreo.Text = "" + ' Alert("Usuario Creado.
    El usuario accesará con la contraseña '" & ContraseñaPredeterminada & "'") + ' ObjUsuario.Commit() + ' Else + ' ObjUsuario.RollBack() + ' End If + ' Else + ' ObjUsuario.RollBack() + ' Alert("No se ha podido registrar al nuevo Usuario, Verifique si el Usuario ya está registrado") + ' End If + + ' ObjUsuario.Dispose() + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + #End Region - - + + #Region "O R D E N A M I E N T O" - 'Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs) - ' Dim Orden As String = "" - ' Dim Campo As String = "" - ' Dim Literal As Literal = Nothing - ' Const OrdenInicial As String = "" - ' Dim Arg(2) As String - - ' Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c) - ' Campo = Arg(0) - ' Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal) - - ' If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then - ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo) - ' Literal.Text = String.Format("") - ' Else - ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo) - ' Literal.Text = String.Format("") - ' End If - ' Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString - ' ViewState("Orden") = Orden - ' CargaGridUsuarios(Orden) - 'End Sub - + 'Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs) + ' Dim Orden As String = "" + ' Dim Campo As String = "" + ' Dim Literal As Literal = Nothing + ' Const OrdenInicial As String = "" + ' Dim Arg(2) As String + + ' Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c) + ' Campo = Arg(0) + ' Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal) + + ' If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then + ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo) + ' Literal.Text = String.Format("") + ' Else + ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo) + ' Literal.Text = String.Format("") + ' End If + ' Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString + ' ViewState("Orden") = Orden + ' CargaGridUsuarios(Orden) + 'End Sub + #End Region - - + + #Region " BANCOS" Protected Sub BtnExcelGvBancosCuentas_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteGvBancosCuentas("EXCEL") @@ -898,12 +1039,12 @@ Partial Class Portal_PortalProveedor End If ObjMovtos.Dispose() Return retorno - End Function + End Function #End Region - - + + #Region "Crédito por Aplicar Impresión" - + Protected Sub BtnExcelCredito_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimeReporteNTPorAplicar("EXCEL") If retorno IsNot Nothing Then @@ -1019,14 +1160,14 @@ Partial Class Portal_PortalProveedor Return retorno - End Function - - + End Function + + #End Region - - + + #Region "Historial de Ventas IMPRESION" - + Protected Sub BtnExcelVentas_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteVentas("EXCEL") If retorno IsNot Nothing Then @@ -1086,11 +1227,11 @@ Partial Class Portal_PortalProveedor End If ObjProveedores.Dispose() Return retorno - End Function - + End Function + #End Region - - + + #Region "CxP Pagadas IMPRESION" Protected Sub BtnExcelPagadas_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteCxPPagadas("EXCEL") @@ -1149,13 +1290,13 @@ Partial Class Portal_PortalProveedor End If ObjMovtos.Dispose() Return retorno - End Function - + End Function + #End Region - - + + #Region "CxCActivas IMPRESION" - + Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteCxCHistorial("EXCEL") If retorno IsNot Nothing Then @@ -1217,11 +1358,11 @@ Partial Class Portal_PortalProveedor End If ObjMovtos.Dispose() Return retorno - End Function + End Function #End Region - + #Region "TAB CONTRASENIA" - + Protected Sub BtnGuardarContraseña_Click(sender As Object, e As EventArgs) Handles BtnGuardarContraseña.Click If Decripta(UsuarioActual.Contraseña) = TxtContraseniaActual.Text Then @@ -1244,7 +1385,429 @@ Partial Class Portal_PortalProveedor Alert("La Contraseña Actual es incorrecta.", TipoMensaje.MsgAdvertencia) End If - End Sub + End Sub #End Region + + +#Region "AUDITORIA" + + Property DTDocumentacion As DataTable + Get + If ViewState("DTDocumentacion") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTDocumentacion"), DataTable) + End If + End Get + Set(value As DataTable) + + End Set + + End Property + + Private Sub CargaDocumentacion() + Dim ObjEDoc As New ClsEdocumentacion + + 'If objRH.DocumentacionElectronicaGet(-1, -1, CveProveedor, UsuarioActual.Empresa.CveEmpresa, -1, -1, 3) Then + + If ObjEDoc.DocumentacionElectronicaAuditoriaGet(CveProveedor, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, 3, -1) Then + + + DTDocumentacion = ObjEDoc.DtResultados + GvDocumentos.DataSource = ObjEDoc.DtResultados + Else + DTDocumentacion = Nothing + GvDocumentos.DataSource = Nothing + End If + + ObjEDoc.Dispose() + GvDocumentos.DataBind() + UPGvDocumentos.Update() + + End Sub + + + + Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + ' Dim chkEstatus As CheckBox + CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero + CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero + Documentacion = GvRow.DataKey("Documentacion") + AdjuntoDocumentacion = GvRow.DataKey("Adjunto") + + + '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 + + + + Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound + + + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString + + Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim ImgUpload As LinkButton = e.Row.FCLinkButton("ImgUpload") + 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 CveDocumentacionElectronica As String = e.Row.DataKey("CveDocumentacionElectronica") + + Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido")) + + 'Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus") + Dim separado As Char() = ".".ToCharArray + Dim array() As String = Adjunto.Split(separado) + Dim extencion As String = "" + + Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString.ToEntero + Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False) + Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False) + + txtFechaLimite.Visible = If(AplicaDiasLimite, True, False) + txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False) + + + 'If AplicaFechaVencimiento And e.Row.DataKey("DiasVigencia").ToString.ToEntero > 0 Then + ' txtFechaVigencia.Enabled = False + 'End If + + If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + If DateTime.Today > e.Row.DBCampo("FechaVigencia").ToString.ToDateTime Then + txtFechaVigencia.ForeColor = Drawing.Color.Red + End If + End If + + + If array.Length > 0 Then + extencion = array(array.Length - 1) + End If + + If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(3) Then + ' chkEstatus.Checked = True + ImgUpload.Visible = False + Else + 'chkEstatus.Checked = False + End If + + txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString.ToDate.ToString("dd/MM/yyyy") + + If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + End If + + Dim scripMascara = "$('#" & txtFechaLimite.ClientID & "').mask('00/00/0000');$('#" & txtFechaVigencia.ClientID & "').mask('00/00/0000');" + RegistraScript(scripMascara, "scriptMascara") + + If Adjunto.Trim.Length > 0 Then + + Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Edoc/Proveedor/" & CveProveedor & "/" & Adjunto + Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Edoc/Proveedor/" & CveProveedor & "/" & Adjunto + + If File.Exists(linkDescargaArchivo) Then + ImgDownLoad.Visible = True + + If extencion.Length > 0 Then + ImgDownLoad.Text = String.Format(" ", linkDescarga, CveDocumentacionElectronica & "." & extencion) + Else + ImgDownLoad.Text = String.Format(" ", linkDescarga, CveDocumentacionElectronica) + End If + Else + ImgDownLoad.Visible = False + End If + + Else + ImgDownLoad.Visible = False + End If + + If requerido Then + ImgRequired.Text = " " + End If + + 'chkEstatus.Checked = ImgDownLoad.Visible + + End If + End Sub + + + Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click + + Dim FileExtension As String = "-1" + Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos + Dim Filename As String = "" + Dim ErrorProceso As Boolean = False + + If AplicaFechaVencimiento And DiasVigencia > 0 Then + FechaVigencia = DateTime.Today.AddDays(DiasVigencia) + End If + + For Each fileItem As Archivo In Filesgral + + 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()) + + + + + 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 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") + + + 'Dim FileExtension As String = "-1" + 'Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos + 'Dim Filename As String = "" + + 'If AplicaFechaVencimiento And DiasVigencia > 0 Then + ' FechaVigencia = DateTime.Today.AddDays(DiasVigencia) + 'End If + + 'For Each fileItem As Archivo In Filesgral + + ' 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()) + + ' Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & Documentacion & "." & FileExtension + ' Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion + + ' 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) + + + ' Dim objEdoc As New ClsEdocumentacion + + ' If CveDocumentacionElectronica = -1 Then + ' If objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) > 0 Then + + ' End If + ' Else + ' If objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then + + ' End If + ' End If + + ' objEdoc.Dispose() + + ' 'GuardarDocumentos(CveDocumentacion) + ' CargaDocumentacion() + + ' TxtFileDocumentacion.Text = "" + ' UPModalUploadDoc.Update() + + + ' Alert("Archivo cargado correctamente.") + ' Catch ex As Exception + ' OnError("Error al cargar archivo", ex) + ' End Try + + 'Next + + 'RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3") + + End Sub + + Private Sub GuardarDocumentos(Optional _CveDocumentacionExcluir As Integer = -1) + + Dim hasError As Boolean = True + Dim objDocumentos As New ClsEdocumentacion + + For Each dRow As GridViewRow In GvDocumentos.Rows + + Dim _CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToString.ToEntero + Dim _Adjunto As String = dRow.DataKey("Adjunto") + Dim _CveDocumentacionElectronica As Integer = dRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero + Dim _txtObservaciones As TextBox = dRow.FCTextBox("TxtObservaciones") + Dim _TxtFechaLimite As TextBox = dRow.FCTextBox("TxtFechaLimite") + Dim _TxtFechaVigencia As TextBox = dRow.FCTextBox("TxtFechaVigencia") + + Dim _FechaVigencia As Date + Dim _FechaLimite As Date + + Dim chkEstatus As CheckBox = dRow.FCCheckBox("chkEstatus") + Dim _estatus As Integer + + If chkEstatus.Checked Then + _estatus = 1 + Else + _estatus = 0 + End If + + Dim DiasLimite As Integer = dRow.DataKey("DiasLimite").ToString.ToEntero + Dim AplicaDiasLimite As Boolean = If(dRow.DataKey("AplicaDiasLimite").ToString = "1", True, False) + Dim AplicaFechaVencimiento As Boolean = If(dRow.DataKey("AplicaFechaVencimiento").ToString = "1", True, False) + + If _TxtFechaVigencia.Text.Length = 10 Then + _FechaVigencia = _TxtFechaVigencia.Text.ToDate + Else + _FechaVigencia = Nothing + End If + + If Not AplicaDiasLimite Then + _FechaLimite = MinFecha + Else + _FechaLimite = _TxtFechaLimite.Text.ToDate + End If + + If Not AplicaFechaVencimiento Then + _FechaVigencia = MinFecha + End If + + If Not _CveDocumentacionExcluir = _CveDocumentacion Then + Try + If _CveDocumentacionElectronica = -1 Then + + If objDocumentos.DocumentacionElectronicaAdd(_CveDocumentacion, -1, -1, CveProveedor, -1, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) > 0 Then + Else + hasError = True + Exit For + End If + + Else + If objDocumentos.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, -1, -1, CveProveedor, -1, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) Then + Else + hasError = True + Exit For + End If + End If + + + hasError = False + Catch ex As Exception + hasError = True + Exit For + End Try + End If + Next + + CargaDocumentacion() + objDocumentos.Dispose() + End Sub + +#End Region + + End Class \ No newline at end of file diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index 594ad76f0..d60fe016f 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -2918,7 +2918,7 @@
    - +<%-- --%> <%----%> <%----%> @@ -3019,7 +3019,8 @@ //SI ES MOTOBATERIA if (CveClasificacion = "20517") { - regex = "[*]|" + regex = "[1X]|" + //regex = "[*]|" //SI ES OPTIMA } else if (CveClasificacion = "20511") { regex = "[1X]|" @@ -3064,15 +3065,25 @@ let clasificaciones = ["20517", "20511"] //SI ES MOTOBATERIA - if (clasificaciones.includes(CveClasificacion)) { - var re = new RegExp("^[*]|[A-L][0-9][1-9A-Z][A-HJ-M]$"); - arguments.IsValid = re.test(parseInt(arguments.Value)); + if (CveClasificacion = "20517") { + var re = new RegExp("^[X]|[x]|[A-L][0-9][1-9A-Z][A-HJ-M]$"); + arguments.IsValid = re.test(arguments.Value); return; } else { var re = new RegExp("^[A-L][0-9][1-9A-Z][A-HJ-M]$"); arguments.IsValid = re.test(arguments.Value); return; } + //if (clasificaciones.includes(CveClasificacion)) { + // //var re = new RegExp("^[*]|[A-L][0-9][1-9A-Z][A-HJ-M]$"); + // var re = new RegExp("^[X]|[A-L][0-9][1-9A-Z][A-HJ-M]$"); + // arguments.IsValid = re.test(parseInt(arguments.Value)); + // return; + //} else { + // var re = new RegExp("^[A-L][0-9][1-9A-Z][A-HJ-M]$"); + // arguments.IsValid = re.test(arguments.Value); + // return; + //} } function CalculaMesesUso() { diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 1074c19d1..be489e888 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -1579,161 +1579,165 @@ Partial Class PV End Sub Private Sub CargaCliente(CveCliente As Integer, Optional Estatus As Integer = 1) - Dim ObjCliente As New ClsClientes() + Try + If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, Estatus, TipoCliente:=-1) Then + If ObjCliente.DtResultados.Rows.Count > 0 Then + TxtCodigo.Text = ObjCliente.Codigo - If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, Estatus, TipoCliente:=-1) Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - TxtCodigo.Text = ObjCliente.Codigo - - LblCliente.Text = String.Format("{1}", CveCliente, ObjCliente.Nombre) - ViewState("NombreCliente") = ObjCliente.Nombre - LtlCliente.Text = ObjCliente.Nombre - ChkEnviarFactura.Checked = ObjCliente.EnviarFactura - ViewState("Mail") = If(DdlTipoComprobante.SelectedValue = "Cot", ObjCliente.MailCotizacion, ObjCliente.Mail) - ViewState("MailCC") = ObjCliente.NotificarA - LblDireccion.Text = ObjCliente.Direccion - LblColonia.Text = ObjCliente.Colonia - LblCiudad.Text = ObjCliente.Ciudad - LblEstado.Text = ObjCliente.Estado - LblCP.Text = ObjCliente.CP - LblRFC.Text = ObjCliente.RFC - LblTelefono.Text = ObjCliente.Telefono - LblRetIVA.Text = ObjCliente.RetIVA.ToString.FormatoNumero(5) - LblRetISR.Text = ObjCliente.RetISR.ToString.FormatoNumero(5) - ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100 - ViewState("ClienteRetISR") = ObjCliente.RetISR / 100 - ViewState("RetIVAFletes") = ObjCliente.RetieneIVAFletes - If ObjCliente.RetieneIVAFletes Then - TrRetIVA.Style.Add("display", "") - UsuarioActual.Empresa.MostrarRetIVA = True - End If - - ViewState("Vendedor") = ObjCliente.Vendedor - ViewState("CtaContable") = ObjCliente.CuentaContable - ViewState("IdCtaContClientes") = ObjCliente.IdCtaContClientes - ViewState("IdCtaContMonedaExtranjera") = ObjCliente.IdCtaContMonedaExtranjera - ViewState("IdCtaContComplementaria") = ObjCliente.IdCtaContComplementaria - ViewState("IdCtaContAnticipos") = ObjCliente.IdCtaContAnticipos - ViewState("IdCtaContRetIVA") = ObjCliente.IdCtaContRetIVA - ViewState("IdCtaContRetISR") = ObjCliente.IdCtaContRetISR - ViewState("CodCliente") = ObjCliente.Codigo - ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS - - If (Boolean.Parse(ObjCliente.DtResultados(0)("EsDistribuidor").ToString)) Then - TrEsDistribuidor.Visible = True - LbVendedor.Text = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Vendedor", $"CveVendedor = {ObjCliente.Vendedor}") - Else - TrEsDistribuidor.Visible = False - End If - - ViewState("CliNoExt") = ObjCliente.NoExt - ViewState("CliNoInt") = ObjCliente.NoInt - ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim) - ViewState("CliPais") = ObjCliente.Pais - - 'ViewState("NumCtaPago") = ObjCliente.NumCtaPago - EnviarCorreoCliente = ObjCliente.EnviarFactura - ChkEnviarFactura.Visible = True - ChkEnviarFactura.Checked = EnviarCorreoCliente - LblEnviarMail.Visible = True - - Dim dr As DataRow = Nothing - dr = GlobalDTSubProyectos(-1).FiltroPrimero("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) - If dr IsNot Nothing Then - ViewState("MatCalle") = dr("Calle") - ViewState("MatNoExt") = dr("NoExt") - ViewState("MatNoInt") = dr("NoInt") - ViewState("MatColonia") = dr("Colonia") - ViewState("MatLocalidad") = dr("Localidad") - ViewState("MatMunicipio") = dr("Municipio") - ViewState("MatEstado") = dr("Estado") - ViewState("MatPais") = dr("Pais") - ViewState("MatCP") = dr("CP") - End If - - If CveVenta <= 0 Then - CveMetodoPagoCliente = ObjCliente.DtResultados.Rows(0)("CveMetodoPago").ToString.ToEntero - DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI.ToString) - DdlMetodoPago.SelectedValueExist(ObjCliente.CveMetodoPago.ToString) - DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33.ToString) - 'DdlMetodoPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveMetodoPago33").ToString) - DdlMetodoPago33_SelectedIndexChanged(DdlMetodoPago33, EventArgs.Empty) - - DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33.ToString) - 'DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString) - DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString) - End If - TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString - - - If ObjCliente.DtResultados(0)("CveVendedor").ToString.ToEntero > 0 Then - DdlVendedor.SelectedValueExist(ObjCliente.DtResultados(0)("CveVendedor").ToString.ToEntero) - End If - - If DdlVendedor.SelectedValue.ToEntero > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then - DdlVendedor.Enabled = False - End If - - EstatusCliente = ObjCliente.Estatus - - If Not EstatusCliente Then - BtnEmitirImprimir.Enabled = False - Alert("El Cliente seleccionado no esta activo", TipoMensaje.MsgAdvertencia) - Else - BtnEmitirImprimir.Enabled = True - End If - - UpFacturar.Update() - - If UsuarioActual.Empresa.UsaInventarios Then - RblTipo.Items.Remove(RblTipo.Items.FindByValue("1")) - RblTipo.Items.Remove(RblTipo.Items.FindByValue("2")) - End If - UpnTools.Update() - - - If Not CveVenta > 0 Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - If UsuarioActual.TienePermisoProceso(152) Then - DdlSubProyectoDatos.SelectedValueExist(UsuarioActual.CveSubProyecto) - DdlSubProyectoDatos.Enabled = False - Else - DdlSubProyectoDatos.SelectedValueExist(ObjCliente.CveSubProyecto) - End If - 'RECARGA LOS VALORES DE LA SUCURSAL - CambiaSucursal() - UpParametros.Update() + LblCliente.Text = String.Format("{1}", CveCliente, ObjCliente.Nombre) + ViewState("NombreCliente") = ObjCliente.Nombre + LtlCliente.Text = ObjCliente.Nombre + ChkEnviarFactura.Checked = ObjCliente.EnviarFactura + ViewState("Mail") = If(DdlTipoComprobante.SelectedValue = "Cot", ObjCliente.MailCotizacion, ObjCliente.Mail) + ViewState("MailCC") = ObjCliente.NotificarA + LblDireccion.Text = ObjCliente.Direccion + LblColonia.Text = ObjCliente.Colonia + LblCiudad.Text = ObjCliente.Ciudad + LblEstado.Text = ObjCliente.Estado + LblCP.Text = ObjCliente.CP + LblRFC.Text = ObjCliente.RFC + LblTelefono.Text = ObjCliente.Telefono + LblRetIVA.Text = ObjCliente.RetIVA.ToString.FormatoNumero(5) + LblRetISR.Text = ObjCliente.RetISR.ToString.FormatoNumero(5) + ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100 + ViewState("ClienteRetISR") = ObjCliente.RetISR / 100 + ViewState("RetIVAFletes") = ObjCliente.RetieneIVAFletes + If ObjCliente.RetieneIVAFletes Then + TrRetIVA.Style.Add("display", "") + UsuarioActual.Empresa.MostrarRetIVA = True End If - End If - If ObjCliente.GetSucursales(CveCliente) Then - DdlSucursalCliente.DataSource = ObjCliente.DtResultados - If ObjCliente.DtResultados.Rows.Count > 0 Then - trsucursalciente.Visible = True + ViewState("Vendedor") = ObjCliente.Vendedor + ViewState("CtaContable") = ObjCliente.CuentaContable + ViewState("IdCtaContClientes") = ObjCliente.IdCtaContClientes + ViewState("IdCtaContMonedaExtranjera") = ObjCliente.IdCtaContMonedaExtranjera + ViewState("IdCtaContComplementaria") = ObjCliente.IdCtaContComplementaria + ViewState("IdCtaContAnticipos") = ObjCliente.IdCtaContAnticipos + ViewState("IdCtaContRetIVA") = ObjCliente.IdCtaContRetIVA + ViewState("IdCtaContRetISR") = ObjCliente.IdCtaContRetISR + ViewState("CodCliente") = ObjCliente.Codigo + ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS + + If (Boolean.Parse(ObjCliente.DtResultados(0)("EsDistribuidor").ToString)) Then + TrEsDistribuidor.Visible = True + If Not String.IsNullOrEmpty(ObjCliente.Vendedor) Then + LbVendedor.Text = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Vendedor", $"CveVendedor = {ObjCliente.Vendedor}") + End If + Else + TrEsDistribuidor.Visible = False + End If + + ViewState("CliNoExt") = ObjCliente.NoExt + ViewState("CliNoInt") = ObjCliente.NoInt + ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim) + ViewState("CliPais") = ObjCliente.Pais + + 'ViewState("NumCtaPago") = ObjCliente.NumCtaPago + EnviarCorreoCliente = ObjCliente.EnviarFactura + ChkEnviarFactura.Visible = True + ChkEnviarFactura.Checked = EnviarCorreoCliente + LblEnviarMail.Visible = True + + Dim dr As DataRow = Nothing + dr = GlobalDTSubProyectos(-1).FiltroPrimero("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) + If dr IsNot Nothing Then + ViewState("MatCalle") = dr("Calle") + ViewState("MatNoExt") = dr("NoExt") + ViewState("MatNoInt") = dr("NoInt") + ViewState("MatColonia") = dr("Colonia") + ViewState("MatLocalidad") = dr("Localidad") + ViewState("MatMunicipio") = dr("Municipio") + ViewState("MatEstado") = dr("Estado") + ViewState("MatPais") = dr("Pais") + ViewState("MatCP") = dr("CP") + End If + + If CveVenta <= 0 Then + CveMetodoPagoCliente = ObjCliente.DtResultados.Rows(0)("CveMetodoPago").ToString.ToEntero + DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI.ToString) + DdlMetodoPago.SelectedValueExist(ObjCliente.CveMetodoPago.ToString) + DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33.ToString) + 'DdlMetodoPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveMetodoPago33").ToString) + DdlMetodoPago33_SelectedIndexChanged(DdlMetodoPago33, EventArgs.Empty) + + DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33.ToString) + 'DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString) + DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString) + End If + TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString + + + If ObjCliente.DtResultados(0)("CveVendedor").ToString.ToEntero > 0 Then + DdlVendedor.SelectedValueExist(ObjCliente.DtResultados(0)("CveVendedor").ToString.ToEntero) + End If + + If DdlVendedor.SelectedValue.ToEntero > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then + DdlVendedor.Enabled = False + End If + + EstatusCliente = ObjCliente.Estatus + + If Not EstatusCliente Then + BtnEmitirImprimir.Enabled = False + Alert("El Cliente seleccionado no esta activo", TipoMensaje.MsgAdvertencia) + Else + BtnEmitirImprimir.Enabled = True + End If + + UpFacturar.Update() + + If UsuarioActual.Empresa.UsaInventarios Then + RblTipo.Items.Remove(RblTipo.Items.FindByValue("1")) + RblTipo.Items.Remove(RblTipo.Items.FindByValue("2")) + End If + UpnTools.Update() + + + If Not CveVenta > 0 Then + If ObjCliente.DtResultados.Rows.Count > 0 Then + If UsuarioActual.TienePermisoProceso(152) Then + DdlSubProyectoDatos.SelectedValueExist(UsuarioActual.CveSubProyecto) + DdlSubProyectoDatos.Enabled = False + Else + DdlSubProyectoDatos.SelectedValueExist(ObjCliente.CveSubProyecto) + End If + 'RECARGA LOS VALORES DE LA SUCURSAL + CambiaSucursal() + UpParametros.Update() + End If + End If + + If ObjCliente.GetSucursales(CveCliente) Then + DdlSucursalCliente.DataSource = ObjCliente.DtResultados + If ObjCliente.DtResultados.Rows.Count > 0 Then + trsucursalciente.Visible = True + Else + trsucursalciente.Visible = False + End If Else trsucursalciente.Visible = False + DdlSucursalCliente.DataSource = Nothing End If + DdlSucursalCliente.DataBind() + + + LbAgregar.Enabled = True + UpEstatus.Update() + UpPS.Update() + UpParametros.Update() + UPCondicionesPago.Update() + UpComplementos.Update() + + CargarAlmacenes() + CargaFacturasAjuste() Else - trsucursalciente.Visible = False - DdlSucursalCliente.DataSource = Nothing + Alert("El cliente solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgError) End If - DdlSucursalCliente.DataBind() - - - LbAgregar.Enabled = True - UpEstatus.Update() - UpPS.Update() - UpParametros.Update() - UPCondicionesPago.Update() - UpComplementos.Update() - - CargarAlmacenes() - CargaFacturasAjuste() - Else - Alert("El cliente solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgError) End If - End If + Catch ex As Exception + OnError("Ocurrió un error al asignar el cliente", ex) + End Try ObjCliente.Dispose() UPCondicionesPago.Update() End Sub @@ -2879,6 +2883,15 @@ Partial Class PV End If End If + 'Descuento por clasificación + If drPS("CveClasificacion").ToString.ToEntero.Contiene(20516, 20515) Then + Dim clasificacionesDescuentos As New Dictionary(Of Integer, Double) From { + {20516, 0.23}, 'Descuento para lubricantes LTH + {20515, 0.24} 'Descuento para filtros LTH + } + TxtDescuento.Text = (PrecioSugerido * clasificacionesDescuentos(drPS("CveClasificacion").ToString.ToEntero)).ToString("F2") + End If + If ChkAjuste.Checked Then CalculaMesesUso() UpAjuste.Update() @@ -5086,7 +5099,7 @@ Partial Class PV Dim ObjGral As New ClsGenerales If ObjGral.BCIUsadoGet(UsuarioActual.CveEmpresa) Then - e.Row.FCDropDownList("DdlBCIUsado").DataSource = ObjGral.DtResultados + e.Row.FCDropDownList("DdlBCIUsado").DataSource = ObjGral.DtResultados.FiltraParametros(String.Format("CveTamaño = {0}", e.Row.DataKey("CveTamaño"))) End If 'DdlBCIUsado.Items.Insert(0, New ListItem("Seleccione", "-1")) 'DdlBCIUsado.SelectedValueExist(-1) @@ -5500,7 +5513,14 @@ Partial Class PV Dim ObjAcumuladores As New ClsAcumuladores If ObjAcumuladores.GetNuevoConsecutivoFolio(DdlFolioGarantia.SelectedValue.ToEntero) Then Dim resultado As Integer = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo").ToEntero - TxtConsecutivoAjuste.Text = resultado.ToString + If ObjAcumuladores.FoliosGarantiaGet(DdlFolioGarantia.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + Dim Limite As Integer = If(ObjAcumuladores.DtResultados.FiltroPrimeroValor("Limite") IsNot Nothing, ObjAcumuladores.DtResultados.FiltroPrimeroValor("Limite").ToEntero, 0) 'ObjAcumuladores.DtResultados.FiltroPrimeroValor("Limite").ToEntero + If resultado < Limite Or Limite = 0 Then + TxtConsecutivoAjuste.Text = resultado.ToString + Else + Alert("limite de folios alcanzado") + End If + End If UpAjuste.Update() End If ObjAcumuladores.Dispose() diff --git a/Ventas/RepComisiones.aspx b/Ventas/RepComisiones.aspx index 293384f61..bedffe731 100644 --- a/Ventas/RepComisiones.aspx +++ b/Ventas/RepComisiones.aspx @@ -107,19 +107,23 @@ - <%----%> - <%----%> - + - <%-- - --%> - - - + + + + + + + + + + <%----%> + diff --git a/Ventas/RepIngresos.aspx b/Ventas/RepIngresos.aspx index d6951430c..bf0475e42 100644 --- a/Ventas/RepIngresos.aspx +++ b/Ventas/RepIngresos.aspx @@ -1,182 +1,214 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIngresos.aspx.vb" Inherits="Ventas_RepIngresos" %> - - - - - - - - Reporte de Ingresos - - - - - - -
  • - PDF -
  • -
  • - Excel -
  • -
    - - - - -
    -
    - - - - - - -
    -
    -
    - - - "> - - -
    -
    -
    -
    - -
    -
    -
    - - - - -
    - - -
    -
    - -
    -
    -
    - - - - -
    - - -
    -
    - -
    -
    - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIngresos.aspx.vb" Inherits="Ventas_RepIngresos" %> + + + + + + + + Reporte de Ingresos + + + + + + +
  • + PDF +
  • +
  • + Excel +
  • +
    + + + + +
    +
    + + + + + + +
    +
    +
    + + + "> + + +
    +
    +
    +
    + +
    +
    +
    + + + + +
    + + +
    +
    + +
    +
    +
    + + + + +
    + + +
    +
    + +
    + +
    + + + + + + + + + + + + <%-- + + + + + + --%> + +
    +
    + +
    +
    + <%-- - - - - - -
    -
    - -
    -
    - - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - - - +
    --%> + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + diff --git a/Ventas/RepIngresos.aspx.vb b/Ventas/RepIngresos.aspx.vb index 295e5b6b9..57d099dd5 100644 --- a/Ventas/RepIngresos.aspx.vb +++ b/Ventas/RepIngresos.aspx.vb @@ -83,8 +83,14 @@ Partial Class Ventas_RepIngresos End Sub Protected Sub CargaRepIngresos(Optional tipoReporte As Integer = -1) - Dim ObjRepI As New ClsVentas() - ObjRepI.RepIngresos(UsuarioActual.CveEmpresa, If(RsFechaI = "-1", MinFecha, RsFechaI.ToDate), If(RsFechaF = "-1", MaxFecha, RsFechaF.ToDate), TipoDoc, DdlSubProyecto.SelectedValue.ToEntero) + Dim ObjRepI As New ClsVentas() + + Dim Cves_Subprotectos As String = If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM) + Dim TiposDoc As String = If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM) + + + + ObjRepI.RepIngresos(UsuarioActual.CveEmpresa, If(RsFechaI = "-1", MinFecha, RsFechaI.ToDate), If(RsFechaF = "-1", MaxFecha, RsFechaF.ToDate), TiposDoc, Cves_Subprotectos) GVRepIngresos.DataSource = ObjRepI.DtResultados DtDatos = ObjRepI.DtResultados ObjRepI.Dispose() diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 0847b5a8f..0c7e15e77 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -352,6 +352,9 @@
  • Imprimir Formato Cicovisa
  • +
  • + Imprimir Formato Radio Movil DIPSA +
  • Enviar Póliza Virtual
  • @@ -364,6 +367,7 @@ + <%-- --%> <%-- --%> @@ -6515,14 +6519,26 @@ } function LimitaSaldoRNCChk(TxtImporte, Saldo) { var Importe = 0; - if (TxtImporte.value != '') { - Importe = parseFloat(TxtImporte.value); + + if (TxtImporte.value.includes('.')) { + return; + } + if (TxtImporte.value.includes(',')) { + return; } - if (Importe > Saldo) { - TxtImporte.value = FormatoNumero(Saldo, 2); - } else { - TxtImporte.value = FormatoNumero(Importe, 2);; + var regex = new RegExp("^[-+]?[0-9]+\.[0-9]+$"); + + if (regex.test(TxtImporte.value)) { + if (TxtImporte.value != '') { + Importe = parseFloat(TxtImporte.value); + } + + if (Importe > Saldo) { + TxtImporte.value = FormatoNumero(Saldo, 2); + } else { + TxtImporte.value = FormatoNumero(Importe, 2);; + } } } diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 0060cf170..8916f282a 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2056,6 +2056,10 @@ Partial Class Ventas If UsuarioActual.CveEmpresa = 72 And CveCliente = 70381 And DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") Then LnkImprimirFormatoCicovisa.Visible = True End If + 'HABILITA IMPRESION DE FORMATO TELCEL + If UsuarioActual.CveEmpresa = 72 And CveCliente = 70869 And DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") Then + LnkImprimirFormatoTelcel.Visible = True + End If If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then DivDevAlm.Visible = True @@ -5820,9 +5824,9 @@ Partial Class Ventas Dim objPS As New ClsProductosServicios If objPS.GetPSSucursalesALL(CvePS, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero) Then PrecioMinimo = objPS.DtResultados.FiltroPrimeroValor("PrecioMinimo", "").ToDecimal - 'If PrecioMinimo > 0 Then - ' Costo = PrecioMinimo - 'End If + If PrecioMinimo > 0 Then + Costo = PrecioMinimo + End If End If objPS.Dispose() @@ -6771,19 +6775,25 @@ Partial Class Ventas TieneAnticipo = True CveAnticipoPadre = row2.DataKey("CveVenta").ToEntero - ObjFactura.CveVentaRelacion = CveAnticipoPadre 'relaciona al anticipo CveAnticipo = CveAnticipoPadre - ObjFactura.ImporteRelacion = row2.FCTextBox($"TxtAnticipo{actualindex}").Text.ToDecimal - FolioFiscalRelacionado = row2.DataKey("FolioFiscal") - ObjFactura.CveVentaPadre = row2.DataKey("CveVenta").ToEntero + 'CUANDO ES REFACTURACION DEBE RELACIONAR CON LA FACTURA REFACTURADA + If NuevaFactura <> 1 Then + ObjFactura.CveVentaRelacion = CveAnticipoPadre 'relaciona al anticipo + ObjFactura.ImporteRelacion = row2.FCTextBox($"TxtAnticipo{actualindex}").Text.ToDecimal + FolioFiscalRelacionado = row2.DataKey("FolioFiscal") + ObjFactura.CveVentaPadre = row2.DataKey("CveVenta").ToEntero + Else + ObjFactura.CveVentaRelacion = CveDevolucion + End If End If actualindex = actualindex + 1 Next End If + Dim EsNCAmortizacion As Boolean = False - If DdlTipoComprobante.SelectedValue = "Egs" AndAlso ChkAplicaNCAnticipo.Checked Then + If ObjFactura.TipoDocto = "Egs" AndAlso ChkAplicaNCAnticipo.Checked Then EsNCAmortizacion = True End If @@ -6847,7 +6857,14 @@ Partial Class Ventas ' cambiar la condicion para saber si hay seleccionado If (TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2") OrElse NCDescuento Then Try - CreaObjetosVentaAmortizacion(ObjVentas, FolioFiscalRelacionado, CveAnticipoPadre, NCDescuento:=NCDescuento) + Dim CveVentaRelacionada As Integer = -1 + If NuevaFactura = 1 Then + CveVentaRelacionada = ObjFactura.CveVenta + Else + CveVentaRelacionada = CveAnticipoPadre + End If + + CreaObjetosVentaAmortizacion(ObjVentas, FolioFiscalRelacionado, CveVentaRelacionada, NCDescuento:=NCDescuento) If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, ObjFacturaDevolucion, ObjBancos, Nothing, Nothing, NCDescuento:=NCDescuento) Then Obj2.Add(ObjFacturaDevolucion) @@ -6873,7 +6890,7 @@ Partial Class Ventas If ErrorList.Count = 0 Then If ObjFactura.CveVenta > 0 And CveAlmacenExistenciasContrato > 0 And DdlTipoComprobante.SelectedValue = "Ing" Then - If Not RegistraAlmacenConsignacionVenta(ObjInventario, ObjFactura) Then + If Not RegistraAlmacenConsignacionVenta(ObjInventario, ObjConta, ObjFactura, ObjContPaq) Then ErrorList.Add("Ocurrió un error al registrar los movimientos de almacén del contrato de consignación") End If End If @@ -7431,8 +7448,8 @@ Partial Class Ventas For Each gvr As GridViewRow In GvImpuestosLocales2.Rows If gvr.RowType = DataControlRowType.DataRow Then Dim Orden As Integer = 80 - If gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble > 0 Then - DR("ImpuestoLocal") = gvr.DataKey("ImpuestoLocal").ToString : DR("Importe") = gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble : DR("Orden") = Orden : DR("Porcentaje") = gvr.DataKey("Porcentaje").ToString : DR("TipoImpuesto") = gvr.DataKey("TipoImpuesto").ToString : DR("IdCtaContable") = gvr.DataKey("IdCtaContable").ToString.ToEntero : TmpDTImpuestos.Rows.Add(DR) + If gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal > 0 Then + DR("ImpuestoLocal") = gvr.DataKey("ImpuestoLocal").ToString : DR("Importe") = gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal.RoundSQL(2) : DR("Orden") = Orden : DR("Porcentaje") = gvr.DataKey("Porcentaje").ToString : DR("TipoImpuesto") = gvr.DataKey("TipoImpuesto").ToString : DR("IdCtaContable") = gvr.DataKey("IdCtaContable").ToString.ToEntero : TmpDTImpuestos.Rows.Add(DR) DR = TmpDTImpuestos.NewRow() Orden = Orden + 1 End If @@ -7524,13 +7541,16 @@ Partial Class Ventas End If End If - If DtVentasNC Is Nothing Then InicializaDTVentasNC() - Dim Drt = DtVentasNC.NewRow - Drt("CveVenta") = ObjFactura.CveVenta - Drt("Importe") = 0 - Drt("FolioFiscal") = ObjFactura.FolioFiscal - DtVentasNC.Rows.Add(Drt) - DtVentasNC.AcceptChanges() + 'SI NO ES REFACTURACION + If NuevaFactura <> 1 Then + If DtVentasNC Is Nothing Then InicializaDTVentasNC() + Dim Drt = DtVentasNC.NewRow + Drt("CveVenta") = ObjFactura.CveVenta + Drt("Importe") = 0 + Drt("FolioFiscal") = ObjFactura.FolioFiscal + DtVentasNC.Rows.Add(Drt) + DtVentasNC.AcceptChanges() + End If End Sub @@ -7648,7 +7668,14 @@ Partial Class Ventas factura.RetIVA = TotalRetIVA factura.RetISR = TotalRetISR factura.Total = Total - factura.CveVentaPadre = CveVentaP + + 'SI ES REFACTURACION DEBE RELACIONAR CON LA VENTA NUEVA + If NuevaFactura = 1 Then + factura.CveVentaPadre = ObjFactura.CveVenta + Else + factura.CveVentaPadre = CveVentaP + End If + If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then DtVentasNC.Rows(0)("Importe") = Total @@ -8243,7 +8270,12 @@ Partial Class Ventas For Each DrImpuestosLocales As DataRow In TmpDTImpuestos.FiltraParametros("TipoImpuesto = 1").Rows If DrImpuestosLocales("Importe").ToString.ToDecimal > 0 Then - Dim ret As New CFDIRetencionesLocales With {.TasaRetencion = DrImpuestosLocales("Porcentaje").ToString.ToDecimal, .ImpuestoLocalRetenido = DrImpuestosLocales("ImpuestoLocal").ToString, .Importe = DrImpuestosLocales("Importe").ToString.ToDecimal(If(ObjFactura.ConvertirPesos, ObjFactura.TipoCambio, 1))} + Dim ret As New CFDIRetencionesLocales With + { + .TasaRetencion = DrImpuestosLocales("Porcentaje").ToString.ToDecimal, + .ImpuestoLocalRetenido = DrImpuestosLocales("ImpuestoLocal").ToString, + .Importe = DrImpuestosLocales("Importe").ToString.ToDecimal(If(ObjFactura.ConvertirPesos, ObjFactura.TipoCambio, 1)).RoundSQL(2) + } ObjFactura.Timbre.RetencionesLocales.Add(ret) End If Next @@ -11501,8 +11533,8 @@ Partial Class Ventas HdnTieneAnticiposVinculados.Value = "0" Dim ObjMovtos As New ClsMovimientos() - If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, DdlMoneda.SelectedValue.ToEntero) Then - GVAnticipos.DataSource = ObjMovtos.DtResultados.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, "AND Tipo = 'Ant'", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}") + If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente) Then + GVAnticipos.DataSource = ObjMovtos.DtResultados.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant'{If(DdlTipoComprobante.SelectedValue = "Ing", $" AND CveMoneda ={DdlMoneda.SelectedValue.ToEntero()}", "")} ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}") If ObjMovtos.DtResultados.SUM("Saldo", "Saldo > 0 AND SaldoSubtotal > 0 AND Tipo = 'Ant'") > 0 Then HdnTieneAnticipos.Value = "1" End If @@ -14597,6 +14629,7 @@ Partial Class Ventas TmpDT.Columns.Add("CveConcepto", GetType(Integer)) TmpDT.Columns.Add("EsOutSourcing", GetType(Boolean)) + TmpDT.Columns.Add("EsUsado", GetType(Boolean)) End Sub Private Sub CreaDTmpC() @@ -15684,7 +15717,8 @@ Partial Class Ventas Return Not OcurrioError End Function - Private Function GenerarMovimientoAlmacen(ByRef ObjInventario As ClsInventarios, DtMovDetalle As DataTable, CveAlmacen As Integer, ConceptoEntrada As Integer, CveMoneda As Integer, CveVenta As Integer, Optional MovimientoPrePoliza As Boolean = False, Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1, Optional AplicaMovimientoDetalleEntrada As Boolean = False) As Integer + Private Function GenerarMovimientoAlmacen(ByRef ObjInventario As ClsInventarios, DtMovDetalle As DataTable, CveAlmacen As Integer, ConceptoEntrada As Integer, CveMoneda As Integer, CveVenta As Integer, Optional MovimientoPrePoliza As Boolean = False, + Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1, Optional AplicaMovimientoDetalleEntrada As Boolean = False, Optional ObjContPaq As ClsContPAQi = Nothing) As Integer Dim OcurrioError As Boolean = False Dim ContadorMovtosDetalles = 0 @@ -15753,6 +15787,7 @@ Partial Class Ventas 'Agregamos las PrePolizas If Not OcurrioError Then If MovimientoPrePoliza AndAlso CveMovimientoInventario > 0 Then + 'OcurrioError = Not GeneraPrePolizaMovimientoAlmacen(ObjInventario, ObjConta, ObjContPaq, ObjFactura, ObjFactura.CvePrePoliza, CveMovimientoInventario, CveAlmacen) If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then Dim DtCostos = ObjInventario.DtResultados.Copy Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}) @@ -15820,6 +15855,99 @@ Partial Class Ventas 'Return Not OcurrioError End Function + Private Function GeneraPrePolizaMovimientoAlmacen(ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, ByRef ObjContPaq As ClsContPAQi, ObjFactura As Modelos.Factura, CvePrePoliza As Integer, CveMovimientoInventario As Integer, CveAlmacen As Integer) As Boolean + Dim OcurrioError As Boolean = False + Dim GenerarPrePolizaNueva As Boolean = False + Try + Dim DtCostos As DataTable = Nothing + Dim DtCostosDistinct As DataTable = Nothing + Dim IdCtaContable As Integer = 0 + Dim CveCuenta As Integer = 0 + Dim ValorInventario As Decimal = 0D + Dim TotalCostoAcumulado As Decimal = 0D + Dim Cont As Integer = 1 + + + If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then + DtCostos = ObjInventario.DtResultados.Copy + DtCostosDistinct = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}) + Else + OcurrioError = True + End If + + If OcurrioError Then + Return Not OcurrioError + End If + + Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL + + If CvePrePoliza <= 0 Then + GenerarPrePolizaNueva = True + CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GeneraMovimientoAlmacen", ObjFactura.CvePlantillaPoliza, TotalCosto, TotalCosto, ObjFactura.CveMoneda, ObjFactura.Fecha, If(CveEmpresaCRM > 0, LblEmpresaCRM.Text, ObjFactura.Cliente.Nombre), ObjFactura.CveUsuario, UsuarioActual.CveEmpresa) + + If CvePrePoliza <= 0 Then + OcurrioError = True + Return Not OcurrioError + End If + End If + + For Each RowInv As DataRow In DtCostosDistinct.Rows + ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL + IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero + CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero + TotalCostoAcumulado += ValorInventario + + 'cuando es el último movimiento y hay diferencias en los importes + If Cont = DtCostosDistinct.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then + ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado) + End If + + Try + 'If ValorInventario <> 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then + OcurrioError = True + Exit For + End If + 'End If + Catch ex As Exception + OcurrioError = True + Alert("Error inesperado (15147). Por favor comuniquese con atención SIG.", TipoMensaje.ToastError) + End Try + Cont += 1 + Next + + If Not OcurrioError Then + IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalCosto, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then + OcurrioError = True + End If + End If + + If GenerarPrePolizaNueva Then + Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" + + If UsuarioActual.CveEmpresa = 119 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "Egs", "Dev") Then + AutoConta = False + End If + + If AutoConta Then + If idCuentaContabilizacion > 0 Then + If Not ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then + Alert("Ocurrio un Error al contabilizar la prepoliza de almacen, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) + End If + Else + Alert(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia) + End If + End If + End If + + Catch ex As Exception + OnError("Ocurrió un error al generar la prepoliza del movimiento de almacen", ex) + OcurrioError = True + End Try + + Return Not OcurrioError + End Function Private Function GenerarMovimientoAlmacenVirtual(CveRemision As Integer, ByRef ObjInventario As ClsInventarios, ObjFactura As Modelos.Factura) As Boolean Dim OcurrioError As Boolean = False @@ -18411,8 +18539,8 @@ Partial Class Ventas 'Else 'End If - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs", "RNC") Then + Dim sb As New StringBuilder() sb.Append("La factura se encuentra en el siguiente estatus del SAT:
    ") @@ -18425,10 +18553,11 @@ Partial Class Ventas Exit Sub End If If String.IsNullOrEmpty(Vigencia.EsCancelable) Then - If Not String.IsNullOrEmpty(FolioFiscal) Then + If UsuarioActual.Empresa.FacturaProduccion AndAlso Not String.IsNullOrEmpty(FolioFiscal) Then Alert("No se pudo encontrar el estatus de la factura en el SAT.", TipoMensaje.MsgAdvertencia) Exit Sub End If + sb.Append("No encontrado
    ") Else sb.AppendFormat("{0}
    ", Vigencia.EsCancelable) @@ -19633,7 +19762,7 @@ Partial Class Ventas #End Region #Region " CONTRATO DE CONSIGNACION DE VENTA - SURTIDO DE ALMACÉN " - Function RegistraAlmacenConsignacionVenta(ByRef ObjInventario As ClsInventarios, factura As Modelos.Factura) As Boolean + Function RegistraAlmacenConsignacionVenta(ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, factura As Modelos.Factura, ObjContPaq As ClsContPAQi) As Boolean If Not (UsuarioActual.Empresa.UsaInventarios AndAlso CveAlmacenExistenciasContrato > 0) Then Return True End If @@ -19710,6 +19839,11 @@ Partial Class Ventas End If Next End If + + 'GENERAR PREPOLIZA + If Not GeneraPrePolizaMovimientoAlmacen(ObjInventario, ObjConta, ObjContPaq, ObjFactura, ObjFactura.CvePrePoliza, CveMovimientoEntradaGeneral, CveAlmacenOrigenContrato) Then + Return False + End If Else Return False End If @@ -21332,8 +21466,8 @@ Partial Class Ventas For Each Dr As DataRow In DtImpuestosLocal.Rows FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("CveSubProyecto")) - importePuTemp = (Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr) - TmpDT.SUM("Descuento", FiltroStr))).ToDecimal - Dr("ImporteTotal") = importePuTemp.RoundSQL() + importePuTemp = (Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr).ToDecimal() - TmpDT.SUM("Descuento", FiltroStr).ToDecimal())) + Dr("ImporteTotal") = importePuTemp.RoundSQL(2) Dr("ImporteIEPS") = (importePuTemp * Dr("PorcentajeIEPS").ToString().ToDecimal()).RoundSQL(2) @@ -21346,7 +21480,7 @@ Partial Class Ventas 'Dr("ImporteRetIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetIVA", FiltroStr), 2) 'Dr("ImporteRetISR") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetISR", FiltroStr), 2) 'Dr("ImporteIEPS") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIEPS", FiltroStr), 2) - Dr("ImportePU") = Dr("ImporteTotal").ToString.ToDecimal.RoundSQL(2) '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal) + Dr("ImportePU") = importePuTemp.RoundSQL(6) 'Dr("ImporteTotal").ToString.ToDecimal.RoundSQL(2) '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal) Next @@ -21636,7 +21770,7 @@ Partial Class Ventas Dim AplicaPUEditado As Boolean = UsuarioActual.TienePermisoProceso(253) - Dim DtUsados As DataTable = TmpDT.FiltraParametros("CveClasificacion = 20519") + Dim DtUsados As DataTable = TmpDT.FiltraParametros("EsUsado = True") TmpDT.Clear() For Each Gv As GridViewRow In GvAplicaDevolucion.Rows @@ -22102,6 +22236,47 @@ Partial Class Ventas ImprimirPDF("Empresas/Grales/Formatos/Cicovisa.rdlc", Dt, params, String.Format("Formato Cicovisa -{0}", Now.ToDateTime.ToShortDateString)) End If End Sub + + Protected Sub LnkImprimirFormatoTelcel_Click(sender As Object, e As EventArgs) + Dim ObjVentas As New ClsVentas + Dim ObjInventario As New ClsInventarios + Dim SerieFolio As String = "" + Dim PedidoContrato As String = "" + Dim EnvioContacto As String = "" + Dim EnvioDireccion As String = "" + Dim Guia As String = "" + If ObjInventario.GetPaqueteriaGuia(-1, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then + If ObjInventario.DtResultados.Rows.Count > 0 Then + Guia = ObjInventario.DtResultados.Rows(0)("Guia").ToString + End If + End If + If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then + If ObjVentas.DtResultados.Rows.Count > 0 Then + SerieFolio = ObjVentas.DtResultados.Rows(0)("SerieFolio").ToString + PedidoContrato = ObjVentas.DtResultados.Rows(0)("PedidoContrato").ToString + EnvioContacto = ObjVentas.DtResultados.Rows(0)("EnvioContacto").ToString + EnvioDireccion = $"{ObjVentas.DtResultados.Rows(0)("EnvioDireccion").ToString}, NO. EXT: {ObjVentas.DtResultados.Rows(0)("EnvioNoExt").ToString}, COLONIA: {ObjVentas.DtResultados.Rows(0)("EnvioColonia").ToString}, CP: {ObjVentas.DtResultados.Rows(0)("EnvioCP").ToString}" + End If + End If + Dim Dt As DataTable = Nothing + If ObjVentas.GetVentaDetalle(CveVenta) Then + Dt = ObjVentas.DtResultados + End If + ObjVentas.Dispose() + ObjInventario.Dispose() + If Dt.Rows.Count > 0 Then + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) + params.Add(New ReportParameter("EnvioContacto", EnvioContacto)) + params.Add(New ReportParameter("SerieFolio", SerieFolio)) + params.Add(New ReportParameter("PedidoContrato", PedidoContrato)) + params.Add(New ReportParameter("EnvioDireccion", EnvioDireccion)) + params.Add(New ReportParameter("Guia", Guia)) + ImprimirPDF("Empresas/Grales/Formatos/Telcel.rdlc", Dt, params, String.Format("Formato RADIO MOVIL DIPSA S.A DE C.V. -{0}", Now.ToDateTime.ToShortDateString)) + End If + End Sub #End Region #Region "REQUIERE OC" @@ -23958,9 +24133,11 @@ Partial Class Ventas Else Row("PorcentajeIVA") = DrPS("IVA") End If - Dim TotalCalculableImpuestos = (Row("Cantidad").ToString.ToDouble * Row("PU").ToString.ToDouble) - Row("Descuento").ToString.ToDouble + Dim TotalCalculableImpuestos As Decimal = (Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal) - Row("Descuento").ToString.ToDecimal + Dim TotalCalculableImpuestosIVA As Decimal = TotalCalculableImpuestos * (1 + Row("PorcentajeIEPS").ToString.ToDecimal) + Row("IVA") = Row("PorcentajeIVA").ToString.ToDouble - Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDouble * TotalCalculableImpuestos, NumeroDecimales) + Row("ImporteIVA") = (Row("PorcentajeIVA").ToString.ToDouble * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales) End If Else Row("IVA") = 0 diff --git a/vwd.webinfo b/vwd.webinfo index 8a63d860e..0770194b6 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -1,18 +1,24 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file