diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index 608f2bbdf..03cc2db05 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -376,8 +376,8 @@ Partial Class AF_AF InicializaValores() - CargaCombos() - + + If Request("CveActivoFijo") IsNot Nothing AndAlso IsNumeric(Request("CveActivoFijo")) AndAlso Request("CveActivoFijo").ToEntero > 0 Then ViewState("CveActivoFijo") = Request("CveActivoFijo") CargaDatos() @@ -396,7 +396,8 @@ Partial Class AF_AF HlEvento.Visible = True HlEvento.NavigateUrl = String.Format("/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveActivoFijo=" & CveActivoFijo & "&TB_iframe=true&height=370&width=600;") LtlTareaNueva.Text = String.Format(" Tarea", CveActivoFijo) - Else + Else + CargaCombos() ViewState("CveActivoFijo") = -1 diff --git a/AF/CatAF.aspx b/AF/CatAF.aspx index 7b11dbbb3..a957b310d 100644 --- a/AF/CatAF.aspx +++ b/AF/CatAF.aspx @@ -36,7 +36,54 @@ padding-right: 4px !important; padding-left: 4px !important; } + + img.cbp-img-ajustada { + max-width: 150px; + max-height: 150px; + height: auto; + width: auto; + object-fit: contain; + display: block; + cursor: pointer; +} + + @@ -158,10 +205,26 @@ -
- " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
+
+
+ + + Encontrados: + + +
+
+
+
+ " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
+
+
+ +
@@ -204,10 +267,10 @@ -
- Encontrados: -
- + + <%-- 0 --%> @@ -370,6 +433,45 @@ + + + <%-- 20 --%> + + + + +
+
+
+
+ +
+
+
+ <%----%> + + <%----%> + +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
@@ -436,30 +538,18 @@ - - - - - + + + + + + - + - - - - - - - + - - - - - - - @@ -496,13 +586,16 @@ - +
+ × + Vista ampliada +
- <%-- + <%-- --%> + + + + + + + + diff --git a/AF/CatAF.aspx.vb b/AF/CatAF.aspx.vb index 6feb748f4..e348643a4 100644 --- a/AF/CatAF.aspx.vb +++ b/AF/CatAF.aspx.vb @@ -4,6 +4,8 @@ Option Strict On Imports System.Data Imports Extensiones Imports Microsoft.Reporting.WebForms +Imports Telerik.Web.UI.Widgets +Imports ZXing Partial Class AF_CatAF Inherits ClsPaginas @@ -53,15 +55,24 @@ Partial Class AF_CatAF CargaCombos() CargaCaracteristicas() + If UsuarioActual.CveEmpresa = 13 Then + 'ChkUltimaImagen.Checked = True + ChkMarcaActivoFijo.Checked = True + ChkModeloActivoFijo.Checked = True + ChkNoSerie.Checked = True + ChkObservaciones.Checked = True + End If + If (Request("GPO") IsNot Nothing AndAlso Request("GPO").ToEntero() > 0) Then CargaParametrosInicial() Else - CargaDatos() + ' CargaDatos() End If CargaPersonalizacion() + End If End Sub @@ -304,7 +315,7 @@ Partial Class AF_CatAF If (GvDatos.Rows.Count > 0) Then GvDatos.UseAccessibleHeader = True GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader - RegistraScript("OrdenarGV();") + 'RegistraScript("OrdenarGV();") End If End Sub @@ -317,6 +328,7 @@ Partial Class AF_CatAF End If UpGV.Update() + UpTotalRegistros.Update() OrdenaDatos() End Sub @@ -340,6 +352,35 @@ Partial Class AF_CatAF 'e.Row.FCLiteral("LtlCodigo").Text = "" & e.Row.FCLiteral("LtlCodigo").Text & "" 'e.Row.FCLiteral("LtlDescripcion").Text = "" & e.Row.FCLiteral("LtlDescripcion").Text & "" End If + + 'Dim RutaUltimaImagen As String = e.Row.DataKey("RutaUltimaImagen") + + 'If RutaUltimaImagen.Length > 0 Then + ' Try + ' Dim rutaArchivo As System.IO.FileInfo = New IO.FileInfo($"{UsuarioActual.Empresa.Ruta}\{RutaUltimaImagen}") + ' If rutaArchivo.Exists Then + + ' 'Dim fullPath As String = System.IO.Path.Combine(basePath, System.IO.Path.GetFileName(fileName)) + ' Dim ImgUltimaImagen As Image = CType(e.Row.FindControl("ImgUltimaImagen"), Image) + ' ImgUltimaImagen.Visible = True + + ' Dim mime As String = "image/jpeg" ' valor por defecto + + ' Dim bytes As Byte() = System.IO.File.ReadAllBytes(rutaArchivo.FullName) + + ' ' (Opcional) Detectar MIME real + ' mime = MimeMapping.GetMimeMapping(rutaArchivo.FullName) + + ' Dim base64 As String = Convert.ToBase64String(bytes) + + ' ImgUltimaImagen.ImageUrl = String.Format("data:{0};base64,{1}", mime, base64) + + ' End If + ' Catch ex As Exception + + ' End Try + 'End If + End If End Sub @@ -516,9 +557,27 @@ Partial Class AF_CatAF If Archivo.Exists Then Ruta = UsuarioActual.Empresa.Ruta & "Formatos/CatAF.rdlc" + + If Not DtActivosFijos.Columns.Contains("UltimaImagenByte") Then + DtActivosFijos.Columns.Add("UltimaImagenByte", GetType(Byte())) + End If + + For Each dRow As DataRow In DtActivosFijos.Rows + Dim RutaUltimaImagen As String = dRow("RutaUltimaImagen").ToString() + Dim bytes As Byte() = Nothing + If RutaUltimaImagen.Length > 0 Then + Dim rutaArchivo As System.IO.FileInfo = New IO.FileInfo($"{UsuarioActual.Empresa.Ruta}\{RutaUltimaImagen}") + If rutaArchivo.Exists Then + bytes = System.IO.File.ReadAllBytes(rutaArchivo.FullName) + End If + End If + dRow("UltimaImagenByte") = bytes + Next + Else Ruta = "Empresas/Grales/Formatos/CatAF.rdlc" End If + ImprimirPDF(Ruta, DtActivosFijos, params, "CatalogoActivosFijos", Formato:=Formato) Else @@ -598,6 +657,8 @@ Partial Class AF_CatAF If ChkObservaciones.Checked Then ListPersonalizada.Add("Observaciones") + If ChkUltimaImagen.Checked Then ListPersonalizada.Add("UltimaImagen") + If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "CatAF.aspx", String.Join("|", ListPersonalizada)) Then 'Alert("Personalizacion guardada") @@ -638,6 +699,15 @@ Partial Class AF_CatAF 'ChkSubProyecto.Checked = False ChkNombreCliente.Checked = False ChkObservaciones.Checked = False + ChkUltimaImagen.Checked = False + + If UsuarioActual.CveEmpresa = 13 Then + 'ChkUltimaImagen.Checked = True + ChkMarcaActivoFijo.Checked = True + ChkModeloActivoFijo.Checked = True + ChkNoSerie.Checked = True + ChkObservaciones.Checked = True + End If Dim Personalizaciones As String() = strBasePersonalizacion.Split("|"c) @@ -703,6 +773,9 @@ Partial Class AF_CatAF Case "Observaciones" ChkObservaciones.Checked = True Exit Select + Case "UltimaImagen" + ChkUltimaImagen.Checked = True + Exit Select Case Else Exit Select End Select @@ -762,6 +835,7 @@ Partial Class AF_CatAF 'GvDatos.Columns(18).Visible = ChkSubProyecto.Checked GvDatos.Columns(18).Visible = ChkNombreCliente.Checked GvDatos.Columns(19).Visible = ChkObservaciones.Checked + GvDatos.Columns(20).Visible = ChkUltimaImagen.Checked diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 145843325..135d41b25 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -1593,7 +1593,14 @@ Public Class ClsBancos ' Me.OnError("Ocurrió un error al guardar los cambios en el Banco", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) ' End If Catch ex As Exception - OnError("Ocurrió un error al guardar los cambios en el Banco IE Conciliar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + + If ex.Message.Contains("Número: 2601;") Then + Alert("Ya existe un movimiento bancario con el mismo Folio: " & Folio & ".", TipoMensaje.MsgAdvertencia) + Me.OnError("Ocurrió un error al Guardar el Movimiento. Ya existe un movimiento bancario con el mismo Folio: " & Folio & ".", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Else + OnError("Ocurrió un error al guardar los cambios en el Banco IE Conciliar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + End Try Return Retorno diff --git a/App_Code/ClsCompProveedores.vb b/App_Code/ClsCompProveedores.vb index 3ffbe0066..2b3e7301e 100644 --- a/App_Code/ClsCompProveedores.vb +++ b/App_Code/ClsCompProveedores.vb @@ -66,6 +66,7 @@ Public Class ClsCompProveedores Public Property DIOTNacionalidad As String Public Property CveRegimenFiscal As Integer = -1 Public Property PorcentajeProntoPago As Decimal = 0D + Public Property AplicaProntoPago As Boolean = False Public Property CveTipoFechaVencimiento As Integer = 1 Public ReadOnly Property DtResultados() As DataTable @@ -303,6 +304,7 @@ Public Class ClsCompProveedores Me.DIOTNacionalidad = Data.Rows(0)("DIOTNacionalidad").ToString Me.CveRegimenFiscal = Data.Rows(0)("CveRegimenFiscal").ToString.ToEntero Me.PorcentajeProntoPago = Data.Rows(0)("PorcentajeProntoPago").ToString.ToDecimal + Me.AplicaProntoPago = Data.Rows(0)("AplicaProntoPago").ToString.ToBool Me.CveTipoFechaVencimiento = Data.Rows(0)("CveTipoFechaVencimiento").ToString.ToEntero End If @@ -321,7 +323,7 @@ Public Class ClsCompProveedores CveProveedorClasificacion As Integer, CveUsuarioResponsable As Integer, NotificarA As String, CorreoCobranza As String, FolioDuplicado As Boolean, CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoProveedor As Integer = 1, Optional CveMonedaPreferente As Integer = 1, Optional UsaLimiteCredito As Boolean = False, Optional DIOTCveTipoTercero As Integer = -1, Optional DIOTCveTipoOperacion As Integer = -1, Optional DIOTNumeroIDFiscal As String = "", Optional AplicarEvaluacion As Boolean = False, Optional FechaEvaluacion As String = "-1", Optional CicloEvaluacion As Integer = -1, Optional DIOTCvePais As Integer = -1, Optional CveUsuarioEvaluador As Integer = -1, Optional CP As Integer = 0, Optional DIOTNacionalidad As String = "", - Optional CveConfianzaProveedor As Integer = -1, Optional CveRegimenFiscal As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0) As Boolean + Optional CveConfianzaProveedor As Integer = -1, Optional CveRegimenFiscal As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0, Optional AplicaProntoPago As Boolean = False) As Boolean Dim Retorno As Boolean = False @@ -372,6 +374,7 @@ Public Class ClsCompProveedores .Add("@CveConfianzaProveedor", SqlDbType.Int).Value = CveConfianzaProveedor .Add("@CveRegimenFiscal", SqlDbType.TinyInt).Value = CveRegimenFiscal .Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago + .Add("@AplicaProntoPago", SqlDbType.Bit).Value = AplicaProntoPago .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With @@ -407,7 +410,7 @@ Public Class ClsCompProveedores CveProveedorClasificacion As Integer, CveUsuarioResponsable As Integer, Estatus As Boolean, NotificarA As String, CorreoCobranza As String, FolioDuplicado As Boolean, CveProveedor As Integer, Optional CveTipoProveedor As Integer = 1, Optional CveMonedaPreferente As Integer = 1, Optional UsaLimiteCredito As Boolean = False, Optional DIOTCveTipoTercero As Integer = -1, Optional DIOTCveTipoOperacion As Integer = -1, Optional DIOTNumeroIDFiscal As String = "", Optional CveUsuarioModifico As Integer = -1, Optional AplicarEvaluacion As Boolean = False, Optional FechaEvaluacion As String = "-1", Optional CicloEvaluacion As Integer = -1, Optional DIOTCvePais As Integer = -1, Optional CveUsuarioEvaluador As Integer = -1, Optional CP As Integer = 0, Optional DIOTNacionalidad As String = "", - Optional CveConfianzaProveedor As Integer = -1, Optional CveRegimenFiscal As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0) As Boolean + Optional CveConfianzaProveedor As Integer = -1, Optional CveRegimenFiscal As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0, Optional AplicaProntoPago As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_ProveedorUpdate") @@ -457,26 +460,10 @@ Public Class ClsCompProveedores .Add("@FechaEvaluacion", SqlDbType.VarChar).Value = FechaEvaluacion .Add("@CveUsuarioEvaluador", SqlDbType.Int).Value = CveUsuarioEvaluador - .Add("@CveConfianzaProveedor", SqlDbType.Int).Value = CveConfianzaProveedor .Add("@CveRegimenFiscal", SqlDbType.TinyInt).Value = CveRegimenFiscal .Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago - - ''Proveedores - '.Add("@IdCtaContProveedores", SqlDbType.Int).Value = IdCtaContProveedores - '.Add("@CtaContProveedores", SqlDbType.VarChar).Value = CtaContProveedores - '.Add("@IdCtaContExtranjera", SqlDbType.Int).Value = IdCtaContExtranjera - '.Add("@CtaContExtranjera", SqlDbType.VarChar).Value = CtaContExtranjera - '.Add("@IdCtaContComplementaria", SqlDbType.Int).Value = IdCtaContComplementaria - '.Add("@CtaContComplementaria", SqlDbType.VarChar).Value = CtaContComplementaria - - ''Anticipos - '.Add("@IdCtaContAnticipos", SqlDbType.Int).Value = IdCtaContAnticipos - '.Add("@CtaContAnticipos", SqlDbType.VarChar).Value = CtaContAnticipos - '.Add("@IdCtaContAnticiposExtranjera", SqlDbType.Int).Value = IdCtaContAnticiposExtranjera - '.Add("@CtaContAnticiposExtranjera", SqlDbType.VarChar).Value = CtaContAnticiposExtranjera - '.Add("@IdCtaContAnticiposComplementaria", SqlDbType.Int).Value = IdCtaContAnticiposComplementaria - '.Add("@CtaContAnticiposComplementaria", SqlDbType.VarChar).Value = CtaContAnticiposComplementaria + .Add("@AplicaProntoPago", SqlDbType.Bit).Value = AplicaProntoPago End With diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb index e905fcd03..438987e7e 100644 --- a/App_Code/ClsContPAQi.vb +++ b/App_Code/ClsContPAQi.vb @@ -776,18 +776,22 @@ Public Class ClsContPAQi StrSQL.Clear() StrSQL.Append(" BEGIN ") StrSQL.Append(" Declare @Tmp INT = 0, @IdPersona INT, @IdDatoExtra INT, ") - StrSQL.Append(" @Codigo VARCHAR(10) = '', @CodigoCuenta VARCHAR(20), @CodigoExtra VARCHAR(20)= ''; ") + StrSQL.Append(" @Codigo VARCHAR(10) = '', @CodigoPersona VARCHAR(10) = '', @CodigoCuenta VARCHAR(20), @CodigoExtra VARCHAR(20)= ''; ") StrSQL.Append(" SELECT @Tmp = MAX(Id) FROM Proveedores P WHERE P.RFC = @RFC; ") StrSQL.Append(" IF ISNULL(@Tmp,0) <= 0 ") StrSQL.Append(" BEGIN ") StrSQL.Append(" SELECT @Codigo = MAX(CAST(Codigo AS INT)) FROM Proveedores WHERE CAST(Codigo AS INT) < 9999; ") StrSQL.Append(" SET @Codigo = CONCAT(replicate(' ',6-Len((@Codigo + 1))),(@Codigo + 1)); ") + StrSQL.Append(" Select @CodigoCuenta = Codigo from Cuentas WHERE Id = @IdCuentaContable; ") StrSQL.Append(" SET @IdProveedor = dbo.FNC_GetCounter ('Id_Proveedor'); ") + StrSQL.Append(" SELECT @CodigoPersona = MAX(CAST(Codigo AS INT)) FROM Personas WHERE CAST(Codigo AS INT) < 9999; ") + StrSQL.Append(" SET @CodigoPersona = CONCAT(replicate(' ',6-Len((@CodigoPersona + 1))),(@CodigoPersona + 1)); ") + StrSQL.Append(" INSERT INTO Proveedores (Id,RowVersion,Codigo,Nombre, RFC,CURP,TipoOperacion,IdCuenta,TimeStamp,TasaIVA15,TasaIVA10,TasaIVA0,TasaIVAExento,TasaIVAOtra1,TasaIVAOtra2,TasaOtra1,TasaOtra2,TasaAsumida,RetencionIVA,RetencionISR,TipoTercero,IdFiscal,NomExtranjero,Pais,Nacionalidad,IdConceptoIETU,TasaIVA16,TasaIVA11,CodigoPersona, CodigoCuenta,EsParaAbonoCta,CodigoCtaComplementaria,CodigoPrepoliza,IdSegNeg,ClaveBanco,Sucursal,CuentaClabe,Referencia) ") - StrSQL.Append(" VALUES (@IdProveedor,555555,@Codigo,@Nombre,@RFC,@CURP,85,@IdCuentaContable,'',0,0,0,0,0,0,0,0,7,0,0,4,'','','','Mexicana',1,1,0, @Codigo, @CodigoCuenta,0,'','',0,'','','',''); ") + StrSQL.Append(" VALUES (@IdProveedor,555555,@Codigo,@Nombre,@RFC,@CURP,85,@IdCuentaContable,'',0,0,0,0,0,0,0,0,7,0,0,4,'','','','Mexicana',1,1,0, @CodigoPersona, @CodigoCuenta,0,'','',0,'','','',''); ") StrSQL.Append(" EXEC PA_UpdateId 'Id_Proveedor';") StrSQL.Append(" ") @@ -800,7 +804,7 @@ Public Class ClsContPAQi StrSQL.Append(" SET @IdPersona = dbo.FNC_GetCounter ('Id_Persona'); ") StrSQL.Append(" INSERT INTO Personas (Id,RowVersion,Codigo,Nombre,RFC,CURP,FechaRegistro,EsCliente,EsProveedor,EsEmpleado,EsAgente,EsPersona,EsBaja,Telefono1,Telefono2,Telefono3,Fax,eMail,PaginaWeb,IdDatoExtra,GenerarPolizaAuto,PosibilidadPago,SistOrig,CodigoAdminPAQ,EsResponsableGasto,CtaContableGasto,PagarDoctosAMismoRFC,GeneraContraCuentaDeudor,IdCategoria,IdSubCategoria) ") - StrSQL.Append(" VALUES (@IdPersona,555555, @Codigo,@Nombre,@RFC,@CURP,GETDATE(),0,1,0,0,0,0,'','','','','','',@IdDatoExtra,0,0,11,'',0,'',0,0,0,0); ") + StrSQL.Append(" VALUES (@IdPersona,555555, @CodigoPersona,@Nombre,@RFC,@CURP,GETDATE(),0,1,0,0,0,0,'','','','','','',@IdDatoExtra,0,0,11,'',0,'',0,0,0,0); ") StrSQL.Append(" EXEC PA_UpdateId 'Id_Persona';") StrSQL.Append(" ") diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 944f482ba..787cf4be5 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -5488,14 +5488,15 @@ Public Class ClsContabilidad End Function - Public Function GetGastosRepCC(FechaInicio As DateTime, FechaFin As DateTime, CveEmpresa As Integer) As Boolean + Public Function GetGastosRepCC(FechaInicio As DateTime, FechaFin As DateTime, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Conta_ReporteGastos") - With SqlAdapter.SelectCommand.Parameters .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index 373a3253f..cdc27bcdb 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -596,7 +596,7 @@ Public Class ClsMovimientos Public Function GetCxPEmpresa(CveProveedor As Integer, FechaVencimientoInicio As String, FechaVencimientoFin As String, CveSubProyecto As Integer, DiasVencidos As Integer, CveUsuarioRegistro As Integer, CveUsuarioProgramo As Integer, CveUsuarioResponsable As Integer, CveClasificacion As Integer, CveMoneda As Integer, CveTipoPagoProgramo As Integer, CveEstatusFactura As Integer, CveAplicaNC As Integer, CveEmpresa As Integer, Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional CodigoProgramacion As String = "-1", Optional CveTipoProveedor As Integer = 0, - Optional AgrupadoPorSubProyecto As Boolean = False, Optional VerEnPesos As Boolean = False) As Boolean + Optional AgrupadoPorSubProyecto As Boolean = False, Optional VerEnPesos As Boolean = False, Optional AplicaProntoPago As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_Proveedores") With SqlAdapter.SelectCommand.Parameters @@ -620,6 +620,7 @@ Public Class ClsMovimientos .Add("@CveTipoProveedor", SqlDbType.TinyInt).Value = CveTipoProveedor .Add("@AgrupadoPorSubProyecto", SqlDbType.Bit).Value = AgrupadoPorSubProyecto .Add("@VerEnPesos", SqlDbType.Bit).Value = VerEnPesos + .Add("@AplicaProntoPago", SqlDbType.Int).Value = AplicaProntoPago End With Try @@ -662,8 +663,6 @@ Public Class ClsMovimientos End With - - Try SqlAdapter.SelectCommand.CommandTimeout = 0 @@ -709,7 +708,8 @@ Public Class ClsMovimientos Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1, Optional CveTipoProveedor As Integer = -1, Optional Comprobaciones As Integer = -1, - Optional TipoDocto As String = "-1", Optional TipoAgrupacion As Integer = -1, Optional CveProyecto As Integer = -1) As Boolean + Optional TipoDocto As String = "-1", Optional TipoAgrupacion As Integer = -1, + Optional CveProyecto As Integer = -1, Optional AplicaProntoPago As Integer = -1) As Boolean Dim Retorno As Boolean = False If FechaCorte = Nothing Then FechaCorte = ClsPaginas.NowADS() @@ -739,8 +739,8 @@ Public Class ClsMovimientos .Add("@Comprobaciones", SqlDbType.Int).Value = Comprobaciones .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto .Add("@TipoAgrupacion", SqlDbType.Int).Value = TipoAgrupacion - .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto - + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto + .Add("@AplicaProntoPago", SqlDbType.Int).Value = AplicaProntoPago End With Try @@ -1338,7 +1338,8 @@ Public Class ClsMovimientos CveEstatusFactura As Integer, Fecha As String, Agrupador As Integer, Opcion As String, CveEmpresa As Integer, CveSucursal As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional FechaVI As String = "-1", Optional FechaVF As String = "1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1, Optional CveTipoProveedor As Integer = -1, - Optional Comprobaciones As Integer = -1, Optional AplicaNC As Integer = -1, Optional TipoDocto As String = "-1", Optional CveProyecto As Integer = -1) As Boolean + Optional Comprobaciones As Integer = -1, Optional AplicaNC As Integer = -1, Optional TipoDocto As String = "-1", + Optional CveProyecto As Integer = -1, Optional AplicaProntoPago As Integer = -1) As Boolean Dim Retorno As Boolean = False If FechaCorte = Nothing Then FechaCorte = ClsPaginas.NowADS() @@ -1373,7 +1374,8 @@ Public Class ClsMovimientos .Add("@Comprobaciones", SqlDbType.Int).Value = Comprobaciones .Add("@AplicaNC", SqlDbType.Int).Value = AplicaNC .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto - .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto + .Add("@AplicaProntoPago", SqlDbType.Int).Value = AplicaProntoPago End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 0bc7b8015..072a970f2 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -406,7 +406,7 @@ Public Class ClsPaginas End Property #Region "ordenes de producción" - Property GlobalDTOPEstatus(CveEmpresa As Integer, Optional Estatus As Integer = -1) As DataTable + Property GlobalDTOPEstatus(CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional CveTipoEstatus As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTOPEstatus-{CveEmpresa}" If HttpContext.Current.Application(AppNombre) Is Nothing Then @@ -417,6 +417,8 @@ Public Class ClsPaginas Dim filtros As New List(Of String) If Estatus <> -1 Then filtros.Add($"Estatus = {Estatus}") + If CveTipoEstatus <> -1 Then filtros.Add($"CveTipoEstatus = {CveTipoEstatus}") + If filtros.Count > 0 Then Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTOPEstatus = Dv.ToTable @@ -593,16 +595,16 @@ Public Class ClsPaginas Property GlobalDTDIOTTipoOperacion() As DataTable Get Dim AppNombre As String = "GlobalDTDIOTTipoOperacion" - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATDIOTTipoOperacion() Then Application(AppNombre) = ObjGrales.DtResultados + If ObjGrales.GetSATDIOTTipoOperacion() Then HttpContext.Current.Application(AppNombre) = ObjGrales.DtResultados ObjGrales.Dispose() End If - GlobalDTDIOTTipoOperacion = DirectCast(Application(AppNombre), DataTable) + GlobalDTDIOTTipoOperacion = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) Dim AppNombre As String = "GlobalDTDIOTTipoOperacion" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTGralPaises() As DataTable @@ -1020,7 +1022,7 @@ Public Class ClsPaginas For Each file As String In files Dim fi As IO.FileInfo = New IO.FileInfo(file) - If fi.LastAccessTime < DateTime.Now.AddMonths(-6) Then fi.Delete() + If fi.LastAccessTime - + - + - - - - - - - - - - + + + + + + + + + + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - + + + + + + + + + + - + - - - - - - - - - - - + + + + + + + + + + + - + - - - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + - + - - - + + + diff --git a/App_Code/DtDatos.xss b/App_Code/DtDatos.xss index 12eb8d1df..af01e0090 100644 --- a/App_Code/DtDatos.xss +++ b/App_Code/DtDatos.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + @@ -18,7 +18,7 @@ - + diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index e7aa74343..c7fe1ca9c 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -3619,22 +3619,10 @@ Namespace Modelos CveIEAnticipo = -1 CveSubProyectoContabilizar = CveSubProyectoVenta - Dim CveVenta As Integer = ObjFactura.CveVenta - Dim CveVentaAmortizacion As Integer = row2("CveVenta").ToString().ToEntero + Dim CveVenta As Integer = row2("CveVenta").ToString().ToEntero + Dim CveVentaAmortizacion As Integer = ObjFactura.CveVenta + If row2("CveIE").ToString().ToEntero > 0 Then CveIEAnticipo = row2("CveIE").ToString().ToEntero - 'FALTA LA MONEDA PAR ALA CUENTA .RMF Y MANDAR EL CVEIE - - '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 - - 'SI ES EGRESO Y TIENE ANTICIPOS VINCULADOS - If (ObjFactura.TipoDocto.Contiene("Egs") AndAlso row2("TipoDocto").ToString() = "Ant" AndAlso EsNCAmortizacion) Then - CveVenta = row2("CveVenta").ToString().ToEntero - CveVentaAmortizacion = ObjFactura.CveVenta - End If If importeMovimiento <> 0 Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, importeMovimiento, ConceptoContable, Referencia, Concepto, diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index 4fd113f60..6130f4ab2 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -125,11 +125,11 @@ Partial Class Bancos_PopIEVentas End Set End Property - Private Property SaldoVenta As Double + Private Property SaldoVenta As Decimal Get - Return ViewState("SaldoVenta").ToString.ToDouble + Return ViewState("SaldoVenta").ToString.ToDecimal End Get - Set(value As Double) + Set(value As Decimal) ViewState("SaldoVenta") = value End Set End Property @@ -543,27 +543,29 @@ Partial Class Bancos_PopIEVentas TxtImporte.Text = dr("Saldo").ToString.ToDouble.FormatoNumero FechaVenta = dr("Fecha").ToString.ToDate - SaldoVenta = dr("Saldo").ToString.ToDouble + SaldoVenta = dr("Saldo").ToString.ToDecimal - Me.CveCorte = CargaCorteCaja(pCveVenta, UsuarioActual) + 'si ya está pagada, bloquear. + If SaldoVenta <= 0 Then Validada = False - If RFCCliente.ToUpper <> "XAXX010101000" Then - Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, RFC:=RFCCliente.ToUpper).FiltroPrimeroValor("CveProveedor").ToEntero + If Validada Then + Me.CveCorte = CargaCorteCaja(pCveVenta, UsuarioActual) - If CveProveedor > 0 Then - Dim Mov As New ClsMovimientos - If Mov.GetCxPProveedor(CveProveedor, MinFecha.ToShortDateString, MaxFecha.ToShortDateString, -1, -1, -1, -1, -1, 1, -1, -1, "-1", "-1", "-1") Then - If Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio").Rows.Count > 0 Then - RBLContado.Items(4).Enabled = True + If RFCCliente.ToUpper <> "XAXX010101000" Then + Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, RFC:=RFCCliente.ToUpper).FiltroPrimeroValor("CveProveedor").ToEntero + + If CveProveedor > 0 Then + Dim Mov As New ClsMovimientos + If Mov.GetCxPProveedor(CveProveedor, MinFecha.ToShortDateString, MaxFecha.ToShortDateString, -1, -1, -1, -1, -1, 1, -1, -1, "-1", "-1", "-1") Then + If Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio").Rows.Count > 0 Then + RBLContado.Items(4).Enabled = True + End If End If + + Mov.Dispose() End If - - Mov.Dispose() End If - - End If - - If Not Validada Then + Else BtnGuardar.Visible = False End If End If diff --git a/Bancos/RepProveedoresPagos.aspx.vb b/Bancos/RepProveedoresPagos.aspx.vb index f6b4d7def..7711cb3a5 100644 --- a/Bancos/RepProveedoresPagos.aspx.vb +++ b/Bancos/RepProveedoresPagos.aspx.vb @@ -23,8 +23,6 @@ Partial Class Bancos_RepProveedoresPagos 'DdlUsuarioProgramo.DataBind() CargaUsuariosProgramaron() - - CargaDatos() If UsuarioActual.TienePermisoProceso(84) Then diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 889e34b70..bf2ccb6ec 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -5741,6 +5741,8 @@
+
+ + Cargar Plantilla + +
@@ -5830,6 +5837,10 @@ + + + +
+ <%--CARGA PRORRATEO PLANTILLA--%> + + + +
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 45306e38b..505f8942e 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -13,6 +13,8 @@ Imports MoreLinq Imports System.Data.SqlClient Imports ClsPaginas Imports Microsoft.Reporting.WebForms +Imports Microsoft.Owin.Security.Provider + Partial Class Compras_Compras Inherits ClsPaginas @@ -2970,11 +2972,11 @@ Partial Class Compras_Compras CvePrePoliza = dr("CvePrePoliza").ToString.ToEntero EstatusAlmacen = dr("EstatusAlmacen").ToString.ToEntero DdlTipoCompra.SelectedValueExist(dr("CveTipoCompra")) - If DdlTipoCompra.SelectedValue = "16" Then + TipoCompraOriginal = dr("CveTipoCompra").ToString.ToEntero + If TipoCompraOriginal = 16 Then DdlTipoCompra.Items.Add(New ListItem("Apoyo sin virtual", "16")) DdlTipoCompra.SelectedValue = dr("CveTipoCompra").ToString End If - TipoCompraOriginal = dr("CveTipoCompra").ToString.ToEntero CveTipoConcepto = dr("CveTipoConcepto").ToString.ToEntero ChkEsNoDeducible.Checked = dr("NoDeducible").ToString.ToEntero > 0 If ChkEsNoDeducible.Checked Then AplicarNoDeducible() @@ -4519,16 +4521,16 @@ Partial Class Compras_Compras Exit Sub End If - If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 AndAlso LblSaldoFactura.Text.ToDecimal > 0 Then + If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 AndAlso LblSaldoFactura.Text.ToDecimal > 0 And CveFactura <> 1187114 Then Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia) Exit Sub End If Dim CveSubProyectoPrincipal As Integer = AsignarSubProyectoPrincipal() - If Not CveSubProyectoPrincipal > 0 Then - Alert("Falta asignar Proyecto a la compra", TipoMensaje.MsgAdvertencia) - End If + 'If Not CveSubProyectoPrincipal > 0 Then + ' Alert("Falta asignar Proyecto a la compra", TipoMensaje.MsgAdvertencia) + 'End If If Not ValidaVinculacionNotaFactura() Then Alert("Se requiere que la nota este aplicada a las facturas", TipoMensaje.MsgAdvertencia) @@ -4868,13 +4870,13 @@ Partial Class Compras_Compras For Each Row As DataRow In TmpDT.Rows 'VALIDACION DE CENTRO DE COSTO - If UsuarioActual.Empresa.RequiereCentroCostos AndAlso Row("CveSubProyecto").ToString.ToEntero <= 0 Then - RequiereCentroCosto = True - UM.Dispose() - PSS.Dispose() - Alert("Falta asignar Proyecto a la compra", TipoMensaje.MsgAdvertencia) - Exit Sub - End If + 'If UsuarioActual.Empresa.RequiereCentroCostos AndAlso Row("CveSubProyecto").ToString.ToEntero <= 0 Then + ' RequiereCentroCosto = True + ' UM.Dispose() + ' PSS.Dispose() + ' Alert("Falta asignar Proyecto a la compra", TipoMensaje.MsgAdvertencia) + ' Exit Sub + 'End If 'REGISTRO LAS UNIDADES DE MEDIDA If Row("CveUM").ToString.ToEntero = 0 Then @@ -7967,11 +7969,19 @@ Partial Class Compras_Compras CvePreComprobacion = ObjConta.AddPrePolizas("Compras Comproba", 1, 0, 0, 1, TxtFecha.Text.ToDate, tConcepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If ObjCompras.AddComprobacion(DdlPersonalReembolso.SelectedValue.ToEntero, DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero, TxtNumeroReembolso.Text.Trim, CvePreComprobacion, UsuarioActual.CveEmpresa) > 0 Then - + Alert("Apertura de nueva comprobación.", TipoMensaje.ToastInformacion) End If Else 'si ya existe, obtenemos la prepóliza CvePreComprobacion = ObjCompras.DtResultados.FiltroPrimeroValor("CvePrePoliza").ToEntero + If ObjCompras.DtResultados.FiltroPrimeroValor("FolioPoliza").ToEntero > 0 Then + TieneError = True + ErrorPrepoliza = True + Alert($"La Comprobación con folio '{TxtNumeroReembolso.Text.Trim}' está previamente contabilizada. No se puede asociar al folio, verifique que sea el correcto", TipoMensaje.MsgError) + Else + Alert("Factura agregada a una comprobación ya creada.", TipoMensaje.ToastInformacion) + End If + End If ObjConta.PrePolizaUnificacion(CvePreComprobacion, CvePrePoliza) @@ -8020,66 +8030,66 @@ Partial Class Compras_Compras End If If Not ErrorPrepoliza AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=OpValidacion, AutoConta:=AutoConta) Then + TieneError = True + If ObjConta.ValorPolizaDescuadre > 0 Then + Alert($"{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia}", TipoMensaje.MsgError) + ErrorPrepolizaDescuadre = True + End If + End If + + If UsuarioActual.Empresa.Funcionalidad(574) = "1" AndAlso (ImporteRNC > 0 OrElse ImporteRNCProntoPago > 0) Then + + If ImporteRNC > 0 AndAlso Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraActual, ObjConta, CvePrePoliza, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate, $"Remisión Nota de Crédito {TxtDescripcion.Text}", ImporteRNC, DdlMoneda.SelectedValue.ToEntero, TxtTC.Text.ToDecimal, + TxtSerie.Text, TxtFolio.Text) Then TieneError = True - If ObjConta.ValorPolizaDescuadre > 0 Then - Alert($"{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia}", TipoMensaje.MsgError) - ErrorPrepolizaDescuadre = True - End If End If - If UsuarioActual.Empresa.Funcionalidad(574) = "1" AndAlso (ImporteRNC > 0 OrElse ImporteRNCProntoPago > 0) Then - - If ImporteRNC > 0 AndAlso Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraActual, ObjConta, CvePrePoliza, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate, $"Remisión Nota de Crédito {TxtDescripcion.Text}", ImporteRNC, DdlMoneda.SelectedValue.ToEntero, TxtTC.Text.ToDecimal, - TxtSerie.Text, TxtFolio.Text) Then - TieneError = True - End If - - If ImporteRNCProntoPago > 0 AndAlso Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraActual, ObjConta, CvePrePoliza, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate, $"Remisión Nota de Crédito {TxtDescripcion.Text}", ImporteRNCProntoPago, DdlMoneda.SelectedValue.ToEntero, TxtTC.Text.ToDecimal, - TxtSerie.Text, TxtFolio.Text, PrefijoSerie:="PP") Then - TieneError = True - End If - - End If - - If Not TieneError Then - ObjCompras.Commit() - If ObjContaAC IsNot Nothing Then ObjContaAC.Commit() - - Dim CveEvaluacionProveedor As Integer = -1 - - If Me.RequiereEvaluacion Then - Dim ObjPro As New ClsCompProveedores() - CveEvaluacionProveedor = ObjPro.AddEvaluacionProveedor(CveProveedor, CveCompra, NowADS(), "", Me.CveUsuarioEvaluador, "", "", UsuarioActual.CveEmpresa) - ObjPro.Dispose() - End If - - 'ENVIO DE CORREO NOTIFICACION A VENDEDORES DE OC - MandaCorreoOCVendedores(CveCompra) - If Not ErrorMovInv Then - For Each intMovimientoAlmacen As Integer In ListaMovimientosAlmacen - MandaCorreoOCVendedoresRecepcionAlmacen(CveCompra, intMovimientoAlmacen) - Next - End If - - If CveEvaluacionProveedor > 0 Then - Msg.Append("

El proveedor tiene evaluaciones pendientes
") - Msg.Append("¿Desea realizar una evaluación al proveedor?") - Msg.AppendFormat($"
Evaluar Proveedor.") - End If - - BtnGuardar.Enabled = False - UpFacturar.Update() - - Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar) - Else - ObjCompras.RollBack() - If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack() - Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError) + If ImporteRNCProntoPago > 0 AndAlso Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraActual, ObjConta, CvePrePoliza, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate, $"Remisión Nota de Crédito {TxtDescripcion.Text}", ImporteRNCProntoPago, DdlMoneda.SelectedValue.ToEntero, TxtTC.Text.ToDecimal, + TxtSerie.Text, TxtFolio.Text, PrefijoSerie:="PP") Then + TieneError = True End If End If + If Not TieneError Then + ObjCompras.Commit() + If ObjContaAC IsNot Nothing Then ObjContaAC.Commit() + + Dim CveEvaluacionProveedor As Integer = -1 + + If Me.RequiereEvaluacion Then + Dim ObjPro As New ClsCompProveedores() + CveEvaluacionProveedor = ObjPro.AddEvaluacionProveedor(CveProveedor, CveCompra, NowADS(), "", Me.CveUsuarioEvaluador, "", "", UsuarioActual.CveEmpresa) + ObjPro.Dispose() + End If + + 'ENVIO DE CORREO NOTIFICACION A VENDEDORES DE OC + MandaCorreoOCVendedores(CveCompra) + If Not ErrorMovInv Then + For Each intMovimientoAlmacen As Integer In ListaMovimientosAlmacen + MandaCorreoOCVendedoresRecepcionAlmacen(CveCompra, intMovimientoAlmacen) + Next + End If + + If CveEvaluacionProveedor > 0 Then + Msg.Append("

El proveedor tiene evaluaciones pendientes
") + Msg.Append("¿Desea realizar una evaluación al proveedor?") + Msg.AppendFormat($"
Evaluar Proveedor.") + End If + + BtnGuardar.Enabled = False + UpFacturar.Update() + + Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar) Else + ObjCompras.RollBack() + If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack() + Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError) + End If + + End If + + Else ObjCompras.RollBack() If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack() Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente..", TipoMensaje.MsgError) @@ -8194,7 +8204,6 @@ Partial Class Compras_Compras End If Next - If DTSubProyectoPrincipal.Rows.Count > 0 Then DTSubProyectoPrincipal = DTSubProyectoPrincipal.FiltraParametros("", "Total DESC ") CveSubProyectoPrincioal = DTSubProyectoPrincipal.FiltroPrimeroValor("CveSubProyecto").ToEntero @@ -22939,7 +22948,7 @@ Partial Class Compras_Compras End Sub - Private Sub AgregarProrrateoGasolina(CveSubProyecto As Integer, SubProyecto As String, CvePS As Integer, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String) + Private Sub AgregarProrrateoGasolina(CveSubProyecto As Integer, SubProyecto As String, CvePS As Integer, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, Optional PrecioProrrateo As Decimal = 0) Dim SubTotalOriginal As Decimal = TxtSubTotal.Text.ToDecimal Dim IVAOriginal As Decimal = TxtIVA.Text.ToDecimal @@ -22949,6 +22958,10 @@ Partial Class Compras_Compras Dim totalParcialDeseado As Decimal = TxtPrecioProrrateoGasolina.Text.ToDecimal + If PrecioProrrateo > 0 Then + totalParcialDeseado = PrecioProrrateo + End If + Dim PorcentajeCalculado As Decimal = totalParcialDeseado / TotalOriginal Dim subtotalParcial As Decimal = SubTotalOriginal * PorcentajeCalculado @@ -23063,15 +23076,180 @@ Partial Class Compras_Compras End If + End Sub + Protected Sub LnkProrrateoPlantilla_Click(sender As Object, e As EventArgs) + + If DdlPSProrrateoGasolina.SelectedValue.ToEntero > 0 And TxtTotal.Text.ToDecimal > 0 Then + TxtExcelProrrateo.Text = "[]" + UpDropZoneProrrateoPlantilla.Update() + RegistraScript("$('#DVModalProrrateoPlantilla').modal('show');") + Else + + If Not DdlPSProrrateoGasolina.SelectedValue.ToEntero > 0 Then + Alert("Debe seleccionar un producto.", TipoMensaje.MsgAdvertencia) + End If + + If Not TxtTotal.Text.ToDecimal > 0 Then + Alert("El total de la compra debe de ser mayor a 0.", TipoMensaje.MsgAdvertencia) + End If + + End If End Sub + Protected Sub LnkDescargaPlatillaProrrateo_Click(sender As Object, e As EventArgs) + + + Dim RutaPlantilla As String = "" + + RutaPlantilla = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\PlantillaProrrateo.xlsx" + + If Not (RutaPlantilla = "") Then + Dim Archivo As New IO.FileInfo(RutaPlantilla) + If Archivo.Exists Then + Response.Clear() + Response.ClearHeaders() + Response.ClearContent() + Response.AddHeader("Content-Disposition", "attachment; filename=" + Archivo.Name) + Response.AddHeader("Content-Length", Archivo.Length.ToString()) + Response.ContentType = "text/plain" + Response.Flush() + Response.TransmitFile(Archivo.FullName) + Response.End() + End If + End If + + End Sub + + Protected Sub BtnAddProrrateoPlantilla_Click(sender As Object, e As EventArgs) + + Dim ErrorPrceos As Boolean = False + + If TxtExcelProrrateo.getfiles().Archivos.Count > 0 Then + Dim file As Archivo = TxtExcelProrrateo.getfiles().Archivos(0) + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path + Try + If Not CargarPlantillaProrrateo(Directorio, file.filename) Then + ErrorPrceos = True + End If + Catch ex As Exception + OnError("Ocurrio un error al leer el archivo
" & ex.Message, ex) + End Try + + Else + Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) + ErrorPrceos = True + End If + + If Not ErrorPrceos Then + If Not ErrorPrceos Then + RegistraScript("$('#DVModalProrrateoPlantilla').modal('hide');") + End If + End If + + End Sub + + Private Function CargarPlantillaProrrateo(directorio As String, filename As String) As Boolean + + Dim DT As New DataTable + Dim ErrorProceso As Boolean = False + + + Try + DT = ReadExcelFile(directorio + filename, True) + Catch ex As Exception + ErrorProceso = True + OnError("Ocurrio un error al leer el archivo
" & ex.Message, ex) + End Try + + If Not ErrorProceso Then + + Dim ContadorRow As Integer = 1 + Dim SBErrores As New StringBuilder + + For Each row As DataRow In DT.Rows + + If row("SubProyecto").ToString.Length > 0 Then + + Dim CveSubProyecto As Integer = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $" SubProyecto = '{row("SubProyecto").ToString}' ").ToEntero + Dim Importe As Decimal = row("Importe").ToString.ToDecimal + + If Not CveSubProyecto > 0 Then + SBErrores.Append($"Fila: {ContadorRow} SubProyecto: '{row("SubProyecto").ToString}' no encontrado.
") + ErrorProceso = True + End If + + If Not Importe > 0 Then + SBErrores.Append($"Fila: {ContadorRow} Importe Invalido: { Importe } debe ser mayor a 0.
") + ErrorProceso = True + End If + + End If + + ContadorRow = ContadorRow + 1 + + Next + + If Not ErrorProceso Then + + DTProrrateoGasolina.Rows.Clear() + + Dim CvePs As Integer = DdlPSProrrateoGasolina.SelectedValue.ToEntero + + If Not CvePs > 0 Then + Alert("Debe seleccionar un producto", TipoMensaje.MsgAdvertencia) + ErrorProceso = True + End If + + Dim PsRow As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePs).FiltroPrimero("") + + If PsRow Is Nothing Then + Alert("No se encontro el producto", TipoMensaje.MsgAdvertencia) + ErrorProceso = True + End If + + If Not ErrorProceso Then + Dim CveUM As Integer = PsRow("CveUM").ToString.ToEntero + Dim UM As String = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("UnidadMedida", $" CveUnidadMedida = {CveUM} ") + + Dim CveClasificacion As Integer = PsRow("CveClasificacion").ToString.ToEntero + Dim Clasificacion As String = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $" CveClasificacion = {CveClasificacion} ") + + For Each row As DataRow In DT.Rows + Dim CveSubProyecto As Integer = GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $" SubProyecto = '{row("SubProyecto").ToString}' ").ToEntero + Dim Importe As Decimal = row("Importe").ToString.ToDecimal + AgregarProrrateoGasolina(CveSubProyecto, row("SubProyecto").ToString, CvePs, CveUM, UM, CveClasificacion, Clasificacion, PrecioProrrateo:=Importe) + Next + End If + + Else + Alert(SBErrores.ToString, TipoMensaje.MsgAdvertencia) + End If + + End If + + + If Not ErrorProceso Then + TxtPrecioProrrateoGasolina.Text = "" + DdlSubProyectoProrrateoGasolina.SelectedValueExist(-1) + UpModalProrrateoGasolina.Update() + End If + + + Return If(ErrorProceso, False, True) + + End Function + #End Region + + + + End Class diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 7baf5230f..59ece46c1 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1736,11 +1736,13 @@ Partial Class PopUpVerFactura Dim OpcionDetallado As Integer = 1 If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa.Contiene(197, 189) Then OpcionDetallado = 2 - If CveCorte > 0 AndAlso (FechaConsulta = ModExtensiones.MaxFecha OrElse CveSubProyecto <= 0) Then + If CveCorte > 0 Then Using ObjVta As New ClsPuntoVenta If ObjVta.GetVta_Cortes("-1", "-1", -1, CveCorte, UsuarioActual.CveEmpresa, -1) AndAlso ObjVta.DtResultados.Rows.Count > 0 Then - FechaConsulta = ObjVta.DtResultados.FiltroPrimeroValor("FechaInicial").ToString().ToDate().Date - CveSubProyecto = ObjVta.DtResultados.FiltroPrimeroValor("CveSubProyecto").ToEntero() + If (FechaConsulta = ModExtensiones.MaxFecha OrElse CveSubProyecto <= 0) Then + FechaConsulta = ObjVta.DtResultados.FiltroPrimeroValor("FechaInicial").ToString().ToDate().Date + CveSubProyecto = ObjVta.DtResultados.FiltroPrimeroValor("CveSubProyecto").ToEntero() + End If Nombre = ObjVta.DtResultados.FiltroPrimeroValor("UsuarioNombre").ToString End If End Using @@ -3536,7 +3538,12 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Almacen", Almacen)) params.Add(New ReportParameter("Fecha", Fecha)) params.Add(New ReportParameter("FacturaProveedor", FolioVenta)) - params.Add(New ReportParameter("FacturadoA", If(DtMovimientos(0)("Nombre").ToString <> "", DtMovimientos(0)("Nombre").ToString, NombreCliente))) + If NombreCliente = "" Then + params.Add(New ReportParameter("FacturadoA", Recibio)) + Else + params.Add(New ReportParameter("FacturadoA", If(DtMovimientos(0)("Nombre").ToString <> "", DtMovimientos(0)("Nombre").ToString, NombreCliente))) + End If + params.Add(New ReportParameter("Observaciones", Observaciones)) params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("Folio", Folio)) diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx index 4c7dd8fa6..55ea06663 100644 --- a/Compras/Proveedores.aspx +++ b/Compras/Proveedores.aspx @@ -362,6 +362,7 @@
+
diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index fb5d7c9be..6f0088ed6 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -967,7 +967,7 @@ Partial Class Compras_Proveedores Retorno = True TxtPorcentajeProntoPago.Text = (100 * ObjProveedor.PorcentajeProntoPago).ToString("###.00") - + chkAplicaProntoPago.Checked = ObjProveedor.AplicaProntoPago ' enviaractivacion() CargaEventoBitacora() @@ -1437,7 +1437,7 @@ Partial Class Compras_Proveedores DdlCveClasificacionProveedor.SelectedValue.ToEntero, DdlCveUsuarioResponsable.SelectedValue.ToEntero, TxtNotificarA.Text.Trim, TxtCorreoCobranza.Text.Trim, ChkFolioDuplicado.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlCveTipoProveedor.SelectedValue.ToEntero, DdlMonedaPrefente.SelectedValue.ToEntero, UsaLimiteCredito:=ChkUsaLimiteCredito.Checked, DIOTCveTipoTercero:=DDlDIOTTipoTercero.SelectedValue.ToEntero, DIOTCveTipoOperacion:=DdlDIOTTipoOperacion.SelectedValue.ToEntero, DIOTNumeroIDFiscal:=TxtDIOTNumIDFiscal.Text, AplicarEvaluacion:=AplicarEvaluacion, FechaEvaluacion:=FechaEvaluacion, CicloEvaluacion:=CicloEvaluacion, DIOTCvePais:=DdlDIOTPais.SelectedValue.ToEntero, CveUsuarioEvaluador:=DdlUsuarioEvaluador.SelectedValue.ToEntero(), CP:=TxtCP.Text.ToEntero, DIOTNacionalidad:=TxtDIOTNacionalidad.Text, - CveConfianzaProveedor:=DdlConfianzaProveedor.SelectedValue.ToEntero(), CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then + CveConfianzaProveedor:=DdlConfianzaProveedor.SelectedValue.ToEntero(), CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, AplicaProntoPago:=chkAplicaProntoPago.Checked) Then Dim NuevoCveProveedor As Integer = ObjProveedores.CveProveedor @@ -1548,7 +1548,7 @@ Partial Class Compras_Proveedores DdlCveClasificacionProveedor.SelectedValue.ToEntero, DdlCveUsuarioResponsable.SelectedValue.ToEntero, ChkEstado.Checked, TxtNotificarA.Text.Trim, TxtCorreoCobranza.Text.Trim, ChkFolioDuplicado.Checked, CveProveedor, DdlCveTipoProveedor.SelectedValue.ToEntero, DdlMonedaPrefente.SelectedValue.ToEntero, UsaLimiteCredito:=ChkUsaLimiteCredito.Checked, DIOTCveTipoTercero:=DDlDIOTTipoTercero.SelectedValue.ToEntero, DIOTCveTipoOperacion:=DdlDIOTTipoOperacion.SelectedValue.ToEntero, DIOTNumeroIDFiscal:=TxtDIOTNumIDFiscal.Text, CveUsuarioModifico:=UsuarioActual.CveUsuario, DIOTCvePais:=DdlDIOTPais.SelectedValue.ToEntero, AplicarEvaluacion:=ChkAplicarEvaluacion.Checked, FechaEvaluacion:=FechaEvaluacion, CicloEvaluacion:=CicloEvaluacion, CveUsuarioEvaluador:=DdlUsuarioEvaluador.SelectedValue.ToEntero(), CP:=TxtCP.Text.ToEntero, DIOTNacionalidad:=TxtDIOTNacionalidad.Text, - CveConfianzaProveedor:=DdlConfianzaProveedor.SelectedValue.ToEntero(), CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then + CveConfianzaProveedor:=DdlConfianzaProveedor.SelectedValue.ToEntero(), CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, AplicaProntoPago:=chkAplicaProntoPago.Checked) Then GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = Nothing @@ -4180,18 +4180,14 @@ Partial Class Compras_Proveedores Dim ObjPro As New ClsCompProveedores If ObjPro.UpdateProveedorLimiteCredito(CveProveedor, TxtLimiteCredito.Text.ToDecimal, TxtPlazoCobranza.Text.ToEntero, ChkUsaLimiteCredito.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTipoFechaVencimiento.SelectedValue.ToEntero) Then - - Alert("Limite de crédito modificado correctamente.") + Alert("Límite de crédito modificado correctamente.") RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAddParametros")) + GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = Nothing End If ObjPro.Dispose() Else RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAddParametros")) End If - - - - UPPCxP.Update() UpParametros.Update() diff --git a/Compras/ReembolsosComprobaciones.aspx b/Compras/ReembolsosComprobaciones.aspx index 6e09a63bc..0299d8c07 100644 --- a/Compras/ReembolsosComprobaciones.aspx +++ b/Compras/ReembolsosComprobaciones.aspx @@ -258,6 +258,38 @@ + + + + +
+ +
+ + + + <%----%> +
+
+ <%--
+ + +
+ + + +
+ + +
+ +
+ +
--%> +
+
+ + diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index 7edaa79fb..c514d4ee2 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -5,6 +5,7 @@ Imports System.Data Imports Extensiones Imports Microsoft.Reporting.WebForms + Partial Class Compras_ReembolsosComprobaciones Inherits ClsPaginas @@ -330,13 +331,69 @@ Partial Class Compras_ReembolsosComprobaciones End Sub Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged + Dim dr As DataRow = GlobalDTTipoTransacciones.FiltroPrimero(String.Format("CveTipoTransaccion = {0}", DdlTipoTransaccion.SelectedValue)) + If dr IsNot Nothing Then HdnTipoTransaccion.Value = dr("Tipo").ToString End If CargaCuentas() + + CargaCuentasDepositoClientes() + End Sub + Private Sub CargaCuentasDepositoClientes() + + DdlCuentaDeposito.ClearSelection() + DdlCuentaDeposito.SelectedValue = Nothing + DdlCuentaDeposito.Items.Clear() + + trCuentaDeposito.Visible = False + DdlCuentaDeposito.Enabled = False + + + Dim CvePersonal As Integer = DdlPersonal.SelectedValue.ToEntero + + If CvePersonal > 0 Then + + If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then + + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Enabled = True + + Dim Dep As New ClsGenerales + If Dep.GetCuentasDepositos(CvePersonal:=CvePersonal, CveEmpresa:=UsuarioActual.CveEmpresa) Then + + If DdlTipoTransaccion.SelectedValue = "9" Then + DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros(" EstatusPagoElectronico = 'True'") + Else + DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True'") + End If + + + If Dep.DtResultados.Rows.Count > 0 Then + + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + + End If + End If + + Dep.Dispose() + DdlCuentaDeposito.DataBind() + + + End If + + End If + + UpCuentaDeposito.Update() + + + End Sub + + Protected Sub DDlCheques_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DDlCheques.SelectedIndexChanged If DDlCheques.SelectedValue.ToEntero > 0 Then @@ -381,6 +438,17 @@ Partial Class Compras_ReembolsosComprobaciones #Region " BTN GUARDAR " Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click + + Dim CvecuentaDeposito As Integer = If(DdlCuentaDeposito.SelectedValue.ToEntero > 0, DdlCuentaDeposito.SelectedValue.ToEntero, -1) + If DdlTipoPago.SelectedValue.ToEntero = 1 AndAlso DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then + If CvecuentaDeposito <= 0 Then + Alert("Debe de seleccionar una cuenta deposito", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Else + CvecuentaDeposito = -1 + End If + Dim ValFechaDocumento As Boolean = False Dim FoliosFechasValFechaDocumentoAnio As New StringBuilder @@ -408,7 +476,7 @@ Partial Class Compras_ReembolsosComprobaciones Dim MesDocumento As Integer = FechaDocumento.Month If AnioFactura > AnioDocumento Then - FoliosFechasValFechaDocumentoAnio.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("FechaCompra").ToDate.ToString("dd/MM/yyyy") }
") + FoliosFechasValFechaDocumentoAnio.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("FechaCompra").ToDate.ToString("dd/MM/yyyy") }
") ValFechaDocumento = True ElseIf AnioFactura = AnioDocumento And MesFactura > MesDocumento Then FoliosFechasValFechaDocumentoMesInferior.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("FechaCompra").ToDate.ToString("dd/MM/yyyy") }
") @@ -534,7 +602,7 @@ Partial Class Compras_ReembolsosComprobaciones If ChkChequeExcedente.Checked Then CvePrePolizaExcedente = ObjMov.AddPrePolizas("Compras/Comprobaciones3", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - CveIEExcedente = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaExcedente, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False)) + CveIEExcedente = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaExcedente, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False), CveCuentaDeposito:=CvecuentaDeposito) If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal * tipoCambio, If(CveCajaChica > 0, 30, 29), TxtObservaciones.Text, TxtObservaciones.Text, CveIE:=CveIEExcedente, CvePersonal:=CvePersonal, CveCompra:=-1, CveProveedor:=-1, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal)) Then MsgError = "Error al registrar detalle de concepto bancario" End If @@ -549,7 +617,7 @@ Partial Class Compras_ReembolsosComprobaciones End If ElseIf Not ChkReembolsarSinBancos.Checked Then CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones4", 9, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, CveMoneda, TxtFechaDocumento.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - CveIERegistrado = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaIERegistrado, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False)) + CveIERegistrado = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDecimal, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePolizaIERegistrado, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked, True, False), CveCuentaDeposito:=CvecuentaDeposito) If CveIERegistrado > 0 Then If filemove <> "" Then @@ -678,7 +746,7 @@ Partial Class Compras_ReembolsosComprobaciones Pago.CveIE = CveIEPago Pago.CveMonedaPago = CveMonedaPago Pago.TCPago = TipoCambioPago - Pago.CvePersonal =CvePersonal + Pago.CvePersonal = CvePersonal ImportePagoTotal = ImportePagoTotal + ImporteMovto If UsuarioActual.CveEmpresa.Contiene(7, 11, 12, 122, 145) Then @@ -1242,4 +1310,7 @@ Partial Class Compras_ReembolsosComprobaciones Calendario.EndDate = NowADS() End Sub + + + End Class diff --git a/Contabilidad/DiarioAmortizaciones.aspx b/Contabilidad/DiarioAmortizaciones.aspx index caf44dd74..1ce31b891 100644 --- a/Contabilidad/DiarioAmortizaciones.aspx +++ b/Contabilidad/DiarioAmortizaciones.aspx @@ -439,6 +439,7 @@ + @@ -616,6 +617,7 @@ +
@@ -791,6 +793,7 @@ +
diff --git a/Contabilidad/DiarioAmortizaciones.aspx.vb b/Contabilidad/DiarioAmortizaciones.aspx.vb index 6d14073d2..9efa59878 100644 --- a/Contabilidad/DiarioAmortizaciones.aspx.vb +++ b/Contabilidad/DiarioAmortizaciones.aspx.vb @@ -624,6 +624,7 @@ Partial Class Contabilidad_DiarioAmortizaciones For Each gvrc As GridViewRow In GvCompras.Rows + Dim PorcentajeIVA As Decimal = (gvrc.FCHiddenField("HdnPorcentajeIVA").Value.ToDecimal() * 100).ToEntero AbonoProveedor = 0 : CargoProveedor = 0 : CargoAnticipo = 0 : AbonoAnticipo = 0 @@ -783,15 +784,51 @@ Partial Class Contabilidad_DiarioAmortizaciones MsgError = "No se pudo insertar movimientos de devoluciones de IVA" : Exit For End If End If + + Dim UUID As String = gvrc.FCHiddenField("HdnUUID").Value If Not Conta.AddDevolucionesIVA(IDPoliza, IdCuentaBancos, IdProveedor, 16, SubTotal, IVAAcreditable * TipoCambioPago, CompraPagadoRetIVA * TipoCambioPago, CompraPagadoRetISR * TipoCambioPago, - Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, "", UsuarioActual.CveEmpresa) Then + Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, UUID, UsuarioActual.CveEmpresa) Then MsgError = "No se pudo insertar movimientos de devoluciones de IVA" : Exit For End If + If MsgError = "" Then + + Dim GuidMov As String = Guid.NewGuid().ToString() + + Dim NoDeducible = False + Dim IVANoAcred As Decimal = 0 'si NoDeducible es true -- > Es el iva no deducible , ivano deducible totald e la compra + + If Not Conta.AddMovimientoImpuesto(IDPoliza, IdCuentaBancos, IdProveedor, PorcentajeIVA, PorcentajeIVA, SubTotal, IVAAcreditable * TipoCambioPago, + Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, UUID, NoDeducible, IVANoAcred, GuidMov, "", 1, 2) Then + MsgError = "No se pudo insertar movimientos de impuesto de IVA" : Exit For + End If + + + If MsgError = "" AndAlso CompraPagadoRetIVA > 0 Then + Dim GuidMovRetIVA As String = Guid.NewGuid().ToString() + Dim TasaOCuotaRetIVA As Decimal = (((CompraPagadoRetIVA * TipoCambioPago) / SubTotal) * 100).ToDecimal.RoundSQL(4) + If Not Conta.AddMovimientoImpuesto(IDPoliza, IdCuentaBancos, IdProveedor, PorcentajeIVA, TasaOCuotaRetIVA, SubTotal, CompraPagadoRetIVA * TipoCambioPago, + Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, UUID, NoDeducible, IVANoAcred, GuidMovRetIVA, GuidMov, 2, 2) Then + MsgError = "No se pudo insertar movimientos de retención de IVA" : Exit For + End If + End If + + If MsgError = "" AndAlso CompraPagadoRetISR > 0 Then + Dim GuidMovRetISR As String = Guid.NewGuid().ToString() + Dim TasaOCuotaRetIVA As Decimal = (((CompraPagadoRetISR * TipoCambioPago) / SubTotal) * 100).ToDecimal.RoundSQL(4) + If Not Conta.AddMovimientoImpuesto(IDPoliza, IdCuentaBancos, IdProveedor, PorcentajeIVA, TasaOCuotaRetIVA, SubTotal, CompraPagadoRetISR * TipoCambioPago, + Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, UUID, NoDeducible, IVANoAcred, GuidMovRetISR, GuidMov, 2, 1) Then + MsgError = "No se pudo insertar movimientos de retención de ISR" : Exit For + End If + End If + + End If + + End If @@ -1093,6 +1130,7 @@ Partial Class Contabilidad_DiarioAmortizaciones For Each gvrc As GridViewRow In GvCompras.Rows + Dim PorcentajeIVA As Decimal = (gvrc.FCHiddenField("HdnPorcentajeIVA").Value.ToDecimal() * 100).ToEntero AbonoProveedor = 0 : CargoProveedor = 0 : CargoAnticipo = 0 : AbonoAnticipo = 0 @@ -1241,15 +1279,50 @@ Partial Class Contabilidad_DiarioAmortizaciones End If End If + Dim UUID As String = gvrc.FCHiddenField("HdnUUID").Value + If IdCuentaBancos > 0 AndAlso Not Conta.AddDevolucionesIVA(IDPoliza, IdCuentaBancos, IdProveedor, 16, SubTotal, IVAAcreditable * TipoCambioPago, CompraPagadoRetIVA * TipoCambioPago, CompraPagadoRetISR * TipoCambioPago, - Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, "", UsuarioActual.CveEmpresa) Then + Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, UUID, UsuarioActual.CveEmpresa) Then MsgError = "No se pudo insertar movimientos de devoluciones de IVA" : Exit For End If + If MsgError = "" Then + + Dim GuidMov As String = Guid.NewGuid().ToString() + + Dim NoDeducible = False + Dim IVANoAcred As Decimal = 0 'si NoDeducible es true -- > Es el iva no deducible , ivano deducible totald e la compra + + If Not Conta.AddMovimientoImpuesto(IDPoliza, IdCuentaBancos, IdProveedor, PorcentajeIVA, PorcentajeIVA, SubTotal, IVAAcreditable * TipoCambioPago, + Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, UUID, NoDeducible, IVANoAcred, GuidMov, "", 1, 2) Then + MsgError = "No se pudo insertar movimientos de impuesto de IVA" : Exit For + End If + + + If MsgError = "" AndAlso CompraPagadoRetIVA > 0 Then + Dim GuidMovRetIVA As String = Guid.NewGuid().ToString() + Dim TasaOCuotaRetIVA As Decimal = (((CompraPagadoRetIVA * TipoCambioPago) / SubTotal) * 100).ToDecimal.RoundSQL(4) + If Not Conta.AddMovimientoImpuesto(IDPoliza, IdCuentaBancos, IdProveedor, PorcentajeIVA, TasaOCuotaRetIVA, SubTotal, CompraPagadoRetIVA * TipoCambioPago, + Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, UUID, NoDeducible, IVANoAcred, GuidMovRetIVA, GuidMov, 2, 2) Then + MsgError = "No se pudo insertar movimientos de retención de IVA" : Exit For + End If + End If + + If MsgError = "" AndAlso CompraPagadoRetISR > 0 Then + Dim GuidMovRetISR As String = Guid.NewGuid().ToString() + Dim TasaOCuotaRetIVA As Decimal = (((CompraPagadoRetISR * TipoCambioPago) / SubTotal) * 100).ToDecimal.RoundSQL(4) + If Not Conta.AddMovimientoImpuesto(IDPoliza, IdCuentaBancos, IdProveedor, PorcentajeIVA, TasaOCuotaRetIVA, SubTotal, CompraPagadoRetISR * TipoCambioPago, + Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, UUID, NoDeducible, IVANoAcred, GuidMovRetISR, GuidMov, 2, 1) Then + MsgError = "No se pudo insertar movimientos de retención de ISR" : Exit For + End If + End If + + End If + End If 'afecto los movimientos en los que se hizo el pago @@ -1568,6 +1641,7 @@ Partial Class Contabilidad_DiarioAmortizaciones For Each gvrc As GridViewRow In GvCompras.Rows + Dim PorcentajeIVA As Decimal = (gvrc.FCHiddenField("HdnPorcentajeIVA").Value.ToDecimal() * 100).ToEntero AbonoProveedor = 0 : CargoProveedor = 0 : CargoAnticipo = 0 : AbonoAnticipo = 0 @@ -1666,15 +1740,50 @@ Partial Class Contabilidad_DiarioAmortizaciones End If End If + Dim UUID As String = gvrc.FCHiddenField("HdnUUID").Value + If Not Conta.AddDevolucionesIVA(IDPoliza, IdCuentaBancos, IdProveedor, 16, SubTotal, IVAAcreditable * TipoCambioPago, CompraPagadoRetIVA * TipoCambioPago, CompraPagadoRetISR * TipoCambioPago, - Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, "", UsuarioActual.CveEmpresa) Then + Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, UUID, UsuarioActual.CveEmpresa) Then MsgError = "No se pudo insertar movimientos de devoluciones de IVA" : Exit For End If + If MsgError = "" Then + + Dim GuidMov As String = Guid.NewGuid().ToString() + + Dim NoDeducible = False + Dim IVANoAcred As Decimal = 0 'si NoDeducible es true -- > Es el iva no deducible , ivano deducible totald e la compra + + If Not Conta.AddMovimientoImpuesto(IDPoliza, IdCuentaBancos, IdProveedor, PorcentajeIVA, PorcentajeIVA, SubTotal, IVAAcreditable * TipoCambioPago, + Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, UUID, NoDeducible, IVANoAcred, GuidMov, "", 1, 2) Then + MsgError = "No se pudo insertar movimientos de impuesto de IVA" : Exit For + End If + + + If MsgError = "" AndAlso CompraPagadoRetIVA > 0 Then + Dim GuidMovRetIVA As String = Guid.NewGuid().ToString() + Dim TasaOCuotaRetIVA As Decimal = (((CompraPagadoRetIVA * TipoCambioPago) / SubTotal) * 100).ToDecimal.RoundSQL(4) + If Not Conta.AddMovimientoImpuesto(IDPoliza, IdCuentaBancos, IdProveedor, PorcentajeIVA, TasaOCuotaRetIVA, SubTotal, CompraPagadoRetIVA * TipoCambioPago, + Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, UUID, NoDeducible, IVANoAcred, GuidMovRetIVA, GuidMov, 2, 2) Then + MsgError = "No se pudo insertar movimientos de retención de IVA" : Exit For + End If + End If + + If MsgError = "" AndAlso CompraPagadoRetISR > 0 Then + Dim GuidMovRetISR As String = Guid.NewGuid().ToString() + Dim TasaOCuotaRetIVA As Decimal = (((CompraPagadoRetISR * TipoCambioPago) / SubTotal) * 100).ToDecimal.RoundSQL(4) + If Not Conta.AddMovimientoImpuesto(IDPoliza, IdCuentaBancos, IdProveedor, PorcentajeIVA, TasaOCuotaRetIVA, SubTotal, CompraPagadoRetISR * TipoCambioPago, + Fecha, NumPoliza.ToString, gvrc.FCHiddenField("HdnSerie").Value, gvrc.FCHiddenField("HdnFolio").Value.StrToNum, UUID, NoDeducible, IVANoAcred, GuidMovRetISR, GuidMov, 2, 1) Then + MsgError = "No se pudo insertar movimientos de retención de ISR" : Exit For + End If + End If + + End If + End If 'afecto los movimientos en los que se hizo el pago diff --git a/Contabilidad/DiarioPagos.aspx b/Contabilidad/DiarioPagos.aspx index 4fc3dee48..f5c6ef30a 100644 --- a/Contabilidad/DiarioPagos.aspx +++ b/Contabilidad/DiarioPagos.aspx @@ -385,6 +385,7 @@
Personal:     Cuenta:      :   +
diff --git a/Contabilidad/DiarioPagos.aspx.vb b/Contabilidad/DiarioPagos.aspx.vb index 49273017a..2996b6b4a 100644 --- a/Contabilidad/DiarioPagos.aspx.vb +++ b/Contabilidad/DiarioPagos.aspx.vb @@ -1217,7 +1217,7 @@ Partial Class Contabilidad_DiarioPagos Else Conta.RollBack() Bancos.RollBack() - MsgErrorGeneral.AppendFormat("{0}{1}", gvr.FCLiteral("LitTT").Text, gvr.FCHyperLink("HplFolio").Text) + MsgErrorGeneral.AppendFormat("{0} {1}", gvr.FCLiteral("LitTT").Text, gvr.FCHyperLink("HplFolio").Text) End If @@ -1227,7 +1227,7 @@ Partial Class Contabilidad_DiarioPagos Else Conta.RollBack() Bancos.RollBack() - MsgErrorGeneral.AppendFormat("{0}{1}", gvr.FCLiteral("LitTT").Text, gvr.FCHyperLink("HplFolio").Text) + MsgErrorGeneral.AppendFormat("{0} {1}", gvr.FCLiteral("LitTT").Text, gvr.FCHyperLink("HplFolio").Text) End If End If @@ -1282,7 +1282,13 @@ Partial Class Contabilidad_DiarioPagos Catch ex As Exception Conta.RollBack() Bancos.RollBack() - Alert(ex.Message) + + If UsuarioActual.CveRol = 1 Then + Alert($"{ex.Message} --> {ex.StackTrace}") + Else + Alert(ex.Message) + End If + ' Alert("Ocurrio u`n error al contabilizar") End Try diff --git a/Contabilidad/RepGastosCC.aspx b/Contabilidad/RepGastosCC.aspx index 9f918e6a6..05c33dbc7 100644 --- a/Contabilidad/RepGastosCC.aspx +++ b/Contabilidad/RepGastosCC.aspx @@ -206,6 +206,16 @@ table.adssigscroll { + Proyecto: +
+ +
+ SubProyecto: +
+ + + +
diff --git a/Contabilidad/RepGastosCC.aspx.vb b/Contabilidad/RepGastosCC.aspx.vb index 90d6291b3..75d8893d6 100644 --- a/Contabilidad/RepGastosCC.aspx.vb +++ b/Contabilidad/RepGastosCC.aspx.vb @@ -21,20 +21,23 @@ Partial Class RepGastosCC #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then - - txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString() txtFechaF.Text = NowADS().ToShortDateString OrdenaDatos() - + CargaCombos() End If End Sub + Private Sub CargaCombos() + CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto, VisualizacionReporte:=1) + + End Sub + #Region " C A R G A - D A T O S " Public Sub CargaDatos() Dim Obj As New ClsContabilidad - If Obj.GetGastosRepCC(txtFechaI.Text.Trim.ToDate, txtFechaF.Text.Trim().ToDate, UsuarioActual.CveEmpresa) Then + If Obj.GetGastosRepCC(txtFechaI.Text.Trim.ToDate, txtFechaF.Text.Trim().ToDate, DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then Dim dt As DataTable = Obj.DtResultados If DdlOpcionCuenta.SelectedValue = "2" Then dt = dt.FiltraParametros("Total > 0") diff --git a/Contabilidad/RepIVA.aspx b/Contabilidad/RepIVA.aspx index 243f59c2b..334824b57 100644 --- a/Contabilidad/RepIVA.aspx +++ b/Contabilidad/RepIVA.aspx @@ -219,7 +219,7 @@ SubTotal
16%
- + @@ -228,7 +228,7 @@ SubTotal
Imp. 16%
- + <%-- --%> @@ -237,7 +237,7 @@ SubTotal
8%
- + <%-- --%> @@ -286,8 +286,15 @@ - - + + + Actos ND
16%
+
+ + + +
+ IVA ND
16%
@@ -295,6 +302,14 @@
+ + + Actos ND
8%
+
+ + + +
IVA ND
8%
diff --git a/Empresas/119/Formatos/RepIVAAcreditable.rpt b/Empresas/119/Formatos/RepIVAAcreditable.rpt index dcfbc35fd..5a2d0b240 100644 Binary files a/Empresas/119/Formatos/RepIVAAcreditable.rpt and b/Empresas/119/Formatos/RepIVAAcreditable.rpt differ diff --git a/Empresas/Grales/Formatos/Salida.rdlc b/Empresas/Grales/Formatos/Salida.rdlc index eb306ae32..3428967bb 100644 --- a/Empresas/Grales/Formatos/Salida.rdlc +++ b/Empresas/Grales/Formatos/Salida.rdlc @@ -345,7 +345,7 @@ =Fields!Cantidad.Value @@ -1104,7 +1104,7 @@ 0.79361cm 11.65255cm 0.6cm - 9.5262cm + 9.15694cm 4 - 0.68252in + 0.62002in @@ -1045,7 +1045,7 @@ =Parameters!SubProyecto.Value @@ -1057,7 +1057,7 @@ 3.24566cm 0.00711cm 0.6cm - 14.27979cm + 16.54562cm 6
- - - - - - -
+
- - Ingresos - Recuperación - Compras - Gasto - Cuentas por Pagar - Inventario - Utilidad - Impuestos - CRM - RH - AF - -
-
- - -
-
-
- - - -
-
-
- - Utilidad -
-
-
- - - - - - - - - -
-
 
-
 
-
-
- - - <%# Eval("Sucursal") %> - -
- - - - - -
-
Venta
-
Utilidad
-
-
- -
-
<%# String.Format("{0:N2}", Eval("VentaAnual")) %>
-
<%# String.Format("{0:N2}", Eval("UtilidadAnual")) %>
-
-
-
- - - - - -
-
Venta
-
Utilidad
-
-
- -
-
<%# String.Format("{0:N2}", Eval("VentaMensual")) %>
-
<%# String.Format("{0:N2}", Eval("UtilidadMensual")) %>
-
-
-
-
-
-
-
- -
- -
- -
- -
- -
- -
-
-
-
- Ventas por sucursal -
-
-
- - - - <%# Eval("Sucursal") %> - - - <%# Eval("Año", "{0:N2}") %> - - - <%# Eval("Mes", "{0:N2}") %> - - - <%# Eval("Semana", "{0:N2}") %> - - - <%# Eval("Día", "{0:N2}") %> - - - -
-
-
- - -
-
-
-
- Ventas por vendedor -
-
-
- - - - <%# Eval("Vendedor") %> - - - - <%# Eval("Año", "{0:N2}") %> - - - <%# Eval("Mes", "{0:N2}") %> - - - <%# Eval("Semana", "{0:N2}") %> - - - <%# Eval("Día", "{0:N2}") %> - - - -
-
-
- - -
-
-
-
- Ventas por clasificación -
-
-
- - - - <%# Eval("Clasificacion") %> - - - - <%# Eval("Año", "{0:N2}") %> - - - <%# Eval("Mes", "{0:N2}") %> - - - <%# Eval("Semana", "{0:N2}") %> - - - <%# Eval("Día", "{0:N2}") %> - - - -
-
-
- - -
-
-
-
- Ventas por marca -
-
-
- - - - <%# Eval("Marca") %> - - - - <%# Eval("Año", "{0:N2}") %> - - - <%# Eval("Mes", "{0:N2}") %> - - - <%# Eval("Semana", "{0:N2}") %> - - - <%# Eval("Día", "{0:N2}") %> - - - -
-
-
- -
-
-
-
- Ventas por PS -
-
-
- - - - <%# Eval("ProductoServicio") %> - - - - <%# Eval("Año", "{0:N2}") %> - - - <%# Eval("Mes", "{0:N2}") %> - - - <%# Eval("Semana", "{0:N2}") %> - - - <%# Eval("Día", "{0:N2}") %> - - - -
-
-
- -
-
-
-
- Ventas por Cliente -
-
-
- - - - <%# Eval("NombreCliente") %> - - - - <%# Eval("Año", "{0:N2}") %> - - - <%# Eval("Mes", "{0:N2}") %> - - - <%# Eval("Semana", "{0:N2}") %> - - - <%# Eval("Día", "{0:N2}") %> - - - -
-
-
- -
-
-
-
- Ventas por Proveedor -
-
-
- - - - <%# Eval("NombreProveedor") %> - - - - <%# Eval("Año", "{0:N2}") %> - - - <%# Eval("Mes", "{0:N2}") %> - - - <%# Eval("Semana", "{0:N2}") %> - - - <%# Eval("Día", "{0:N2}") %> - - - -
-
+
+ +
+ + Ingresos + Recuperación + Compras + Gasto + Cuentas por Pagar + Inventario + Utilidad + Impuestos + CRM + RH + AF +
- - +
+
+ + + +
+
+
- - + +
+
+
+ + Utilidad +
+
+
+ + + + + + + + + + + + +
+
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+
+ Ventas por sucursal +
+
+
+ + + + <%# Eval("Sucursal") %> + + + <%# Eval("Año", "{0:N2}") %> + + + <%# Eval("Mes", "{0:N2}") %> + + + <%# Eval("Semana", "{0:N2}") %> + + + <%# Eval("Día", "{0:N2}") %> + + + +
+
+
- - +
+
+
+
+ Ventas por vendedor +
+
+
+ + + + <%# Eval("Vendedor") %> + + + + <%# Eval("Año", "{0:N2}") %> + + + <%# Eval("Mes", "{0:N2}") %> + + + <%# Eval("Semana", "{0:N2}") %> + + + <%# Eval("Día", "{0:N2}") %> + + + +
+
+
- - +
+
+
+
+ Ventas por clasificación +
+
+
+ + + + <%# Eval("Clasificacion") %> + + + + <%# Eval("Año", "{0:N2}") %> + + + <%# Eval("Mes", "{0:N2}") %> + + + <%# Eval("Semana", "{0:N2}") %> + + + <%# Eval("Día", "{0:N2}") %> + + + +
+
+
- - +
+
+
+
+ Ventas por marca +
+
+
+ + + + <%# Eval("Marca") %> + + + + <%# Eval("Año", "{0:N2}") %> + + + <%# Eval("Mes", "{0:N2}") %> + + + <%# Eval("Semana", "{0:N2}") %> + + + <%# Eval("Día", "{0:N2}") %> + + + +
+
+
+ +
+
+
+
+ Ventas por PS +
+
+
+ + + + <%# Eval("ProductoServicio") %> + + + + <%# Eval("Año", "{0:N2}") %> + + + <%# Eval("Mes", "{0:N2}") %> + + + <%# Eval("Semana", "{0:N2}") %> + + + <%# Eval("Día", "{0:N2}") %> + + + +
+
+
+ +
+
+
+
+ Ventas por Cliente +
+
+
+ + + + <%# Eval("NombreCliente") %> + + + + <%# Eval("Año", "{0:N2}") %> + + + <%# Eval("Mes", "{0:N2}") %> + + + <%# Eval("Semana", "{0:N2}") %> + + + <%# Eval("Día", "{0:N2}") %> + + + +
+
+
+ +
+
+
+
+ Ventas por Proveedor +
+
+
+ + + + <%# Eval("NombreProveedor") %> + + + + <%# Eval("Año", "{0:N2}") %> + + + <%# Eval("Mes", "{0:N2}") %> + + + <%# Eval("Semana", "{0:N2}") %> + + + <%# Eval("Día", "{0:N2}") %> + + + +
+
+
+
+ +
- - + + - - + + - - + + - - + + - - - + + - - -
+ + + + + + + + + + + + + + + + + + + +
+ + diff --git a/General/Dashboard.aspx.vb b/General/Dashboard.aspx.vb index 59fc12ef4..21ba073fa 100644 --- a/General/Dashboard.aspx.vb +++ b/General/Dashboard.aspx.vb @@ -5,6 +5,7 @@ Imports System.Web.Services Imports Newtonsoft.Json Imports ADSNetLibrary.SIGAPI.Models.CRM.Request Imports ADSNetLibrary.SIGAPI.Services.CRM +Imports MoreLinq Imports System.Globalization Partial Class General_Dashboard @@ -16,6 +17,7 @@ Partial Class General_Dashboard ddlDashboardOption.SelectedValue = "1" ' Opción por defecto: Ingresos LoadDashboard() End If + ScriptManager.GetCurrent(Me).RegisterPostBackControl(LnkExportarPDF) End Sub Protected Sub ddlDashboardOption_SelectedIndexChanged(sender As Object, e As EventArgs) @@ -27,6 +29,11 @@ Partial Class General_Dashboard ' Aquí podrías cargar dinámicamente si lo deseas en el futuro End Sub + Public Overrides Sub VerifyRenderingInServerForm(control As Control) + ' No hagas nada aquí. Sólo con esta firma el GridView deja de quejarse. + End Sub + + Private Sub LoadDashboard() Dim opcion As Integer = Integer.Parse(ddlDashboardOption.SelectedValue) Dim hoy As DateTime = DateTime.Now @@ -87,6 +94,14 @@ Partial Class General_Dashboard End Select End Sub + Protected Sub LnkExportarPDF_Click(sender As Object, e As EventArgs) Handles LnkExportarPDF.Click + DivIndicadoresLeft.InnerHtml &= DivIndicadoresRight.InnerHtml + DivIndicadoresRight.InnerHtml = String.Empty + pnlDashboard.GenerarReportePDF("Reporte Resumen de Indicadores") + End Sub + + + Private Sub CargarIndicadores(dt As DataTable) If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then ProcesarDatosIndicadores(dt) @@ -221,6 +236,53 @@ Partial Class General_Dashboard End Sub + Protected Sub gvResumenSucursales_RowCreated(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.Header Then + ' Limpiar celdas originales + e.Row.Cells.Clear() + + ' Crear primera fila de encabezado (grupos) + Dim headerRow As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Celda para "Sucursal" (ocupa 2 filas) + Dim cellSucursal As New TableHeaderCell() + cellSucursal.RowSpan = 2 + cellSucursal.Text = "Sucursal" + headerRow.Cells.Add(cellSucursal) + + ' Celda para "Año" (abarca 2 columnas) + Dim cellAño As New TableHeaderCell() + cellAño.ColumnSpan = 2 + cellAño.Text = "Año" + headerRow.Cells.Add(cellAño) + + ' Celda para "Mes" (abarca 2 columnas) + Dim cellMes As New TableHeaderCell() + cellMes.ColumnSpan = 2 + cellMes.Text = "Mes" + headerRow.Cells.Add(cellMes) + + ' Añadir fila al GridView + Dim grid As GridView = DirectCast(sender, GridView) + grid.Controls(0).Controls.AddAt(0, headerRow) + + ' Crear segunda fila de encabezado (subtítulos) + Dim subHeaderRow As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Subtítulos para "Año" + subHeaderRow.Cells.Add(New TableHeaderCell() With {.Text = "Venta"}) + subHeaderRow.Cells.Add(New TableHeaderCell() With {.Text = "Utilidad"}) + + ' Subtítulos para "Mes" + subHeaderRow.Cells.Add(New TableHeaderCell() With {.Text = "Venta"}) + subHeaderRow.Cells.Add(New TableHeaderCell() With {.Text = "Utilidad"}) + + grid.Controls(0).Controls.AddAt(1, subHeaderRow) + + End If + End Sub + + Private Sub CargarVentasPorSucursal(dt As DataTable) If dt Is Nothing OrElse dt.Rows.Count = 0 Then Return diff --git a/Inicio.aspx b/Inicio.aspx index 9cf4159cd..6f20e28c0 100644 --- a/Inicio.aspx +++ b/Inicio.aspx @@ -549,27 +549,75 @@

- + -
-
Opción:
-
- - - - - - - -
-
- - - - + +
+
+
+ + +
+
+
+ +
+ + + + + + + +
+
+ + + + +
+
+ Fecha. Inicio: +
+
+
+ + + + +
+ + + + + + +
+
+ Fecha. Fin: +
+
+
+ + + + +
+ + + + + + +
+
+
+
+
-
-
+ +
diff --git a/Inicio.aspx.vb b/Inicio.aspx.vb index 96ba681cf..570085ae2 100644 --- a/Inicio.aspx.vb +++ b/Inicio.aspx.vb @@ -8,7 +8,7 @@ Imports ADSNetLibrary.SIGAPI.Services.CRM Partial Class Inicio Inherits ClsPaginas - Private Dias() As String = {"Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"} + 'Private Dias() As String = {"Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"} Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -142,23 +142,18 @@ Partial Class Inicio If UsuarioActual.TienePermisoProceso(343) Then MuestraPsProximosAVencer() If UsuarioActual.TienePermisoProceso(344) Then MuestraRSCOProximosAVencer() - If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso (UsuarioActual.CveUsuario = 3964 Or UsuarioActual.CveRol = 1639) Then 'AndAlso UsuarioActual.CveRol.Contiene(1577, 1639, 1573) Then - 'Dim Opcion As Integer = 1 - 'Dim CveVendedor As Integer = -1 - 'Dim CveUsuarioTecnico As Integer = -1 + If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso + (UsuarioActual.CveUsuario.Contiene(3964, 3984) OrElse UsuarioActual.CveRol.Contiene(1639, 1577, 1578, 1582)) Then - 'If UsuarioActual.CveRol = 1577 Then 'vendedor - ' Opcion = 1 - ' CveVendedor = UsuarioActual.CveVendedor - ' CveUsuarioTecnico = UsuarioActual.CveUsuario 'GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUsuarioTecnico", $"CveVendedor = {CveVendedor}").ToEntero - 'ElseIf UsuarioActual.CveRol.Contiene(1639, 1573) Then ' rol admin. 1573 - ' Opcion = 2 'gerente ventas - 'End If divsms1.Visible = True - If UsuarioActual.CveUsuario = 3964 Then + txtFechaInicioSMS.Text = Now.FirstDayOfMonth.ToString + txtFechaFinSMS.Text = Now.LastDayOfMonth.ToString + If UsuarioActual.CveUsuario = 3964 Then 'diego de la concha DdlSMSOpciones.SelectedValue = "2" DdlSMSVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveEstatus=1 ") DdlSMSVendedores.DataBind() + DdlSMSTecnico.DataSource = GlobalDTUsuarios(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveRol = 1582") + DdlSMSTecnico.DataBind() End If If UsuarioActual.CveRol.Contiene(1639) Then 'gerente ventas DdlSMSOpciones.SelectedValue = "2" @@ -171,7 +166,33 @@ Partial Class Inicio DdlSMSVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveEstatus=1 and CveSuperior = {CveGerenteVendedor} ") DdlSMSVendedores.DataBind() + DdlSMSTecnico.Items.Insert(0, New ListItem("Todos", "-1")) End If + If UsuarioActual.CveRol = 1577 Then 'vendedores + DdlSMSOpciones.SelectedValue = "1" + DdlSMSVendedores.Items.Add(New ListItem(UsuarioActual.Nombre, UsuarioActual.CveVendedor.ToString)) + DdlSMSVendedores.SelectedValue = UsuarioActual.CveVendedor.ToString + DdlSMSVendedores.Enabled = False + DdlSMSOpciones.Enabled = False + End If + If UsuarioActual.CveRol = 1578 Then 'almacenista + DdlSMSOpciones.SelectedValue = "3" + DdlSMSOpciones.Enabled = False + End If + If UsuarioActual.CveUsuario = 3984 Then 'Erick, modalidad de gerente de técnicos + DdlSMSOpciones.SelectedValue = "5" + DdlSMSTecnico.DataSource = GlobalDTUsuarios(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveRol = 1582") + DdlSMSTecnico.DataBind() + DdlSMSOpciones.Items.RemoveAt(2) : DdlSMSOpciones.Items.RemoveAt(1) : DdlSMSOpciones.Items.RemoveAt(0) + + ElseIf UsuarioActual.CveRol = 1582 Then 'tecnicos + DdlSMSOpciones.SelectedValue = "4" + DdlSMSOpciones.Enabled = False + DdlSMSTecnico.Items.Add(New ListItem(UsuarioActual.Nombre, UsuarioActual.CveUsuario.ToString)) + DdlSMSTecnico.SelectedValue = UsuarioActual.CveUsuario.ToString + DdlSMSTecnico.Enabled = False + End If + CargaSMSKPI() End If @@ -1641,8 +1662,8 @@ Partial Class Inicio Dim Gral As New ClsVentas Dim ds As DataSet = Nothing - Dim FechaI As Date = Now.FirstDayOfMonth - Dim FechaF As Date = Now.LastDayOfMonth + Dim FechaI As Date = txtFechaInicioSMS.Text.ToDate ' Now.FirstDayOfMonth + Dim FechaF As Date = txtFechaFinSMS.Text.ToDate 'Now.LastDayOfMonth If Gral.GetSMSIndicadores(Opcion, FechaI, FechaF, UsuarioActual.CveUsuario, CveVendedor, CveGerenteVendedor, CveUsuarioTecnico, UsuarioActual.CveEmpresa) Then ds = Gral.DataSetResultados @@ -2549,9 +2570,6 @@ Partial Class Inicio CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, CveGerenteVendedor:=CveGerenteVendedor) ElseIf DdlSMSOpciones.SelectedValue = "4" Then - DdlSMSTecnico.DataSource = GlobalDTUsuarios(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveRol = 1582") - DdlSMSTecnico.DataBind() - DdlSMSTecnico.Items.Insert(0, New ListItem("Todos", "-1")) DdlSMSTecnico.Visible = True DdlSMSVendedores.Visible = False CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, -1, DdlSMSTecnico.SelectedValue.ToEntero) @@ -2576,4 +2594,8 @@ Partial Class Inicio Protected Sub DdlSMSTecnico_SelectedIndexChanged(sender As Object, e As EventArgs) CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, -1, DdlSMSTecnico.SelectedValue.ToEntero) End Sub + + Protected Sub BtnSMSAplicarFecha_Click(sender As Object, e As EventArgs) + CargaSMSKPI() + End Sub End Class diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 42612ffdd..3b9285795 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -259,13 +259,14 @@
-
- -
- - <%----%> -
-
+ +
+
+ + +
+ +
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 56cf628f4..383615019 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -5,6 +5,7 @@ Imports System.Data Imports System.IO Imports Extensiones Imports GemBox.Spreadsheet +Imports iText.Barcodes.Dmcode Partial Class Inventarios_EntradasSalidas Inherits ClsPaginas @@ -721,6 +722,8 @@ Partial Class Inventarios_EntradasSalidas DdlConcepto.DataSource = GlobalDTInvConceptos.FiltraParametros(IIf(UsuarioActual.CveEmpresa.Contiene(72, 80, 1), "CveConcepto NOT IN (4,5,10)", "CveConcepto NOT IN (1,2,4,5,8,9,10,12,26,27,29)").ToString) DdlConcepto.DataBind() + + 'Llenar el dropdownlist de almacén If Not IfNull(Request("CI"), -1).ToString.ToEntero > 0 AndAlso Not IfNull(Request("CveEntregaAlmacen"), -1).ToString.ToEntero > 0 Then DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (9,11)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) @@ -2049,7 +2052,8 @@ Partial Class Inventarios_EntradasSalidas ''VALIDA EXISTENCIAS Dim Cont As Integer = 0 - If DdlConcepto.SelectedValue.Contiene({"3", "11", "13", "21", "30", "31"}) Then + Dim tConceptoOrigen As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", $"CveConcepto = {DdlConcepto.SelectedValue}").ToEntero + If tConceptoOrigen < 0 Then 'si es negativo el origen, indica salida de almacen For Each Dr As DataRow In DtMovimientos.Rows Dim FechaCaducidadVal As Date = If(Dr("AplicaCaducidad").ToString = "True", Dr("FechaCaducidad").ToString.ToDate, MinFecha) Dim FechaMovtoExistenciaStr As String = $"{FechaMovimiento.ToString("yyyy/MM/dd")} {FechaMovimiento.ToString("HH:mm")}" @@ -2137,6 +2141,7 @@ Partial Class Inventarios_EntradasSalidas Dim CveConceptoContable As Integer = 260 Dim CveClasificacion As Integer = -1 + Select Case DdlConcepto.SelectedValue.ToEntero Case 2, 32 EsContabilizable = True @@ -2188,7 +2193,7 @@ Partial Class Inventarios_EntradasSalidas End If Next Else - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, tValorInventario, tValorInventario, CveConceptoContable, TxtObservaciones.Text.Trim, TxtObservaciones.Text.Trim, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=CveClasificacion, Contabilizable:=EsContabilizable) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, tValorInventario, tValorInventario, CveConceptoContable, TxtObservaciones.Text.Trim, TxtObservaciones.Text.Trim, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=CveClasificacion, CveSubProyecto:=tCveSubProyecto, Contabilizable:=EsContabilizable) Then ErrorMovInv = True End If End If @@ -2401,7 +2406,7 @@ Partial Class Inventarios_EntradasSalidas ObjInventario.RollBack() 'deshace lo insertado CveMovimiento = 0 If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack() - Alert("Ocurrió un error al registrar los movimientos", TipoMensaje.MsgError) + 'Alert("Ocurrió un error al registrar los movimientos", TipoMensaje.MsgError) RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") End If End If @@ -2586,6 +2591,9 @@ Partial Class Inventarios_EntradasSalidas If CveMovimiento > 0 And Not EsNuevoMov Then + If Not DdlConcepto.SelectedValue.Contiene("10", "28") Then + TrResponsable.Visible = True + End If Exit Sub End If diff --git a/Nomina/CatSatConceptos.aspx.vb b/Nomina/CatSatConceptos.aspx.vb index b4b2cfb60..52f085ff2 100644 --- a/Nomina/CatSatConceptos.aspx.vb +++ b/Nomina/CatSatConceptos.aspx.vb @@ -17,14 +17,14 @@ Partial Class Nom_CatSatConceptos Public Sub CargaDatos() Dim GetConceptoSAT As New ClsNominas - If ObjConceptos.GetConceptos() Then - ViewState("DTConceptos") = ObjConceptos.DtResultados - GlobalDTNomSatConceptos = ObjConceptos.DtResultados + If GetConceptoSAT.GetConceptos(UsuarioActual.CveEmpresa) Then + ViewState("DTConceptos") = GetConceptoSAT.DtResultados + GlobalDTNomSatConceptos = GetConceptoSAT.DtResultados Else Me.GvDatos.DataSource = Nothing End If - ObjConceptos.Dispose() + GetConceptoSAT.Dispose() If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 6f84c33b8..728d18b1c 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -3693,7 +3693,7 @@ Partial Class OC_OC HuboError = True End If - Dim CveSubProyecto As Integer = UsuarioActual.CveSubProyecto + Dim CveSubProyecto As Integer = -1 If ModalidadSubProyectoGeneral Then CveSubProyecto = DdlSubProyectoGral.SelectedValue.ToEntero @@ -3708,7 +3708,7 @@ Partial Class OC_OC PorcentajeIVA:=PorIVA, IVA:=IVACot, RetIVA:=RetIVA.ToString.ToDecimal, RetISR:=RetISR.ToString.ToDecimal, IDPoliza:=IdPoliza, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, Promocion:=Promocion, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), - CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, DiasCreditoOC:=TxtDiasCreditoOC.Text.Toentero) Then + CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago, DiasCreditoOC:=TxtDiasCreditoOC.Text.ToEntero) Then 'CREA POLIZA POR CADA PROVEEDOR @@ -3777,7 +3777,7 @@ Partial Class OC_OC HuboError = True End If - Dim tCveSubProyecto As Integer = UsuarioActual.CveSubProyecto + Dim tCveSubProyecto As Integer = -1 If ModalidadSubProyectoGeneral Then tCveSubProyecto = DdlSubProyectoGral.SelectedValue.ToEntero If tCveSubProyecto <= 0 Then tCveSubProyecto = GetCveSubProyectoDetalles() diff --git a/OP/OP.aspx.vb b/OP/OP.aspx.vb index da0815cfa..2396263f4 100644 --- a/OP/OP.aspx.vb +++ b/OP/OP.aspx.vb @@ -921,12 +921,29 @@ Partial Class OP_OP End Sub Protected Sub BtnAceptarCancelacion_Click(sender As Object, e As EventArgs) + Dim EstatusCancelacion As String = GlobalDTOPEstatus(UsuarioActual.CveEmpresa).FiltroPrimeroValor("EstatusOP", "TipoEstatus=4") + Dim CveEstatusCancelacion As Integer = GlobalDTOPEstatus(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOP", "TipoEstatus=4").ToEntero() + If Not CveEstatusCancelacion > 0 Then + Alert("No se encontró el estatus de finalización de la OP.", TipoMensaje.MsgError) + Exit Sub + End If + Dim ObjInventario As New ClsInventarios() + Dim CveMovimientoSalida As Integer = 1 + Dim CveMovEntradaDev As Integer = 0 + Dim CveMovMerma As Integer = 1 Dim TieneError As Boolean = False Dim MensajeError As String = "" ObjInventario.IniciaTransacSQL() Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) Dim ObjOP As New ClsOP(ObjInventario.IniciaTransacSQL()) + Dim TipoMovimientoSalida As Integer = 26 + Dim TipoMovimientoEntrada As Integer = 27 + Dim TotalMP As Decimal = 0 + Dim TotalDevoluciones As Decimal = 0 + Dim TotalMermas As Decimal = 0 + + Dim Fecha As DateTime = NowADS() Try @@ -938,15 +955,10 @@ Partial Class OP_OP End If ' 1. Movimiento de Salida MP - Dim CveMovSalida As Integer = ObjInventario.AddMovimiento( - DdlAlmacenSalidaMP.SelectedValue.ToEntero(), 26, 1, NowADS, -1, - UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, - Observaciones:="Cancelación OP #" & LblFolio.Text) + CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacenSalidaMP.SelectedValue.ToEntero(), TipoMovimientoSalida, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="Cancelación OP #" & LblFolio.Text, Modulo:="OP/CancelanciónSalida") ' 2. Movimiento de Entrada Devoluciones - Dim CveMovEntradaDev As Integer = ObjInventario.AddMovimiento( - DdlAlmacenDevolucionCancel.SelectedValue.ToEntero(), 27, 1, NowADS, -1, - UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + CveMovEntradaDev = ObjInventario.AddMovimiento(DdlAlmacenDevolucionCancel.SelectedValue.ToEntero(), TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Modulo:="OP/CancelaciónEntrada", CveMovimientoRelacionado:=CveMovimientoSalida) ' 3. Procesar cada material For Each row As GridViewRow In GvMPCancelacion.Rows @@ -958,11 +970,16 @@ Partial Class OP_OP Throw New Exception("La suma de merma y devolución no puede exceder la cantidad") End If - Dim CvePS As Integer = GvMPCancelacion.DataKeys(row.RowIndex).Values(0) - Dim CveUM As Integer = GvMPCancelacion.DataKeys(row.RowIndex).Values(1) + TotalMP += Cantidad + TotalDevoluciones += Devolucion + TotalMermas += Merma + + Dim CvePS As Integer = row.DataKey("CvePSMateriaPrima").ToEntero + Dim CveUM As Integer = row.DataKey("CveUMMateriaPrima").ToEntero + ' Registrar salida - ObjInventario.AddMovimientoDetalle(CveMovSalida, Cantidad, CveUM, CvePS, 0) + ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUM, CvePS, 0) ' Registrar devolución If Devolucion > 0 Then @@ -971,17 +988,15 @@ Partial Class OP_OP Next ' 4. Registrar mermas si existen - Dim TotalMermas As Decimal = 0 + If DdlAlmacenMermas.SelectedValue <> "-1" Then - Dim CveMovMerma As Integer = ObjInventario.AddMovimiento( - DdlAlmacenMermas.SelectedValue.ToEntero(), 26, 1, NowADS, -1, - UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + CveMovMerma = ObjInventario.AddMovimiento(DdlAlmacenMermas.SelectedValue.ToEntero(), TipoMovimientoSalida, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Modulo:="OP/CancelaciónMerma", CveMovimientoRelacionado:=CveMovimientoSalida) For Each row As GridViewRow In GvMPCancelacion.Rows Dim Merma As Decimal = row.FCTextBox("TxtMerma").Text.ToDecimal() If Merma > 0 Then - Dim CvePS As Integer = GvMPCancelacion.DataKeys(row.RowIndex).Values(0) - Dim CveUM As Integer = GvMPCancelacion.DataKeys(row.RowIndex).Values(1) + Dim CvePS As Integer = row.DataKey("CvePSMateriaPrima").ToEntero + Dim CveUM As Integer = row.DataKey("CveUMMateriaPrima").ToEntero ObjInventario.AddMovimientoDetalle(CveMovMerma, Merma, CveUM, CvePS, 0) TotalMermas += Merma End If @@ -989,26 +1004,26 @@ Partial Class OP_OP End If ' 5. Generar pólizas contables - Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("OP/Cancelacion", 53, 0, 0, 1, NowADS, + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("OP/Cancelacion", 53, 0, 0, 1, Fecha, "Cancelación OP #" & LblFolio.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) ' Salida MP (Abono 68) - ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalMP, TotalMP, 68, "Salida MP Cancelación") + ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalMP, TotalMP, 68, "Cancelación MP OP #" & LblFolio.Text, "Cancelación MP OP #" & LblFolio.Text, CveMovimientoAlmacen:=CveMovimientoSalida) ' Entrada Devoluciones (Cargo 68) - ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalDevoluciones, TotalDevoluciones, 68, "Devoluciones Cancelación") + ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalDevoluciones, TotalDevoluciones, 68, "Devoluciones Cancelación OP #" & LblFolio.Text, "Devoluciones Cancelación OP #" & LblFolio.Text, CveMovimientoAlmacen:=CveMovEntradaDev) If TotalMermas > 0 Then ' Salida Mermas (Abono 68) - ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalMermas, TotalMermas, 68, "Mermas Cancelación") + ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, TotalMermas, TotalMermas, 68, "Mermas Cancelación OP #" & LblFolio.Text, "Mermas Cancelación OP #" & LblFolio.Text, CveMovimientoAlmacen:=CveMovMerma) ' Cargo Mermas (95) - ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalMermas, TotalMermas, 95, "Ajuste por Mermas") + ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalMermas, TotalMermas, 95, "Ajuste Mermas Cancelación OP #" & LblFolio.Text, "Ajuste Mermas Cancelación OP #" & LblFolio.Text) End If ' 6. Actualizar estatus OP - If ObjOP.UpdateEstatusOP(CveOP, 4, UsuarioActual.CveEmpresa) Then + If ObjOP.UpdateEstatusOP(CveOP, CveEstatusCancelacion, UsuarioActual.CveEmpresa) Then ObjInventario.Commit() TxtEstatus.Text = "Cancelado" BtnCancelarOP.Visible = False diff --git a/RH/CatPuesto.aspx b/RH/CatPuesto.aspx index e17c81fcb..767a65228 100644 --- a/RH/CatPuesto.aspx +++ b/RH/CatPuesto.aspx @@ -33,7 +33,7 @@ @@ -50,6 +50,11 @@ + + + + + @@ -129,6 +134,13 @@
+
+ + <%-- + --%> + +
+
diff --git a/RH/CatPuesto.aspx.vb b/RH/CatPuesto.aspx.vb index 7a3b71d3e..b386a540c 100644 --- a/RH/CatPuesto.aspx.vb +++ b/RH/CatPuesto.aspx.vb @@ -64,9 +64,6 @@ Partial Class RH_CatPuesto End Set End Property - - - Private Property DTArea As DataTable Get If ViewState("DTArea") Is Nothing Then @@ -134,17 +131,18 @@ Partial Class RH_CatPuesto CargaCatalogoOcupaciones() - If ObjPuestos.GetPuestos(UsuarioActual.CveEmpresa) Then - GvPuestos.DataSource = ObjPuestos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - - GlobalDTRHPuestos(UsuarioActual.CveEmpresa) = ObjPuestos.DtResultados + GvPuestos.DataSource = ObjPuestos.DtResultados Else Me.GvPuestos.DataSource = Nothing End If ObjPuestos.Dispose() GvPuestos.DataBind() + If UsuarioActual.CveEmpresa = 153 Then + GvPuestos.Columns(3).Visible = True + divValorxhora.Visible = True + End If UpDatos.Update() End Sub @@ -294,8 +292,6 @@ Partial Class RH_CatPuesto End If - - UpModalPuesto.Update() End Sub @@ -343,13 +339,13 @@ Partial Class RH_CatPuesto End If If CvePuesto = -1 And Actualizar = False Then - If ObjPuestos.AddPuesto(TxtPuesto.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlOcupacion.SelectedValue.ToEntero) Then - If ObjPuestos.GetPuestos(UsuarioActual.CveEmpresa) Then Application("GlobalDTRHPuestos") = ObjPuestos.DtResultados Else Application("GlobalDTRHPuestos") = Nothing + If ObjPuestos.AddPuesto(TxtPuesto.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlOcupacion.SelectedValue.ToEntero, TxtValorXHora.text.todecimal) Then + GlobalDTRHPuestos(UsuarioActual.CveEmpresa) = Nothing Alert("Puesto agregado correctamente.") End If Else - If ObjPuestos.UpdatePuesto(CvePuesto, TxtPuesto.Text.Trim, estatus, UsuarioActual.CveUsuario, DdlOcupacion.SelectedValue.ToEntero) Then - If ObjPuestos.GetPuestos(UsuarioActual.CveEmpresa) Then Application("GlobalDTRHPuestos") = ObjPuestos.DtResultados Else Application("GlobalDTRHPuestos") = Nothing + If ObjPuestos.UpdatePuesto(CvePuesto, TxtPuesto.Text.Trim, estatus, UsuarioActual.CveUsuario, DdlOcupacion.SelectedValue.ToEntero, TxtValorXHora.Text.ToDecimal) Then + GlobalDTRHPuestos(UsuarioActual.CveEmpresa) = Nothing Alert("Puesto actualizado correctamente.") End If End If @@ -388,6 +384,7 @@ Partial Class RH_CatPuesto CvePuesto = GvRow.DataKey("CvePuesto").ToEntero TxtPuesto.Text = GvRow.DataKey("Puesto") + TxtValorXHora.Text = GvRow.DataKey("ValorXHora").ToString LtlTituloModalPuesto.Text = "Editar Puesto" If Boolean.Parse(GvRow.DataKey("Estatus")) Then diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index 6cc73ef11..89e45b992 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -6,10 +6,6 @@ Imports System.IO Imports System.Data Imports Microsoft.Reporting.WebForms Imports System.Globalization - - - - Partial Class RH_Personal Inherits ClsPaginas @@ -2137,7 +2133,7 @@ Partial Class RH_Personal If Not ObjCuentasDeposito.AddCuentasDepositos(row("BancoNombre").ToString(), row("Plaza").ToString(), row("Sucursal").ToString(), row("Cuenta").ToString(), row("CLABE").ToString(), row("CIE").ToString(), row("SWIFT").ToString(), row("Referencia").ToString(), row("RefCrediProveedor").ToString(), UsuarioActual.CveUsuario, row("CveMoneda").ToString().ToEntero(), UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal, CveUsuarioModifico:=UsuarioActual.CveUsuario, - BBVAAlias:=row("BBVAAlias").ToString(), EstatusPagoElectronico:=Boolean.Parse(row("EstatusPagoElectronico").ToString), + CveSATBanco:=row("CveSATBanco").ToString.ToEntero, BBVAAlias:=row("BBVAAlias").ToString(), EstatusPagoElectronico:=Boolean.Parse(row("EstatusPagoElectronico").ToString), EstatusPagoElectronicoGrupos:=Boolean.Parse(row("EstatusPagoElectronicoGrupos").ToString), Correo:=row("Correo").ToString(), ConceptoCIE:=row("ConceptoCIE").ToString(), Estatus:=If(row("EstatusTexto").ToString = "Activo", True, False)) Then TieneError = True @@ -3095,8 +3091,6 @@ Partial Class RH_Personal End If End Sub #End Region - - Protected Sub DdlEstatusPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstatusPersonal.SelectedIndexChanged MostrarOcultarFechasEstatus() @@ -3133,8 +3127,6 @@ Partial Class RH_Personal End If - - e.Row.FCLinkButton("LBCancelar").Visible = True e.Row.FCLinkButton("LBCancelar").CommandArgument = e.Row.DBCampo("FolioFiscal") @@ -3153,7 +3145,6 @@ Partial Class RH_Personal e.Row.FCLinkButton("LBCancelar").Visible = True e.Row.FCLinkButton("LBCancelar").CommandArgument = e.Row.DBCampo("FolioFiscal") End If - End If End Sub @@ -3354,11 +3345,8 @@ Partial Class RH_Personal e.Row.FCLabel("LtlC").CssClass = "label label-sm label-warning" e.Row.FCLabel("LtlC").ForeColor = Drawing.Color.White End If - End If - End Sub - Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click If DtCuentasContables Is Nothing Then CargaCuentasContables() @@ -3377,10 +3365,6 @@ Partial Class RH_Personal DdlPrestamos.DataSource = DtCuentasContables : DdlPrestamos.DataBind() : DdlPrestamos.SelectedValueExist(SeleccionadoContPrestamos) DdlPrestamos.AutoPostBack = False : DdlPrestamos.Attributes.Remove("onclick") : DdlPrestamos.CssClass &= " select2me" End Select - - - - End Sub #Region "TAB BANCOS" Private Sub CargaMonedas() @@ -3417,10 +3401,6 @@ Partial Class RH_Personal TxtCorreoCuenta.Text = "" TxtBBVAAlias.Text = "" ChkPagoElectronicoGrupos.Checked = False - - - - UpAddBancos.Update() End Sub @@ -3441,6 +3421,7 @@ Partial Class RH_Personal Else If IndexCuentaDepostito > -1 Then Dim Row As DataRow = TempDTCuentasBancos.Rows(IndexCuentaDepostito) + Row("CveSATBanco") = DdlBancoSat.SelectedValue.ToEntero() Row("BancoNombre") = nombrebanco Row("Cuenta") = TxtNumeroCuenta.Text.Trim Row("Sucursal") = TxtNumeroSucursal.Text @@ -3460,7 +3441,6 @@ Partial Class RH_Personal Row("Correo") = TxtCorreoCuenta.Text.Trim Row("ConceptoCIE") = TxtConceptoCIE.Text Row("EstatusTexto") = If(ChkEstatuscuenta.Checked, "Activo", "Inactivo") - End If End If @@ -3504,7 +3484,6 @@ Partial Class RH_Personal Exit Sub End If - If ChkPagoElectronicoGrupos.Checked Then If TxtConvenioCIE.Text.Trim.Length > 0 Then @@ -3518,15 +3497,8 @@ Partial Class RH_Personal Alert("Se debe de especificar el banco.") Exit Sub End If - - - End If - End If - - - ''CUANDO SEA "BBVA" O "BANCOMER" DEBE TENER "CIE" O "CUENTA" 'If EsBancomer AndAlso Not (TxtNumeroCuenta.Text.Trim.Length = 10 Or TxtConvenioCIE.Text.Trim.Length = 6) Then ' Alert("Para cuentas BBVA BANCOMER es obligatorio el Número de Cuenta o CIE.", TipoMensaje.MsgAdvertencia) @@ -3562,8 +3534,6 @@ Partial Class RH_Personal Private Sub AgregarCuentaBanco(NombreBanco As String, NumeroSucursal As String, CLABE As String, SWIFT As String, Plaza As String, NumeroCuenta As String, ConvenioCIE As String, Referencia As String, RefCrediProveedor As String, CveMoneda As Integer, Moneda As String, Estatus As Boolean, Correo As String, BBVAAlias As String, CveSATBanco As Integer, EstatusPagoElectronico As Boolean, EstatusPagoElectronicoGrupos As Boolean, ConceptoCIE As String) - - If CvePersonal > 0 Then Using ObjCuentasBancos As New ClsGenerales() @@ -3582,6 +3552,7 @@ Partial Class RH_Personal If IndexCuentaDepostito > -1 Then Dim Row As DataRow = TempDTCuentasBancos.Rows(IndexCuentaDepostito) + Row("CveSATBanco") = CveSATBanco Row("BancoNombre") = NombreBanco Row("Sucursal") = NumeroSucursal Row("CLABE") = CLABE @@ -3594,7 +3565,6 @@ Partial Class RH_Personal Row("CveMoneda") = CveMoneda Row("Moneda") = Moneda Row("BBVAAlias") = BBVAAlias - Row("CveSATBanco") = CveSATBanco Row("EstatusPagoElectronico") = EstatusPagoElectronico Row("EstatusPagoElectronicoGrupos") = EstatusPagoElectronicoGrupos Row("Correo") = Correo @@ -3603,6 +3573,7 @@ Partial Class RH_Personal Else Dim Row As DataRow = TempDTCuentasBancos.NewRow + Row("CveSATBanco") = CveSATBanco Row("BancoNombre") = NombreBanco Row("Sucursal") = NumeroSucursal Row("CLABE") = CLABE @@ -3615,18 +3586,13 @@ Partial Class RH_Personal Row("CveMoneda") = CveMoneda Row("Moneda") = Moneda Row("BBVAAlias") = BBVAAlias - Row("CveSATBanco") = CveSATBanco Row("EstatusPagoElectronico") = EstatusPagoElectronico Row("EstatusPagoElectronicoGrupos") = EstatusPagoElectronicoGrupos Row("Correo") = Correo Row("ConceptoCIE") = ConceptoCIE TempDTCuentasBancos.Rows.Add(Row) Row("EstatusTexto") = If(ChkEstatuscuenta.Checked, "Activo", "Inactivo") - End If - - - End If LimpiaCuentasBancarias() @@ -3712,9 +3678,7 @@ Partial Class RH_Personal TxtCLABECB.Text = gvrow.DataKey("CLABE") ChkEstatusPagoE.Checked = gvrow.DataKey("EstatusPagoElectronico").ToUpper().Contiene("TRUE", "1") ChkEstatuscuenta.Checked = gvrow.DataKey("EstatusTexto").ToUpper().Contiene("TRUE", "1", "ACTIVO") - 'CveCuentaDeposito,BancoNombre,Sucursal,Cuenta,CLABE,SWIFT,Plaza,CIE,Referencia,RefCrediProveedor,CveMoneda,Estatus,Correo,BBVAAlias,EstatusPagoElectronico,EstatusPagoElectronicoGrupos,CveSATBanco,ConceptoCIE - 'DdlBancoSat TxtNombreBanco.Text = gvrow.DataKey("BancoNombre") TxtNumeroSucursal.Text = gvrow.DataKey("Sucursal") TxtSWIFT.Text = gvrow.DataKey("SWIFT") @@ -3728,18 +3692,10 @@ Partial Class RH_Personal ChkPagoElectronicoGrupos.Checked = Boolean.Parse(gvrow.DataKey("EstatusPagoElectronicoGrupos").ToString) ChkEstatuscuenta.Checked = If(gvrow.DataKey("EstatusTexto").ToString = "Activo", True, False) - - - 'CveCuentaDeposito,BancoNombre,Sucursal,Cuenta,CLABE,SWIFT,Plaza,CIE,Referencia,RefCrediProveedor,CveMoneda,Estatus,Correo,BBVAAlias,EstatusPagoElectronico,EstatusPagoElectronicoGrupos,CveSATBanco,ConceptoCIE,EstatusTexto - - 'asdasd - UpAddBancos.Update() RegistraScript("$('#DivAddCuentasBancarias').modal();") End Sub Protected Sub GvBancosCuentas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvBancosCuentas.RowEditing - - GvBancosCuentas.EditIndex = e.NewEditIndex CargaGridCuentasBancos("") End Sub @@ -3747,97 +3703,7 @@ Partial Class RH_Personal GvBancosCuentas.EditIndex = -1 CargaGridCuentasBancos("") End Sub - Protected Sub GvBancosCuentas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvBancosCuentas.RowUpdating - Dim NombreBanco As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNombreBanco").Text.Trim - Dim NumeroSucursal As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroSucursal").Text.Trim - Dim CLABE As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtCLABE").Text.Trim - Dim SWIFT As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtSWIFT").Text.Trim - Dim Plaza As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtPlaza").Text.Trim - Dim NumeroCuenta As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroCuenta").Text.Trim - Dim ConvenioCIE As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtConvenioCIE").Text.Trim - Dim Referencia As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtReferencia").Text.Trim - Dim CveMoneda As Integer = GvBancosCuentas.Rows(e.RowIndex).FCDropDownList("DdlMoneda").SelectedValue.ToString().ToEntero() - Dim Estatus As Boolean = GvBancosCuentas.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked - Dim EstatusPagoElectronico As Boolean = GvBancosCuentas.Rows(e.RowIndex).FCCheckBox("ChkEstatusPagoE").Checked - Dim Moneda As String = GvBancosCuentas.Rows(e.RowIndex).FCDropDownList("DdlMoneda").SelectedItem.Text - Dim BBVAAlias As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtBBVAAlias").Text - Dim RefCrediProveedor As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtRefCrediProveedor").Text.Trim - Dim EsBancomer As Boolean = False - - If NombreBanco.ToUpper.Contains("BBVA") Or NombreBanco.ToUpper.Contains("BANCOMER") Or (CLABE.Length = 18 AndAlso CLABE.Substring(0, 3) = "012") Then - EsBancomer = True - End If - - If EsBancomer AndAlso (CLABE.Length = 18 AndAlso Not CLABE.Substring(0, 3) = "012") Then - Alert("La CLABE ingresada no pertenece a BANCOMER.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - ''CLABE SIEMPRE OBLIGATORIA CUANDO NO ES BANCOMER CON CIE - 'If (CLABE.Trim.Length <> 18 And Not EsBancomer) Or (EsBancomer And ConvenioCIE.Trim.Length <> 6 And CLABE.Trim.Length <> 18) Then - ' Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - ' Exit Sub - 'End If - - 'CLABE SIEMPRE OBLIGATORIA SI NO ES BANCOMER - If CLABE.Trim.Length <> 18 And CLABE.Trim.Length = 0 And Not EsBancomer Then - Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - 'SI CUENTA TIENE ALGO Y BANCO BANCOMER DEBE TENER UNA LOGITUD EXACTA DE 10 - If NumeroCuenta.Trim.Length <> 0 AndAlso NumeroCuenta.Trim.Length <> 10 AndAlso EsBancomer Then - Alert("El número de cuenta debe tener una longitud de 10 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - 'SI CLABE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 18 - If CLABE.Trim.Length <> 0 AndAlso CLABE.Trim.Length <> 18 Then - Alert("La CLABE debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - 'SI CIE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 6 Y REFERENCIA OBLIGATORIA - If (ConvenioCIE.Trim.Length <> 0 And ConvenioCIE.Trim.Length <> 6) Or (ConvenioCIE.Trim.Length = 6 And Referencia.Trim.Length < 3) Then - Alert("El Convenio CIE debe tener una longitud de 6 dígitos y se debe especificar una referencia. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - 'CUANDO SEA "BBVA" O "BANCOMER" DEBE TENER "CIE" O "CUENTA" - If EsBancomer AndAlso Not (NumeroCuenta.Trim.Length = 10 Or ConvenioCIE.Trim.Length = 6) Then - Alert("Para cuentas BBVA BANCOMER es obligatorio el Número de Cuenta o CIE.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - Dim ObjCuentasBancos As New ClsGenerales - If CvePersonal > 0 Then - If ObjCuentasBancos.UpdateCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString().ToEntero(), NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, RefCrediProveedor, False, Estatus, CveMoneda, UsuarioActual.CveEmpresa, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=BBVAAlias, EstatusPagoElectronico:=EstatusPagoElectronico) Then - DTCuentasBancos.Clear() - DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CvePersonal = {0}", CvePersonal))) - Alert("Cuenta actualizada con exito.", TipoMensaje.MsgInformacion) - - End If - Else - Dim index As Integer = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString().ToEntero() - 1 - Dim Row As DataRow = TempDTCuentasBancos.Rows(index) - Row("BancoNombre") = NombreBanco - Row("Sucursal") = NumeroSucursal - Row("CLABE") = CLABE - Row("SWIFT") = SWIFT - Row("Plaza") = Plaza - Row("Cuenta") = NumeroCuenta - Row("CIE") = ConvenioCIE - Row("Referencia") = Referencia - Row("CveMoneda") = CveMoneda - Row("Moneda") = Moneda - TempDTCuentasBancos.AcceptChanges() - End If - ObjCuentasBancos.Dispose() - - GvBancosCuentas.EditIndex = -1 - CargaGridCuentasBancos("") - CargaGvBitacora() - End Sub Protected Sub GvBancosCuentas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvBancosCuentas.RowDeleting Dim ObjCuentasBancos As New ClsGenerales diff --git a/RH/Reclutamiento.aspx.vb b/RH/Reclutamiento.aspx.vb index a0ea99a16..6607d0ff3 100644 --- a/RH/Reclutamiento.aspx.vb +++ b/RH/Reclutamiento.aspx.vb @@ -779,6 +779,7 @@ Partial Class RH_Reclutamiento Try + GlobalDTDIOTTipoOperacion = Nothing Dim dt As DataTable = GlobalDTTipoPeriodo() diff --git a/Sistemas/CatSesiones.aspx b/Sistemas/CatSesiones.aspx index 69d602f93..72af665b2 100644 --- a/Sistemas/CatSesiones.aspx +++ b/Sistemas/CatSesiones.aspx @@ -67,11 +67,9 @@ -<<<<<<< HEAD - -======= + ->>>>>>> 5f99bce007430083b8e29bf39512f4aa4b51efae +    diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index 69bf4aabd..982be9602 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -110,14 +110,11 @@ Partial Class Sistemas_CatSesiones ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSATUsosCFDI" Then CargaUsosCFDI() ElseIf DdlVariable.SelectedItem.Value = "GlobalDTVtaCondicionesEntrega" Then - CargaCondicionesEntrega() -<<<<<<< HEAD + CargaCondicionesEntrega() ElseIf DdlVariable.SelectedItem.Value = "GlobalDTTipoVenta" Then - CargaTipoVenta() -======= + CargaTipoVenta() ElseIf DdlVariable.SelectedItem.Value = "GlobalDTDIOTTipoOperacion" Then - CargaDIOTTipoOperacion() ->>>>>>> 5f99bce007430083b8e29bf39512f4aa4b51efae + CargaDIOTTipoOperacion() End If diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb index ad0243b62..0c058efca 100644 --- a/Transportes/RepContratosCalendario.aspx.vb +++ b/Transportes/RepContratosCalendario.aspx.vb @@ -667,9 +667,7 @@ Partial Class RepContratosCalendario resp = ObjFacturaCancelacion.CancelarFactura(0, CancelacionPagos:=CancelacionPagos, ValidarSAT:=False) If resp.HuboError Then TieneError = True - Else - RegistraScript("$('#ModalActualizar').modal('hide');") - Alert("Actualizado Correctamente.") + Alert("Se presento un error al Actualizar el contrato (Cancelación de factura).") End If End If End If @@ -679,9 +677,13 @@ Partial Class RepContratosCalendario If TieneError Then ObjContratos.RollBack() + Alert("Se Presento un Error al Actualizar el Contrato.", TipoMensaje.MsgError) Else ObjContratos.Commit() + RegistraScript("$('#ModalActualizar').modal('hide');") + Alert("Contrato Actualizado Correctamente.") End If + ObjContratos.Dispose() objGenerales.Dispose() ObjVentas.Dispose() diff --git a/Ventas/ActualizarPrecios.aspx b/Ventas/ActualizarPrecios.aspx index 0053c508e..5e02a093d 100644 --- a/Ventas/ActualizarPrecios.aspx +++ b/Ventas/ActualizarPrecios.aspx @@ -42,58 +42,60 @@ outline: 0; } - table.adssigscroll { - min-width: 100%; - background-color:#fff; - } - - table.adssigscroll tbody,table.adssigscroll thead{ - background-color:#fff; - } - table.adssigscroll tr{ - background-color:inherit; - } - - - .divContainerads { - width: 100%; - max-height: calc(100vh - 260px); - overflow-y: auto; - } - - table.adssigscroll tr:nth-child(1) { - position: sticky; - top: 0; /* Se mantiene pegado en la parte superior */ - background-color: inherit; /* Para que no se superponga con otros elementos */ - z-index: 4; /* Asegura que esté sobre otros elementos */ - } - table.adssigscroll tr:nth-child(1) th:nth-child(1),table.adssigscroll tr:nth-child(1) th:nth-child(2) { - z-index: 5; - } - - table.adssigscroll tr:nth-child(2) { - top: 26.14px; - } - - table.adssigscroll tr td:nth-child(1),table.adssigscroll tr th:nth-child(1), - table.adssigscroll tr td:nth-child(2),table.adssigscroll tr th:nth-child(2) { - position: sticky; - left: 0; - z-index: 3; - } - - table.adssigscroll tr td:nth-child(1), table.adssigscroll tr td:nth-child(2) { - background-color: inherit; - } - - table.adssigscroll tr td:nth-child(1),table.adssigscroll tr th:nth-child(1) { - width: 21px; - max-width: 21px; - } - - table.adssigscroll tr td:nth-child(2),table.adssigscroll tr th:nth-child(2) { - left: 21px; + table.adssigscroll { + min-width: 100%; + background-color: #fff; + } + + table.adssigscroll tbody, table.adssigscroll thead { + background-color: #fff; } + + table.adssigscroll tr { + background-color: inherit; + } + + + .divContainerads { + width: 100%; + max-height: calc(100vh - 260px); + overflow-y: auto; + } + + table.adssigscroll tr:nth-child(1) { + position: sticky; + top: 0; /* Se mantiene pegado en la parte superior */ + background-color: inherit; /* Para que no se superponga con otros elementos */ + z-index: 4; /* Asegura que esté sobre otros elementos */ + } + + table.adssigscroll tr:nth-child(1) th:nth-child(1), table.adssigscroll tr:nth-child(1) th:nth-child(2) { + z-index: 5; + } + + table.adssigscroll tr:nth-child(2) { + top: 26.14px; + } + + table.adssigscroll tr td:nth-child(1), table.adssigscroll tr th:nth-child(1), + table.adssigscroll tr td:nth-child(2), table.adssigscroll tr th:nth-child(2) { + position: sticky; + left: 0; + z-index: 3; + } + + table.adssigscroll tr td:nth-child(1), table.adssigscroll tr td:nth-child(2) { + background-color: inherit; + } + + table.adssigscroll tr td:nth-child(1), table.adssigscroll tr th:nth-child(1) { + width: 21px; + max-width: 21px; + } + + table.adssigscroll tr td:nth-child(2), table.adssigscroll tr th:nth-child(2) { + left: 21px; + } @@ -105,18 +107,18 @@
  • Importar Listado
  • - - - -
  • + + + +
  • Exportar Excel -
  • -
    - - - -
    - + + + + + + +
    @@ -182,19 +184,19 @@
    -
    -
    +
    +
    -
    +
    - +
    Código Fin:
    -
    +
    @@ -225,22 +227,25 @@ +
    -
    -
    +
    +
    - - $ + + +
    -
    +
    @@ -281,7 +278,7 @@
    + OnRowDataBound="GVPrecios_RowDataBound"> @@ -289,7 +286,7 @@ - + @@ -299,13 +296,13 @@ - + - +
    - +
    -
    +
    @@ -316,14 +313,14 @@ --%> - - + + - - + + - + @@ -351,347 +348,349 @@
    - - - - - - - - - - Producto/Servicio - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + Producto/Servicio + + +
    + +
    +
    +
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    @@ -899,12 +898,25 @@ for (var i = 0; i < checks.length; i++) { if (checks[i].type == "checkbox") { - debugger; - if (checks[i].checked) { - idd = checks[i].id.replace('C_GVPrecios_chkPS_', '') + idd = checks[i].id.replace('C_GVPrecios_chkPS_', ''); if ($get('C_GVPrecios_TxtPrecio_' + idd) != null) { - $get('C_GVPrecios_TxtPrecio_' + idd).value = FormatoNumero(ToDouble(valor), 2); + let tipo = $get('HdnTipo').value; + + //ASIGNAR PRECIO NUEVO + if (tipo == '1') { + $get('C_GVPrecios_TxtPrecio_' + idd).value = FormatoNumero(ToDouble(valor), 2); + } + + //AUMENTAR PRECIO POR PORCENTAJE + if (tipo == '2') { + let precioActual = ToDouble($get('C_GVPrecios_LtlPrecio_' + idd).innerText.replace(" ", "").replace("$", "").replace(",","")); + + let precioNuevo = ToDouble(((valor / 100) * precioActual) + precioActual) + $get('C_GVPrecios_TxtPrecio_' + idd).value = FormatoNumero(precioNuevo, 2); + } + + } } diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index 3aaa0ed3a..f30e1a2a1 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -333,21 +333,25 @@ Partial Class Ventas_ActualizarPrecios End Sub Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) If RblTipo.SelectedValue = "Imp" Then - ImporteFijo.Visible = True + LtlImporte.Text = "Precio nuevo:" + LtlSimbolo.Text = "$" + HdnTipo.Value = "1" Else - ImporteFijo.Visible = False + LtlImporte.Text = "Porcentaje a incrementar:" + LtlSimbolo.Text = "%" + HdnTipo.Value = "2" End If UPPrecioLista.Update() End Sub Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click - If RblTipo.SelectedIndex = 1 And TxtPorcentaje.Text.ToDecimal = 0 Then - Alert("Se debe de especificar un porcentaje.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If + 'If RblTipo.SelectedIndex = 1 And TxtPorcentaje.Text.ToDecimal = 0 Then + ' Alert("Se debe de especificar un porcentaje.", TipoMensaje.MsgAdvertencia) + ' Exit Sub + 'End If Dim TieneError As Boolean = False 'Dim Importe As Decimal = If(TxtImporte.Text = "", -1, TxtImporte.Text.ToDecimal) - Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal) + Dim Porcentaje As Decimal = -1 ' If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal) Dim MensajeAlert As New StringBuilder Dim sbProductos As New StringBuilder @@ -356,7 +360,7 @@ Partial Class Ventas_ActualizarPrecios Try For Each row As GridViewRow In GVPrecios.Rows If row.FCCheckBox("chkPS").Checked Then - TieneError = Not ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, DdlPrecioLista.SelectedValue.ToEntero, Porcentaje, row.DataKey("CvePS").ToEntero, UsuarioActual.CveUsuario, NowADS(), If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal) + TieneError = Not ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, DdlPrecioLista.SelectedValue.ToEntero, Porcentaje, row.DataKey("CvePS").ToEntero, UsuarioActual.CveUsuario, NowADS(), True, PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal) If CBool(row.DataKey("ProductoExhibicion")) Then sbProductos.AppendFormat("{0},", row.DataKey("CvePS").ToEntero) End If @@ -396,7 +400,7 @@ Partial Class Ventas_ActualizarPrecios RegistraScript("$('#divAgregar').modal('hide')") TxtImporte.Text = "" TxtPrecio.Text = "" - TxtPorcentaje.Text = "" + 'TxtPorcentaje.Text = "" End Sub #Region "MODAL PRECIOS MINIMOS" @@ -679,8 +683,8 @@ Partial Class Ventas_ActualizarPrecios Dim StrMsgError As New StringBuilder If FranquiciasStr <> "" Then Dim Franquicias As String() = FranquiciasStr.Split(","c) - Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal) - + Dim Porcentaje As Decimal = -1 ' If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal) + For Each Franquicia As String In Franquicias Dim CveFranquicia As Integer = Franquicia.ToEntero Dim CvePS As Integer = GlobalDTPSSimplificado(CveFranquicia, Codigo:=Codigo).FiltroPrimeroValor("CvePS", "").ToEntero diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 11578c1be..dc316c96b 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -816,6 +816,7 @@ Partial Class Ventas_ClientesAbonar If DtSaldo IsNot Nothing AndAlso DtSaldo.Rows.Count = 1 Then Dim ImporteRef As Decimal = DtSaldo.SUM("Saldo", $"CveIE={DdlIngreso.SelectedValue.ToEntero()}") Dim tCveMonedaIE As Integer = DtSaldo.FiltroPrimeroValor("CveMoneda", "").ToEntero + CveMoneda = tCveMonedaIE Dim ImporteAbonar As Decimal = 0 Dim TC As Decimal = 1 'comparativo. @@ -866,18 +867,15 @@ Partial Class Ventas_ClientesAbonar Dim CveIE As Integer = -1 Dim CveVentasPago As New List(Of Integer) Dim SeriesPago As New List(Of String) - Dim MsgError As String = "" Dim NCGeneradas As New List(Of RespuestaNotaCredrito) Dim ListaFacturasGenerarNC As New List(Of Modelos.Factura) Dim ObjFacturaAnt As Modelos.Factura = Nothing Dim RespAnt As Modelos.Factura.MMensajeFactura = Nothing Dim ImporteSeleccionado As Decimal = 0 - '02-05-2018 MANDAMOS CANCELAR EL COMPLEMENTO A SUSTITUIR Dim ErrorCancelarIE As Boolean = False - Dim ObjIE As New ClsBancos() Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) Dim ObjVentasSaldos As New ClsVentas(ObjIE.IniciaTransacSQL) @@ -898,9 +896,7 @@ Partial Class Ventas_ClientesAbonar Dim ConceptoPoliza As String = String.Format("{0} {1}", TxtAboneA.Text, TxtObservaciones.Text) If DdlCuenta.SelectedValue.ToEntero > 0 Then - CveMoneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero - Else - CveMoneda = IfNull(Request("CveMoneda"), "1").ToString.ToEntero + CveMoneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $" CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero End If CvePrePoliza = ObjMov.AddPrePolizas("Ventas/ClientesAbonar", 11, TxtImporte.Text.Trim.ToDecimal, TxtImporte.Text.Trim.ToDecimal, 1, TxtFechaDocumento.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) @@ -909,9 +905,7 @@ Partial Class Ventas_ClientesAbonar Dim CveCuentaDeposito As Integer = 0 Dim TipoCambio As Decimal = 0 - If DdlCuentaDeposito.Items.Count > 0 Then - CveCuentaDeposito = DdlCuentaDeposito.SelectedValue.ToEntero - End If + If DdlCuentaDeposito.Items.Count > 0 Then CveCuentaDeposito = DdlCuentaDeposito.SelectedValue.ToEntero If CveMoneda = 2 Then If TxtTCDolares.Visible Then @@ -945,11 +939,7 @@ Partial Class Ventas_ClientesAbonar Else If RblTipoPago.SelectedValue.Contiene("3") Then 'ixc CveIE = DdlIngreso.SelectedValue.ToEntero - If CveMonedaPago = 2 And Not ChkPagarPesos.Checked Then CveMoneda = 2 - If ChkPagarDolares.Checked Then CveMoneda = 2 - If ChkPagarPesos.Checked Then CveMoneda = 1 End If - End If If CveIE > 0 OrElse RblTipoPago.SelectedValue.Contiene("2", "3") Then @@ -975,10 +965,8 @@ Partial Class Ventas_ClientesAbonar Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False) Dim TipoCambioFluctuacion As Decimal = 1 Dim FechaUltimaFluctuacion As Date = MinFecha - Dim tFecha As Date = TxtFechaDocumento.Text.ToDate Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) - Dim ImportePrestamo As Decimal = 0 Dim TCPrestamo As Decimal = 0 @@ -1017,7 +1005,6 @@ Partial Class Ventas_ClientesAbonar MsgError = "No se pudo insertar la póliza" End If End If - End If If TxtPrestamoIntereses.Text.ToDecimal <> 0 AndAlso MsgError = "" Then @@ -1074,8 +1061,7 @@ Partial Class Ventas_ClientesAbonar End If 'Tipos de cambio If Pago.CveMonedaPago = 1 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos - Pago.TCPago = TxtTC.Text.ToDecimal - Pago.ImportePago = (Pago.ImportePago * Pago.TCPago).RoundSQL + Pago.ImportePago = (Pago.ImportePago * TxtTC.Text.ToDecimal).RoundSQL ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES Pago.TCPago = If(TxtTCDolaresDolares.Visible, TxtTCDolaresDolares.Text.ToDecimal, TxtTCDolares.Text.ToDecimal) ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES diff --git a/Ventas/PVCobranza.aspx b/Ventas/PVCobranza.aspx index 6e138db07..d45efe15e 100644 --- a/Ventas/PVCobranza.aspx +++ b/Ventas/PVCobranza.aspx @@ -368,7 +368,7 @@ + DataKeyNames="CveVenta,CveCliente,TipoDocto,Saldo,AtencionA,CveFormaPago33,SerieFolio,CondicionesPago,PlazoCobranza,CveMoneda,Moneda"> <%----%> @@ -481,36 +481,29 @@
    -
    -
    -
    - Nombre: -
    +
    +
    Nombre:
             
    - -
    Folio:
    -
      
    - -
    +
    Folio:   
    +
    - -
    -
    - - - + +   + + +   + +
    -
    -
    @@ -682,7 +675,7 @@
    - +
    $ @@ -692,7 +685,7 @@
    - +
    $ @@ -701,7 +694,7 @@
    - +  
    @@ -713,6 +706,25 @@
    +
    +
    +
    + +
    + $ + + +
    +
    +
    + +
    + $ + + +
    +
    +
    @@ -727,6 +739,7 @@ +
    @@ -1239,7 +1252,7 @@ " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
    -
    +
    Total: @@ -1609,6 +1622,12 @@ } $get("TxtImporteContado").value = FormatoNumero(total, 2); + + //DOLARES + if ($get("HdnMoneda").value == "2") { + $get("TxtTotalMXN").value = FormatoNumero(ToDouble($get('TxtImporteContado').value) * ToDouble($get('TxtTC').value), 2); + } + } function CalculaDiferencia() { diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index 881be80e9..ffd4f05de 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -517,6 +517,17 @@ Partial Class Ventas_PVCobranza LtlNombre.Text = GvRow.DataKey("AtencionA") LtlFolio.Text = GvRow.DataKey("SerieFolio") LtlSaldo.Text = GvRow.DataKey("Saldo").ToDecimal.FormatoNumero + LtlMoneda.Text = GvRow.DataKey("Moneda") + + Dim CveMoneda As Integer = GvRow.DataKey("CveMoneda").ToEntero() + + HdnMoneda.Value = CveMoneda.ToString() + If CveMoneda = 2 Then + DivUSD.Visible = True + TxtTC.Text = GlobalTipoCambio(Now).ToString() + TxtTotalMXN.Text = (TxtImporteContado.Text.ToDecimal() * TxtTC.Text.ToDecimal()).FormatoNumero() + End If + HdnVentaCondicionesPago.Value = GvRow.DataKey("CondicionesPago") HdnPlazoCobranza.Value = GvRow.DataKey("PlazoCobranza") @@ -1262,6 +1273,11 @@ Partial Class Ventas_PVCobranza LtlTipoAnticipo.Text = "" TxtFaltante.Text = "" ChkSobFaltante.Checked = False + LtlMoneda.Text = "" + TxtTC.Text = "" + TxtTotalMXN.Text = "" + DivUSD.Visible = False + HdnMoneda.Value = "1" 'HdnTipoAmortizacion.Value = "" CveCliente = -1 CveVendedor = -1 @@ -1318,7 +1334,7 @@ Partial Class Ventas_PVCobranza ObjFactura.CveMoneda = VentaRemision.CveMoneda If ObjFactura.CveMoneda = 2 Then - ObjFactura.TipoCambio = GlobalTipoCambio(Now).ToString().ToDecimal() + ObjFactura.TipoCambio = TxtTC.Text.ToDecimal() Else ObjFactura.TipoCambio = 1 End If @@ -1699,6 +1715,9 @@ Partial Class Ventas_PVCobranza Dim CveIEPago As Integer = 0 Dim ErrorConta As Boolean + Dim CveMonedaVenta As Integer = VentaActual.CveMoneda + Dim CveMonedaPago As Integer = CveMonedaVenta + If String.IsNullOrEmpty(Obs) Then Obs = $"Folio: {VentaActual.SerieFolio}" Else @@ -1750,7 +1769,7 @@ Partial Class Ventas_PVCobranza End If If String.IsNullOrEmpty(Retorno) Then - CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImporteIE, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto) + CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImporteIE, CveMonedaPago, If(CveMonedaVenta = 1, 1, TxtTC.Text.ToDecimal()), Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto, Modulo:="PVCob") If CveIEPago > 0 Then Dim tImportePago As Decimal = If(ImporteBancos > ImporteAbonoVenta, ImporteAbonoVenta, ImporteBancos) 'toma el importe menor para la factura @@ -1759,10 +1778,10 @@ Partial Class Ventas_PVCobranza Pago.ImportePagoVenta = tImportePago Pago.ImportePago = ImporteIE Pago.CveIE = CveIEPago - Pago.CveMonedaPago = VentaActual.CveMoneda + Pago.CveMonedaPago = CveMonedaPago ' EL PAGO SIEMRE DEBE SER EN PESOS Pago.Fecha = NowADS() Pago.Referencia = VentaActual.SerieFolio - If Pago.CveMonedaPago > 1 Then Pago.TCPago = GlobalTipoCambio(Now).ToDecimal + Pago.TCPago = If(CveMonedaVenta = 1, 1, TxtTC.Text.ToDecimal()) ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta) End If @@ -3092,6 +3111,9 @@ Partial Class Ventas_PVCobranza Next TxtCxCAplicado.Text = (SaldoCxC).FormatoNumero TxtImporteContado.Text = (LtlSaldo.Text.ToDecimal + SaldoCxC).FormatoNumero + If DivUSD.Visible Then + TxtTotalMXN.Text = (TxtImporteContado.Text.ToDecimal() * TxtTC.Text.ToDecimal()).FormatoNumero() + End If RegistraScript("$('#divCxC').hide();", "AE21") UPPCobranza.Update() UPPTotalesContado.Update() diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index de094ebf7..f46fe49a4 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -3366,7 +3366,9 @@ Partial Class ProductosyServicios CveMedida:=CveMedida, CveRinTamaño:=CveRin, ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, - TiempoCaducidad:=TxtTiempoCaducidad.Text.ToEntero()) > 0 Then + TiempoCaducidad:=TxtTiempoCaducidad.Text.ToEntero(), + AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked + ) > 0 Then 'Alert(String.Format("Error al agregar el nuevo producto en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa"))) Return True diff --git a/Ventas/RepAnticipo-NC-IXCAplicados.aspx b/Ventas/RepAnticipo-NC-IXCAplicados.aspx index c47a680dd..f3474a5bc 100644 --- a/Ventas/RepAnticipo-NC-IXCAplicados.aspx +++ b/Ventas/RepAnticipo-NC-IXCAplicados.aspx @@ -87,26 +87,14 @@
    - - - - - - - -
    AnticiposNotas de créditoIngresos por Comprobar
    - + + + + + - - - + + + diff --git a/Ventas/RepAnticipo-NC-IXCAplicados.aspx.cs b/Ventas/RepAnticipo-NC-IXCAplicados.aspx.cs index 8bd231733..d5c7b9ede 100644 --- a/Ventas/RepAnticipo-NC-IXCAplicados.aspx.cs +++ b/Ventas/RepAnticipo-NC-IXCAplicados.aspx.cs @@ -55,7 +55,6 @@ public partial class Ventas_RepAnticipo_NC_IXCAplicados : ClsPaginas Vendedor = 0; CargaSucursales(); CargaClientes(); - CargaVendedores(); CargaDatos(); } @@ -77,13 +76,6 @@ public partial class Ventas_RepAnticipo_NC_IXCAplicados : ClsPaginas DdlCliente.setEsWebService(true); DdlCliente.Attributes.Add("data-metodo", "getcliente"); } - protected void CargaVendedores() - { - DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa); - DdlVendedor.DataBind(); - DdlVendedor.Items.Insert(0, new ListItem("Todos", "-1")); - //DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor); - } protected void CargaDatos() { @@ -99,20 +91,26 @@ public partial class Ventas_RepAnticipo_NC_IXCAplicados : ClsPaginas CveCliente = DdlCliente.SelectedValue.ToEntero(); } if (ObjVenta.GetRepAnticiposNCIXCAplicados(CveCliente, DdlSucursal.SelectedValue.ToEntero(), ModExtensiones.MinFecha, - ModExtensiones.MaxFecha, UsuarioActual.CveEmpresa, FechaICorte, FechaFCorte, TipoCambio, TCEspecifico, DdlVendedor.SelectedValue.ToEntero(), DdlConSaldo.SelectedValue.ToEntero())) + ModExtensiones.MaxFecha, UsuarioActual.CveEmpresa, FechaICorte, FechaFCorte, TipoCambio, TCEspecifico, -1, -1)) { - GvDatos.DataSource = ObjVenta.DtResultados; - DtDatos = ObjVenta.DtResultados; + DtDatos = ObjVenta.DtResultados.Copy(); } ObjVenta.Dispose(); + + GvDatos.DataSource = DtDatos; + + GvDatos.Columns[2].Visible = ChkAnticipos.Checked; + GvDatos.Columns[3].Visible = ChkNCxAplicar.Checked; + GvDatos.Columns[4].Visible = ChkIngresosxComprobar.Checked; + GvDatos.DataBind(); + UpDatos.Update(); } protected void BtnConsultar_Click(object sender, EventArgs e) { CargaDatos(); - Vendedor = DdlVendedor.SelectedIndex; } protected void LnkExcel_Click(object sender, EventArgs e) @@ -132,38 +130,49 @@ public partial class Ventas_RepAnticipo_NC_IXCAplicados : ClsPaginas //String FechaF; //if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = ""; } else { FechaF = $" Fecha Final: {txtFechaF.Text}"; } String FechaICorte; - if (TxtFechaICorte.Text == "" || TxtFechaICorte.Text == "__/__/____") { FechaICorte = ""; } else { FechaICorte = $" Fecha Inicial Corte: {TxtFechaICorte.Text}"; } + if (TxtFechaICorte.Text == "" || TxtFechaICorte.Text == "__/__/____") { FechaICorte = ""; } else { FechaICorte = $" Fecha Inicial: {TxtFechaICorte.Text}"; } String FechaFCorte; - if (TxtFechaFCorte.Text == "" || TxtFechaFCorte.Text == "__/__/____") { FechaFCorte = ""; } else { FechaFCorte = $" Fecha Final Corte: {TxtFechaFCorte.Text}"; } + if (TxtFechaFCorte.Text == "" || TxtFechaFCorte.Text == "__/__/____") { FechaFCorte = ""; } else { FechaFCorte = $" Fecha Final: {TxtFechaFCorte.Text}"; } String Sucursal; if (DdlSucursal.SelectedValue != "-1") { Sucursal = $" Sucursal: {DdlSucursal.SelectedItem.Text}"; } else { Sucursal = ""; } String Cliente; - if (DdlCliente.SelectedValue != "-1") { Cliente = $" Cliente: {DdlCliente.SelectedText}"; } else { Cliente = ""; } + if (!DdlCliente.SelectedValue.Contiene("-1","")) { Cliente = $" Cliente: {DdlCliente.SelectedText}"; } else { Cliente = ""; } if (DtDatos.Rows.Count > 0) { + System.IO.FileInfo Imagen = new System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png"); String logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa); - List para = new List(); - para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)); - para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); - para.Add(new ReportParameter("FechaImpresion", NowADS().ToString())); - para.Add(new ReportParameter("AgrupadoPor", $"Agrupado Por: {Cliente}{Sucursal}{FechaICorte}{FechaFCorte}")); - - - - para.Add(new ReportParameter("MostarAnticipos", ChkAnticipos.Checked ? "1" : "0")); - para.Add(new ReportParameter("MostarNCxAplicar", ChkNCxAplicar.Checked ? "1" : "0")); - para.Add(new ReportParameter("MostarIngresosxComprobar", ChkIngresosxComprobar.Checked ? "1" : "0")); - - if (Imagen.Exists) + string AgrupadoPor = $"{Cliente}{Sucursal}{FechaICorte}{FechaFCorte}"; + if (Opcion == "PDF") { - para.Add(new ReportParameter("LogoPath", logouri)); + List para = new List(); + para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)); + para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); + para.Add(new ReportParameter("FechaImpresion", NowADS().ToString())); + para.Add(new ReportParameter("AgrupadoPor", $"Agrupado Por: {AgrupadoPor}")); + + + + para.Add(new ReportParameter("MostarAnticipos", ChkAnticipos.Checked ? "1" : "0")); + para.Add(new ReportParameter("MostarNCxAplicar", ChkNCxAplicar.Checked ? "1" : "0")); + para.Add(new ReportParameter("MostarIngresosxComprobar", ChkIngresosxComprobar.Checked ? "1" : "0")); + + if (Imagen.Exists) + { + para.Add(new ReportParameter("LogoPath", logouri)); + } + else + { + para.Add(new ReportParameter("LogoPath", "")); + } + ImprimirPDF("Empresas/Grales/Formatos/RepAnt-NC-IXCAplicados.rdlc", DtDatos, para, "Reporte de aplicaciones de Anticipos - NC - IXC", Opcion); } else { - para.Add(new ReportParameter("LogoPath", "")); + var TextoFiltro = AgrupadoPor.Replace(" ", "").Replace("", "").Replace("", ""); + + GvDatos.ExportToExcelGembox("RepAnticiposNCIxCAplicados", UsuarioActual, "Reporte de aplicaciones de Anticipos - NC - Ingresos X Comprobar", DatosFiltros: TextoFiltro, AlturaImagen: 0, AnchoImagen: 0); } - ImprimirPDF("Empresas/Grales/Formatos/RepAnt-NC-IXC.rdlc", DtDatos, para, "Reporte de Anticipos - NCXAplicar - IXC", Opcion); } else { @@ -171,6 +180,10 @@ public partial class Ventas_RepAnticipo_NC_IXCAplicados : ClsPaginas } } + public override void VerifyRenderingInServerForm(System.Web.UI.Control control) + { + } + protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) @@ -197,6 +210,30 @@ public partial class Ventas_RepAnticipo_NC_IXCAplicados : ClsPaginas } } + if (e.Row.DBCampo("CveCliente").ToEntero() > 0) + { + if (e.Row.DBCampo("Tipo").ToEntero() == 0) + { + e.Row.CssClass = "SubTotales"; + } + + switch (e.Row.DBCampo("Tipo")) + { + case "0": + e.Row.FCHyperLink("HLFolio").NavigateUrl = string.Format("/Ventas/Clientes.aspx?CveCliente={0}", e.Row.DBCampo("CveCliente").ToEntero()); + break; + case "1": + e.Row.FCHyperLink("HLFolio").NavigateUrl = string.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DBCampo("Id").ToEntero()); + break; + case "2": + e.Row.FCHyperLink("HLFolio").NavigateUrl = string.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DBCampo("Id").ToEntero()); + break; + case "3": + e.Row.FCHyperLink("HLFolio").NavigateUrl = string.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("Id").ToEntero()); + break; + } + } + } } diff --git a/Ventas/RepVentas.aspx.vb b/Ventas/RepVentas.aspx.vb index f2495b84c..be58e771b 100644 --- a/Ventas/RepVentas.aspx.vb +++ b/Ventas/RepVentas.aspx.vb @@ -301,9 +301,6 @@ Partial Class Ventas_RepVentas Dim Vendedores As String = If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM) Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero) - If TipoComprobante.Contiene("Rem") And Not Estatus.Contiene("11") Then - Estatus = Estatus & ",11" - End If If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then TCEspecifico = TxtEspecifico.Text.ToDecimal diff --git a/Ventas/RepVentasDetalle.aspx b/Ventas/RepVentasDetalle.aspx index bf70f132e..8eae12709 100644 --- a/Ventas/RepVentasDetalle.aspx +++ b/Ventas/RepVentasDetalle.aspx @@ -637,6 +637,12 @@ + <%-- 46--%> + + + + + @@ -835,7 +841,15 @@ - + + + + + + + + + diff --git a/Ventas/RepVentasDetalle.aspx.vb b/Ventas/RepVentasDetalle.aspx.vb index dce07676e..ea1b0561f 100644 --- a/Ventas/RepVentasDetalle.aspx.vb +++ b/Ventas/RepVentasDetalle.aspx.vb @@ -459,10 +459,6 @@ Partial Class RepVentasDetalle FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.Trim.ToDate, MinFecha) FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim.ToDate, MaxFecha) - If TipoComprobante.Contiene("Rem") And Not Estatus.Contiene("11") Then - Estatus = Estatus & ",11" - End If - Dim ModalidadContable As Boolean = CBool(If(Request("ModalidadContable") IsNot Nothing, Request("ModalidadContable").ToEntero(), 0)) ChkLecturaAdmin.Checked = Not ModalidadContable @@ -1068,6 +1064,7 @@ Partial Class RepVentasDetalle GvDatos.Columns(43).Visible = ChkDescargarXML.Checked GvDatos.Columns(44).Visible = ChkDescargarPDF.Checked GvDatos.Columns(45).Visible = ChkTipoVenta.Checked + GvDatos.Columns(46).Visible = ChkFechaHora.Checked Personalizo = 1 If Personalizo = 1 Then diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index b060a909e..b6b2b0452 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -1127,8 +1127,8 @@ Predial - Ed. Med - + Ed. Med + IVA IEPS @@ -1262,8 +1262,7 @@ - - + @@ -4726,6 +4725,54 @@
    + + +
    - +
    diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 4e80b42c6..6a1f26e93 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3667,11 +3667,22 @@ Partial Class Ventas InicializaDevolucionAlmacen() + HabilitarDescuentoGlobal() + End If + + End Sub + + Private Sub HabilitarDescuentoGlobal() + If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.CveEmpresa.Contiene(181, 182, 183) AndAlso (CveVenta <= 0 OrElse EsCreaApartirDe) Then + ImgDescTotal.Visible = True + ImgDescTotal.Attributes.Add("onclick", "javascript:$('#ModalDescuentoGlobal').modal();") + End If End Sub #Region "Bloqueo Pantalla" + Private Sub ValidaUsuarioAcceso() 'VERIFICAR SI LA SESION SE ENCUENTRA BLOQUEADA If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then @@ -10670,6 +10681,10 @@ Partial Class Ventas End If End If + If Not ValidaPSSoloCotizacion() Then + Exit Sub + End If + 'CREA UNA COPIA DE SEGURIDAD PARA LOS DATOS DEL TMPDT If TmpDTError Is Nothing OrElse TmpDTError.Rows.Count = 0 Then TmpDTError = TmpDT.Copy() @@ -17535,9 +17550,9 @@ Partial Class Ventas saldo = (e.Row.DataKey("Saldo").ToString().ToDecimal * tipoCambio).TruncateDecimal Else saldo = e.Row.DataKey("Saldo").ToDecimal - End If - Else - saldo = e.Row.DataKey("Saldo").ToString().ToDecimal + End If + Else + saldo = e.Row.DataKey("Saldo").ToString().ToDecimal If CveVenta <= 0 Then If DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("2") Then 'cuando es por NC, debe de tomar el total de su saldo respectivo @@ -18588,6 +18603,25 @@ Partial Class Ventas RegistraScript("$('#ModalDescuento').modal('hide')", "hidemodal") UpPS.Update() End Sub + + Protected Sub BtnAplicarDescGlobal_Click(sender As Object, e As System.EventArgs) Handles BtnAplicarDescGlobal.Click + Dim DescuentoManual As Decimal = TxtMontoDescGlobal.Text.ToDecimal() + Dim PorcentajeDescuento As Decimal = TxtPorDescGlobal.Text.ToDecimal() + + If DescuentoManual <> 0 AndAlso PorcentajeDescuento <> 0 Then + Alert("Debe elegir un solo tipo de descuento", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If PorcentajeDescuento > 100 Then + Alert("El porcentaje no puede ser mayor a 100", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + RecalculaPrecios(False, False, AplicarDescuentoGlobal:=True) + RegistraScript("$('#ModalDescuentoGlobal').modal('hide')", "hidemodal") + UpPS.Update() + End Sub Private Sub BtnAplicarOtrosConceptos_Click(sender As Object, e As EventArgs) Handles BtnAplicarOtrosConceptos.Click TotalOtrosConceptos = 0 @@ -19914,6 +19948,36 @@ Partial Class Ventas Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click AgregarPS() End Sub + + Private Function ValidaPSSoloCotizacion() As Boolean + Dim Returno As Boolean = True + If UsuarioActual.Empresa.Funcionalidad(720) <> "" AndAlso DdlTipoComprobante.SelectedValue <> "Cot" Then + Dim ProductosSoloCotizacion As List(Of String) = UsuarioActual.Empresa.Funcionalidad(720).Split(","c).ToList() + + If ProductosSoloCotizacion IsNot Nothing AndAlso ProductosSoloCotizacion.Count > 0 Then + + For Each GvRow As GridViewRow In GvPS.Rows + If GvRow.RowType = DataControlRowType.DataRow Then + Dim CvePS As String = GvRow.DataKey("CvePS") + If ProductosSoloCotizacion.Any(Function(CvePSCot) CvePSCot.Trim() = CvePS) Then + Dim PSCot As String = "" + Dim DrPSCot As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS.ToEntero()).Rows(0) + If DrPSCot IsNot Nothing Then + PSCot = DrPSCot("PSCodigo").ToString + End If + + Alert($"El producto y/o servicio '{PSCot}' está disponible únicamente para cotizaciones.", TipoMensaje.MsgAdvertencia) + Returno = False + Exit For + End If + End If + Next + End If + End If + + Return Returno + End Function + Private Function ValidaAgregarPS(Cantidad As Decimal, CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer, CveClasificacion As Integer, CveSubProyecto As Integer, ObjDescuento As Modelos.VentaDescuentos, Optional CantidadModal As Decimal = 0D, Optional PSValidarModal As String = "", Optional CantidadOriginal As Decimal = 0D, Optional EsEdicion As Boolean = False) As Boolean 'NO TOCAR - IPP 'VALIDA PARAMETROS @@ -19922,6 +19986,23 @@ Partial Class Ventas Return False End If + 'VALIDA PS DE COTIZACION + If UsuarioActual.Empresa.Funcionalidad(720) <> "" Then + Dim ProductosSoloCotizacion As List(Of String) = UsuarioActual.Empresa.Funcionalidad(720).Split(","c).ToList() + If ProductosSoloCotizacion IsNot Nothing AndAlso ProductosSoloCotizacion.Count > 0 Then + If DdlTipoComprobante.SelectedValue <> "Cot" AndAlso ProductosSoloCotizacion.Any(Function(CvePSCot) CvePSCot.Trim() = CvePS.ToString()) Then + Dim PSCot As String = "" + Dim DrPSCot As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0) + If DrPSCot IsNot Nothing Then + PSCot = DrPSCot("PSCodigo").ToString + End If + + Alert($"El producto y/o servicio '{PSCot}' está disponible únicamente para cotizaciones.", TipoMensaje.MsgAdvertencia) + Return False + End If + End If + End If + If PSValidarModal.Trim.Length > 0 Then HdnPS.Value = PSValidarModal End If @@ -23058,7 +23139,7 @@ Partial Class Ventas Dim CantidadRemision As Decimal = DtRemisionesTmpDT.FiltroPrimeroValor("Cantidad", $"CveVentaDetalleRemision={MovDet("CveVentaDetalle").ToString()}").ToDecimal Dim CantidadInventario As Decimal = MovDet("Cantidad").ToString().ToDecimal - If RemisionesLista.Count > 0 AndAlso ChkRemProductos.Checked AndAlso CantidadInventario >= CantidadRemision Then + If RemisionesLista.Count > 0 AndAlso CantidadInventario >= CantidadRemision Then Cantidad = CantidadRemision Else Cantidad = CantidadInventario @@ -40745,9 +40826,16 @@ Partial Class Ventas RegistraScript("MuestraAnticipos();", "AE") End Sub - Private Sub RecalculaPrecios(ByRef RecalculoPromociones As Boolean, Optional AplicarPromociones As Boolean = False) + Private Sub RecalculaPrecios(ByRef RecalculoPromociones As Boolean, Optional AplicarPromociones As Boolean = False, Optional AplicarDescuentoGlobal As Boolean = False) Dim PuedeRecalcular As Boolean = False + Dim DescuentoManual As Decimal = 0, DescuentoPorcentaje As Decimal = 0 + + If AplicarDescuentoGlobal Then + DescuentoManual = TxtMontoDescGlobal.Text.ToDecimal() + DescuentoPorcentaje = TxtPorDescGlobal.Text.ToDecimal() + End If + If CveVenta <= 0 OrElse EsCreaApartirDe OrElse (ModalidadEdicion AndAlso Not DdlTipoComprobante.SelectedValue = "Cot") Then PuedeRecalcular = True End If @@ -40761,19 +40849,25 @@ Partial Class Ventas PuedeRecalcular = True End If + If AplicarDescuentoGlobal Then + PuedeRecalcular = True + End If + If TmpDT IsNot Nothing AndAlso PuedeRecalcular Then For Each Row As DataRow In TmpDT.Rows Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() Dim CveClasificacion As Integer = Row("CveClasificacion").ToString().ToEntero Dim CvePS As Integer = Row("CvePS").ToString().ToEntero + Dim CodigoPS As String = Row("CodigoPS").ToString() + Dim PUOriginal As Decimal = Row("PU").ToString().ToDecimal() Dim CvePrecioListaSugerido As Integer = -1 Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = Nothing - If AplicarPromociones Then + If AplicarPromociones OrElse AplicarDescuentoGlobal Then ObjPrecioSugerido = New Modelos.MPrecioSugerido() - ObjPrecioSugerido.PrecioSugerido = Row("PU").ToString().ToDecimal() + ObjPrecioSugerido.PrecioSugerido = PUOriginal ObjPrecioSugerido.CvePrecioLista = Row("CvePrecioLista").ToString().ToEntero() Else ObjPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion) @@ -40783,8 +40877,30 @@ Partial Class Ventas Dim PU As Decimal = ObjPrecioSugerido.PrecioSugerido.RoundSQL(6) Dim ObjDescuento As Modelos.VentaDescuentos = CalcularDescuentos(CvePS, Cantidad, PU) - If ObjDescuento.EsPUModificado Then - PU = ObjDescuento.PU + If AplicarDescuentoGlobal Then + + If DescuentoManual > 0 Then + ObjDescuento.EsPUModificado = False + ObjDescuento.ImporteDescuento = DescuentoManual + ObjDescuento.ImporteProntoPago = 0 + + If ObjDescuento.ImporteDescuento > (Cantidad * PU) Then + Alert($"El producto y/o servicio '{CodigoPS}' no puede tener un descuento mayor al total", TipoMensaje.MsgAdvertencia) + Continue For + End If + + End If + + If DescuentoPorcentaje > 0 Then + ObjDescuento.EsPUModificado = False + ObjDescuento.ImporteDescuento = (Cantidad * PU) * (DescuentoPorcentaje / 100D) + ObjDescuento.ImporteProntoPago = 0 + End If + + Else + If ObjDescuento.EsPUModificado Then + PU = ObjDescuento.PU + End If End If 'SI NO TIENE PROMOCION, NO MODIFICAR NADA