+
+
+
+
+<%--
+
+
+
+ --%>
+
+
+
+
+
+
+
+
-
+ <%--
+ --%>
diff --git a/AF/CatAF.aspx.vb b/AF/CatAF.aspx.vb
index 239c3235c..e8dfe0bfd 100644
--- a/AF/CatAF.aspx.vb
+++ b/AF/CatAF.aspx.vb
@@ -32,6 +32,19 @@ Partial Class AF_CatAF
ViewState("DTAFCaracteristicas") = value
End Set
End Property
+
+ Private Property DtDatos As DataTable
+ Get
+ If ViewState("DtDatos") Is Nothing Then
+ ViewState("DtDatos") = New DataTable
+ End If
+ Return DirectCast(ViewState("DtDatos"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DtDatos") = value
+ End Set
+ End Property
+
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -46,6 +59,9 @@ Partial Class AF_CatAF
CargaDatos()
End If
+ CargaPersonalizacion()
+
+
End If
End Sub
@@ -278,7 +294,7 @@ Partial Class AF_CatAF
GvDatos.DataSource = DtActivosFijos
GvDatos.DataBind()
- 'LtlTotalRegistros.Text = DtActivosFijos.Rows.Count.ToString.FormatoNumero(0)
+ LtlTotalRegistros.Text = DtActivosFijos.Rows.Count.ToString.FormatoNumero(0)
UpGV.Update()
OrdenaDatos()
@@ -492,5 +508,251 @@ Partial Class AF_CatAF
#End Region
+#Region " P E R S O N A L I Z A R C O L U M N A S "
+ Protected Sub LnkPersonalizar_Click(sender As Object, e As EventArgs)
+
+ ChkGuardarPersonalizacion.Checked = False
+ RegistraScript("$('#DivPersonalizar').modal('show')")
+
+ End Sub
+
+ Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
+
+ If ChkGuardarPersonalizacion.Checked Then
+ GuardaPersonalizacion()
+ End If
+
+ Personaliza()
+ CargaGvDatos()
+ UpGV.Update()
+
+ End Sub
+
+
+
+ Private Sub GuardaPersonalizacion()
+
+ Dim objUsuario As New ClsSisUsuarios
+ Dim ListPersonalizada As New List(Of String)
+
+ If ChkCodigo.Checked Then ListPersonalizada.Add("Codigo")
+
+ If ChkDescripcion.Checked Then ListPersonalizada.Add("Descripcion")
+
+ If ChkTipoActivoFijo.Checked Then ListPersonalizada.Add("TipoActivoFijo")
+
+ If ChkSubTIpoActivoFijo.Checked Then ListPersonalizada.Add("SubTIpoActivoFijo")
+
+ If ChkResponsable.Checked Then ListPersonalizada.Add("Responsable")
+
+ If ChkNoSerie.Checked Then ListPersonalizada.Add("NoSerie")
+
+ If ChkAño.Checked Then ListPersonalizada.Add("Año")
+
+ If ChkSubProyecto.Checked Then ListPersonalizada.Add("SubProyecto")
+
+ If ChkEstadoActivoFijo.Checked Then ListPersonalizada.Add("EstadoActivoFijo")
+
+ If ChkFechaIng.Checked Then ListPersonalizada.Add("FechaIng")
+
+ If ChkGrupo.Checked Then ListPersonalizada.Add("Grupo")
+
+ If ChkMarcaActivoFijo.Checked Then ListPersonalizada.Add("MarcaActivoFijo")
+
+ If ChkModeloActivoFijo.Checked Then ListPersonalizada.Add("ModeloActivoFijo")
+
+ If ChkNombreCuenta.Checked Then ListPersonalizada.Add("NombreCuenta")
+
+ If ChkValorCompra.Checked Then ListPersonalizada.Add("ValorCompra")
+
+ If ChkFechaCompra.Checked Then ListPersonalizada.Add("FechaCompra")
+
+ If ChkFechaBaja.Checked Then ListPersonalizada.Add("FechaBaja")
+
+ If ChkProyecto.Checked Then ListPersonalizada.Add("Proyecto")
+
+ 'If ChkSubProyecto.Checked Then ListPersonalizada.Add("SubProyecto")
+
+ If ChkNombreCliente.Checked Then ListPersonalizada.Add("NombreCliente")
+
+ If ChkObservaciones.Checked Then ListPersonalizada.Add("Observaciones")
+
+
+ If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "CatAF.aspx", String.Join("|", ListPersonalizada)) Then
+ 'Alert("Personalizacion guardada")
+ End If
+
+ objUsuario.Dispose()
+
+ End Sub
+
+
+ Private Sub CargaPersonalizacion()
+
+ Dim strBasePersonalizacion As String = UsuarioActual.Personalizaciones("CatAF.aspx")
+
+ If strBasePersonalizacion.Trim.Length > 0 Then
+
+ ChkCodigo.Checked = False
+ ChkDescripcion.Checked = False
+ ChkTipoActivoFijo.Checked = False
+ ChkSubTIpoActivoFijo.Checked = False
+ ChkResponsable.Checked = False
+ ChkNoSerie.Checked = False
+ ChkAño.Checked = False
+ ChkSubProyecto.Checked = False
+ ChkEstadoActivoFijo.Checked = False
+ ChkFechaIng.Checked = False
+ ChkGrupo.Checked = False
+ ChkMarcaActivoFijo.Checked = False
+ ChkModeloActivoFijo.Checked = False
+ ChkNombreCuenta.Checked = False
+ ChkValorCompra.Checked = False
+ ChkFechaCompra.Checked = False
+ ChkFechaBaja.Checked = False
+ 'ChkNoSerie.Checked = False
+ 'ChkEstadoActivoFijo.Checked = False
+ 'ChkResponsable.Checked = False
+ ChkProyecto.Checked = False
+ 'ChkSubProyecto.Checked = False
+ ChkNombreCliente.Checked = False
+ ChkObservaciones.Checked = False
+
+ Dim Personalizaciones As String() = strBasePersonalizacion.Split("|"c)
+
+ For Each personalizacion As String In Personalizaciones
+ Select Case personalizacion
+ Case "Codigo"
+ ChkCodigo.Checked = True
+ Exit Select
+ Case "Descripcion"
+ ChkDescripcion.Checked = True
+ Exit Select
+ Case "TipoActivoFijo"
+ ChkTipoActivoFijo.Checked = True
+ Exit Select
+ Case "SubTIpoActivoFijo"
+ ChkSubTIpoActivoFijo.Checked = True
+ Exit Select
+ Case "Responsable"
+ ChkResponsable.Checked = True
+ Exit Select
+ Case "NoSerie"
+ ChkNoSerie.Checked = True
+ Exit Select
+ Case "Año"
+ ChkAño.Checked = True
+ Exit Select
+ Case "SubProyecto"
+ ChkSubProyecto.Checked = True
+ Exit Select
+ Case "EstadoActivoFijo"
+ ChkEstadoActivoFijo.Checked = True
+ Exit Select
+ Case "FechaIng"
+ ChkFechaIng.Checked = True
+ Exit Select
+ Case "Grupo"
+ ChkGrupo.Checked = True
+ Exit Select
+ Case "MarcaActivoFijo"
+ ChkMarcaActivoFijo.Checked = True
+ Exit Select
+ Case "ModeloActivoFijo"
+ ChkModeloActivoFijo.Checked = True
+ Exit Select
+ Case "NombreCuenta"
+ ChkNombreCuenta.Checked = True
+ Exit Select
+ Case "ValorCompra"
+ ChkValorCompra.Checked = True
+ Exit Select
+ Case "FechaCompra"
+ ChkFechaCompra.Checked = True
+ Exit Select
+ Case "FechaBaja"
+ ChkFechaBaja.Checked = True
+ Exit Select
+ Case "Proyecto"
+ ChkProyecto.Checked = True
+ Exit Select
+ Case "NombreCliente"
+ ChkNombreCliente.Checked = True
+ Exit Select
+ Case "Observaciones"
+ ChkObservaciones.Checked = True
+ Exit Select
+ Case Else
+ Exit Select
+ End Select
+ Next
+
+ Else
+ PersonalizaDefault()
+ End If
+
+ Personaliza()
+
+ UPPersonalizar.Update()
+
+ End Sub
+
+
+ Private Sub PersonalizaDefault()
+
+ ChkCodigo.Checked = True
+ ChkDescripcion.Checked = True
+ ChkTipoActivoFijo.Checked = True
+ ChkSubTIpoActivoFijo.Checked = True
+ ChkResponsable.Checked = True
+ ChkNoSerie.Checked = True
+ ChkAño.Checked = True
+ ChkSubProyecto.Checked = True
+ ChkEstadoActivoFijo.Checked = True
+ ChkFechaIng.Checked = True
+
+ End Sub
+
+
+ Private Sub Personaliza()
+
+ GvDatos.Columns(0).Visible = ChkCodigo.Checked
+ GvDatos.Columns(1).Visible = ChkDescripcion.Checked
+ GvDatos.Columns(2).Visible = ChkTipoActivoFijo.Checked
+ GvDatos.Columns(3).Visible = ChkSubTIpoActivoFijo.Checked
+ GvDatos.Columns(4).Visible = ChkResponsable.Checked
+ GvDatos.Columns(5).Visible = ChkNoSerie.Checked
+ GvDatos.Columns(6).Visible = ChkAño.Checked
+ GvDatos.Columns(7).Visible = ChkSubProyecto.Checked
+ GvDatos.Columns(8).Visible = ChkEstadoActivoFijo.Checked
+ GvDatos.Columns(9).Visible = ChkFechaIng.Checked
+
+ GvDatos.Columns(10).Visible = ChkGrupo.Checked
+ GvDatos.Columns(11).Visible = ChkMarcaActivoFijo.Checked
+ GvDatos.Columns(12).Visible = ChkModeloActivoFijo.Checked
+ GvDatos.Columns(13).Visible = ChkNombreCuenta.Checked
+ GvDatos.Columns(14).Visible = ChkValorCompra.Checked
+ GvDatos.Columns(15).Visible = ChkFechaCompra.Checked
+ GvDatos.Columns(16).Visible = ChkFechaBaja.Checked
+ 'GvDatos.Columns(17).Visible = ChkNoSerie.Checked
+ 'GvDatos.Columns(18).Visible = ChkEstadoActivoFijo.Checked
+ 'GvDatos.Columns(19).Visible = ChkResponsable.Checked
+ GvDatos.Columns(17).Visible = ChkProyecto.Checked
+ 'GvDatos.Columns(18).Visible = ChkSubProyecto.Checked
+ GvDatos.Columns(18).Visible = ChkNombreCliente.Checked
+ GvDatos.Columns(19).Visible = ChkObservaciones.Checked
+
+
+
+ 'Personalizo = 1
+ 'If Personalizo = 1 Then
+ ' ImgExcelPersonalizado.Visible = True
+ 'Else
+ ' ImgExcelPersonalizado.Visible = False
+ 'End If
+
+ End Sub
+
+#End Region
End Class
diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb
index 0792aa609..5c3ef1f46 100644
--- a/App_Code/ClsGenerales.vb
+++ b/App_Code/ClsGenerales.vb
@@ -2617,18 +2617,18 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
#End Region
-
+
#Region "Bitacora"
Public Function GetHistorialBitacora(CveAcarreo As Integer, CveOrdenCompra As Integer, CveActivoFijo As Integer,
CveOS As Integer, CvePS As Integer, CveCompra As Integer, CveIE As Integer,
CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional CvePersonal As Integer = -1,
Optional IdPoliza As Integer = -1, Optional CvePrePoliza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveConceptoNomina As Integer = -1, Optional CvePromocion As Integer = -1,
Optional CveAsistencia As Integer = -1, Optional CveAsistenciaDetalle As Integer = -1, Optional CveTipoBitacora As Integer = -1,
- Optional FechaInicio As String = "", Optional FechaFin As String = "", Optional Fecha As Date = MinFecha) As Boolean
+ Optional FechaInicio As String = "", Optional FechaFin As String = "", Optional Fecha As Date = MinFecha, Optional CveContrato As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_HistorialBitacoraGet")
@@ -2648,6 +2648,7 @@ Public Class ClsGenerales
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
.Add("@CveConceptoNomina", SqlDbType.Int).Value = CveConceptoNomina
.Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion
+ .Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@CveAsistencia", SqlDbType.Int).Value = CveAsistencia
@@ -2698,7 +2699,7 @@ Public Class ClsGenerales
CveIE As Integer, Actual As String, Anterior As String, CveUsuario As Integer,
CveEmpresa As Integer, SeElimino As Integer, Descripcion As String, Tipo As String,
Id_Clave As String, Optional IdPoliza As Integer = -1, Optional CvePromocion As Integer = -1, Optional CveUsuarioTabla As Integer = -1,
- Optional CvePersonal As Integer = -1, Optional Motivo As String = "", Optional Fecha As String = "1900/01/01") As Boolean
+ Optional CvePersonal As Integer = -1, Optional Motivo As String = "", Optional Fecha As String = "1900/01/01", Optional CveContrato As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_HistorialBitacoraAdd")
@@ -2725,6 +2726,7 @@ Public Class ClsGenerales
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@Motivo", SqlDbType.VarChar).Value = Motivo
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha
+ .Add("@CveContrato", SqlDbType.Int).Value = CveContrato
End With
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index d78ec663b..fd14b2e9a 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -1513,6 +1513,33 @@ Public Class ClsInventarios
Return Retorno
End Function
+ Public Function GetInvExistenciasCapas(CvePS As Integer, FechaI As DateTime, FechaF As DateTime, CveEmpresa As Integer, Optional CvesAlmacenes As String = "-1") As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Inv_ExistenciasCapasGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@FechaI", SqlDbType.DateTime).Value = FechaI
+ .Add("@FechaF", SqlDbType.DateTime).Value = FechaF
+ .Add("@CvesAlmacenes", SqlDbType.VarChar).Value = CvesAlmacenes
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+
+ Me.OnError("Ocurrió un error al obtener las existencias de los movimientos.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener las existencias de los movimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
Public Function GetKardexAlmacen(CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb
index 3fb0c1389..08a417153 100644
--- a/App_Code/ClsOC.vb
+++ b/App_Code/ClsOC.vb
@@ -30,6 +30,7 @@ Public Class ClsOC
Public Property CveOrdenCompra As Integer
Public Property CveOrdenCompraDetalle As Integer
Public Property Folio As Integer
+ Public Property Serie As String = ""
Public Property CveIEAnticipo As Integer
Public Property CveProveedorAnticipo As Integer
Public Property FolioIEAnticipo As Integer
@@ -120,6 +121,8 @@ Public Class ClsOC
Public Property Promocion As String
Public Property CveProveedorContacto As Integer
Public Property NumRemision As String
+ Public Property PorcentajeProntoPago As Decimal = 0
+
Public ReadOnly Property DtResultados() As DataTable
Get
@@ -606,6 +609,7 @@ Public Class ClsOC
Dim dr As DataRow = Data.Rows(0)
_CveOrdenCompra = dr("CveOrdenCompra").ToString.ToEntero
_Folio = dr("Folio").ToString.ToEntero
+ _Serie = dr("Serie").ToString
_CveIEAnticipo = dr("CveIEAnticipo").ToString.ToEntero
_FolioIEAnticipo = dr("FolioIEAnticipo").ToString.ToEntero
_ImporteAnticipo = dr("ImporteAnticipo").ToString.ToDecimal
@@ -688,6 +692,7 @@ Public Class ClsOC
Promocion = IfNull(dr("Promocion"), "", dr("Promocion").ToString).ToString
CveProveedorContacto = If(Not IsDBNull(dr("CveProveedorContacto")), dr("CveProveedorContacto").ToString.ToEntero, -1)
NumRemision = dr("NumRemision").ToString
+ PorcentajeProntoPago = dr("PorcentajeProntoPago").ToString.ToDecimal
Retorno = True
ElseIf Data.Rows.Count > 0 Then
@@ -708,7 +713,7 @@ Public Class ClsOC
Optional PorcentajeIVA As Decimal = 0.16D, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1,
Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1,
Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1",
- Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1) As Boolean
+ Optional CveColectiva As Integer = -1, Optional MetodoPago As Integer = -1, Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraAdd")
@@ -755,6 +760,7 @@ Public Class ClsOC
.Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito
.Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega ' 0 Contado, 1 Credito
+ .Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago
.Add("@vCveOrdenCompra", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
@@ -919,7 +925,7 @@ Public Class ClsOC
Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional IDPoliza As Integer = -1, Optional FechaExpiracion As Date = Nothing, Optional FolioAdicional As String = "",
Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1",
Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16D, Optional NumRemision As String = "-1", Optional MetodoPago As Integer = -1,
- Optional CveSubProyectoEntrega As Integer = -1) As Boolean
+ Optional CveSubProyectoEntrega As Integer = -1, Optional PorcentajeProntoPago As Decimal = 0) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraUpdate")
@@ -956,6 +962,8 @@ Public Class ClsOC
.Add("@NumRemision", SqlDbType.VarChar).Value = NumRemision
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago ' 0 Contado, 1 Credito
.Add("@CveSubProyectoEntrega", SqlDbType.Int).Value = CveSubProyectoEntrega
+ .Add("@PorcentajeProntoPago", SqlDbType.Decimal).Value = PorcentajeProntoPago
+
End With
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 04baf5021..04d175ee7 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -7850,7 +7850,10 @@ Public Class ClsPaginas
params.Add(New ReportParameter("Proyecto", If(DtDetalle IsNot Nothing AndAlso DtDetalle.Rows.Count > 0, DtDetalle.MAX("Proyecto").ToString, "")))
End If
params.Add(New ReportParameter("CentroCostos", If(DtDetalle IsNot Nothing AndAlso DtDetalle.Rows.Count > 0, DtDetalle.MAX("Proyecto").ToString, "")))
- params.Add(New ReportParameter("Folio", ObjOC.Folio.ToString))
+
+
+ params.Add(New ReportParameter("Folio", If(ObjOC.Serie.Length > 0, $"{ObjOC.Serie}-{ObjOC.Folio.ToString}", ObjOC.Folio.ToString)))
+
params.Add(New ReportParameter("ProveedorNombre", ObjOC.RazonSocial))
params.Add(New ReportParameter("ProveedorLugar", ObjOC.LugarEntrega))
params.Add(New ReportParameter("Estatus", ObjOC.Estatus))
diff --git a/App_Code/ClsValidaCFDi.vb b/App_Code/ClsValidaCFDi.vb
index c2e19cc0c..35248b76d 100644
--- a/App_Code/ClsValidaCFDi.vb
+++ b/App_Code/ClsValidaCFDi.vb
@@ -97,18 +97,24 @@ Public Class ClsValidaCFDi
oAcuse = wsConsultaCFDI.Consulta(String.Format("?re={0}&rr={1}&tt={2}&id={3}", LRFCEmisor, LRFCReceptor, Importe, LFolioFiscal.ToUpper))
'oAcuse = wsConsultaCFDI.Consulta("?re=LESA6211234B2&rr=GCO890418M56&tt=0000001360.000000&id=0C8BAD9C-A8C6-4A48-8FF5-0687AC6F1581")
'Alert(oAcuse.Estado)
- If oAcuse.Estado.ToLower = "vigente" Then
- EsValida = 1
- End If
- If oAcuse.Estado.ToLower = "cancelado" Then
- EsValida = 2
- End If
- If oAcuse.ValidacionEFOS = "100" Then
- EnListaEFOS = True
+ If oAcuse IsNot Nothing AndAlso oAcuse.Estado IsNot Nothing AndAlso oAcuse.ValidacionEFOS IsNot Nothing Then
+ If oAcuse.Estado.ToLower = "vigente" Then
+ EsValida = 1
+ End If
+ If oAcuse.Estado.ToLower = "cancelado" Then
+ EsValida = 2
+ End If
+
+ If oAcuse.ValidacionEFOS = "100" Then
+ EnListaEFOS = True
+ Else
+ EnListaEFOS = False
+ End If
Else
- EnListaEFOS = False
+ EsValida = 0
End If
+
Catch ex As Exception
MsgError = "Op1. No se pudo validar la vigencia ante el SAT "
GuardaLog(String.Format("Op1. {0}", ex.Message))
@@ -122,7 +128,7 @@ Public Class ClsValidaCFDi
Dim Vigencia As Timbrado.AcuseCancelacionSAT = Timbrado.VerificarVigenciaSAT(LFolioFiscal.ToUpper, LRFCEmisor.Replace("%26", "&"), LRFCReceptor.Replace("%26", "&"), Importe, True)
- If Vigencia IsNot Nothing Then
+ If Vigencia IsNot Nothing AndAlso Vigencia.Estado IsNot Nothing AndAlso Vigencia.EsCancelable IsNot Nothing AndAlso Vigencia.EstatusCancelacion IsNot Nothing Then
If Not Vigencia.Estado.ToUpper().Contains("NO ENCONTRADO") AndAlso Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
EsValida = 1
End If
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 2732e461b..abc48596e 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -5221,7 +5221,7 @@ Public Class ClsVentas
Return Retorno
End Function
- Public Function AutorizacionLimitesUpdate(CveAutorizacion As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer) As Boolean
+ Public Function AutorizacionLimitesUpdate(CveAutorizacion As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuarioAutorizo As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_AutorizacionLimitesUpdate", CommandType.StoredProcedure)
@@ -5233,7 +5233,7 @@ Public Class ClsVentas
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@Importe", SqlDbType.Money).Value = Importe
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
-
+ .Add("@CveUsuarioAutorizo", SqlDbType.Int).Value = CveUsuarioAutorizo
End With
Try
diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb
index 6d02f294b..86d3ec501 100644
--- a/App_Code/LogicNominas.vb
+++ b/App_Code/LogicNominas.vb
@@ -148,6 +148,7 @@ Public Class LogicNominas
Dim totalDb As Decimal
Dim subTotalDb As Decimal
Dim CodigoPostal As String = ""
+ Dim CLABEInterbancaria As String = ""
Dim ObjIncapacidades As New List(Of CFDINominaIncapacidades)
'Conexiones a la Base de Datos
@@ -175,7 +176,7 @@ Public Class LogicNominas
ClaveBanco = drow("ClaveBanco").ToString()
BancoNumCuenta = drow("BancoNumCuenta").ToString()
-
+ CLABEInterbancaria = drow("CLABE").ToString()
'If TimbreIndemnizacion Then
' cfdi.Timbrado = drow("SeTimbroFiniquitoVal").ToString().ToEntero() = 1
' cfdi.IStimbreFiniquito = True
@@ -495,8 +496,19 @@ Public Class LogicNominas
cfdi.Nomina.Receptor.Puesto = Puesto
cfdi.Nomina.Receptor.CodigoRiesgoPuesto = CveSATRiesgoPuesto.ToString()
cfdi.Nomina.Receptor.PeriodicidadPago = PeriodicidadPago
+ If Not IsNothing(CLABEInterbancaria) OrElse CLABEInterbancaria.Trim().Length > 16 Then
+ cfdi.Nomina.Receptor.NumeroCuenta = CLABEInterbancaria
+ Else
+ cfdi.Nomina.Receptor.NumeroCuenta = BancoNumCuenta
+ End If
+
+
cfdi.Nomina.Receptor.CodigoBanco = ClaveBanco
- cfdi.Nomina.Receptor.NumeroCuenta = BancoNumCuenta
+ If Not IsNothing(cfdi.Nomina.Receptor.NumeroCuenta) AndAlso
+ cfdi.Nomina.Receptor.NumeroCuenta.Trim().Length > 17 Then
+ cfdi.Nomina.Receptor.CodigoBanco = ""
+
+ End If
cfdi.Nomina.Receptor.SDI = SDI
cfdi.Nomina.Receptor.SBC = SalarioDiarioSS
cfdi.Nomina.Receptor.Sindicalizado = If(Sindicalizado, "Sí", "No")
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 6d332ce2c..579856c52 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -452,6 +452,7 @@ Namespace Modelos
Dim ObjVentas As New ClsVentas()
If ObjVentas.GetVenta(CveVenta, CveEmpresa, VerificaAlmacen:=VerificaAlmacen) Then
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
+
setValues(ObjVentas.DtResultados.Rows(0))
SetMetodoPago()
SetMoneda()
@@ -466,26 +467,33 @@ Namespace Modelos
Else
Me.VentaDesglosaIEPS = True
End If
+
SetTotales(ObjVentas.DtResultados, ObjVentas)
+
If CargaDTDetalle Then
If ObjVentas.GetVentaDetalle(CveVenta) Then
Me.DtDetalle = ObjVentas.DtResultados.Copy()
End If
End If
+
+ If CargaDatosCliente Then SetCliente()
+
+ If CargaDatosRelacionados Then IniciaValoresVentas(EsCancelacion)
+
+ If String.IsNullOrEmpty(DirectorioServidor) Then DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
+
+ Me.DirectorioServidor = DirectorioServidor
+ Timbre = New CFDITimbre
End If
Else
+ Me.CveVenta = -1
+ Me.CveEmpresa = -1
+ Me.CveCliente = -1
+
ErrorList.Add("No se pudo cargar la información de la factura.")
End If
+
ObjVentas.Dispose()
-
- If CargaDatosCliente Then SetCliente()
-
- If CargaDatosRelacionados Then IniciaValoresVentas(EsCancelacion)
-
- If String.IsNullOrEmpty(DirectorioServidor) Then DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
-
- Me.DirectorioServidor = DirectorioServidor
- Timbre = New CFDITimbre
End Sub
Private Sub SetTotales(dtVentas As DataTable, ObjVentas As ClsVentas)
Dim TmpDTImpuestos As New DataTable
@@ -6331,93 +6339,94 @@ Namespace Modelos
For Each CveRemision As Integer In ListaRemisionesCancelar
Dim ObjRemision As New Factura(UsuarioActual, CveRemision, UsuarioActual.CveEmpresa, VerificaAlmacen:=True)
- If ObjRemision IsNot Nothing AndAlso ObjRemision.SaldoAlmacen <> 0 Then
+ If ObjRemision IsNot Nothing AndAlso ObjRemision.CveVenta > 0 Then
- Dim SaldoAlmacenExA As Decimal = 0
- Dim SaldoAlmacenUsados As Decimal = 0
- Dim DtSaldosAlmacenRemision As DataTable = Nothing
- 'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
- If Not ErrorCancelar Then
- If ObjInventario.GetSaldoVentaDetalleAlmacen(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then
- DtSaldosAlmacenRemision = ObjInventario.DtResultados.Copy()
- Else
- ErrorCancelar = True
- MensajeError = "Ocurrió un error al cargar los saldos de devolución. Por favor vuelva a intentar."
- End If
- End If
-
-
- Dim DtDevRemision As DataTable = DtDevoluciones.FiltraParametros($"CveRemision={CveRemision}")
-
- Dim DtDevMovs As DataTable = DtDevRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveRemision", "CveAlmacen", "CveAlmacenDestino"})
-
- For Each RowDevolucion As DataRow In DtDevMovs.Rows
- CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero()
- CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero()
-
- If CveAlmacen > 0 AndAlso DtSaldosAlmacenRemision IsNot Nothing Then
- SaldoAlmacenExA = DtSaldosAlmacenRemision.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacen}")
- End If
-
- If SaldoAlmacenExA <> 0 Then
- If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")}"), ObjVentas, ObjInventario, ObjConta) Then
+ If ObjRemision.SaldoAlmacen <> 0 Then
+ Dim SaldoAlmacenExA As Decimal = 0
+ Dim SaldoAlmacenUsados As Decimal = 0
+ Dim DtSaldosAlmacenRemision As DataTable = Nothing
+ 'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
+ If Not ErrorCancelar Then
+ If ObjInventario.GetSaldoVentaDetalleAlmacen(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then
+ DtSaldosAlmacenRemision = ObjInventario.DtResultados.Copy()
+ Else
ErrorCancelar = True
- MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión."
- Exit For
+ MensajeError = "Ocurrió un error al cargar los saldos de devolución. Por favor vuelva a intentar."
End If
End If
- Next
- 'CANCELAR MOVIMIENTOS DE USADOS SI TIENE
- If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
- Dim CveAlmacenUsado As Integer = 0
- Dim CveMovimientoUsado As Integer = 0
+ Dim DtDevRemision As DataTable = DtDevoluciones.FiltraParametros($"CveRemision={CveRemision}")
- If ObjInventario.GetInv_Mov(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then
- CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
- CveAlmacenUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
- Else
- ErrorCancelar = True
- MensajeError = "Ocurrió un error al cargar los datos de devolución de usado. Por favor vuelva a intentar."
- End If
+ Dim DtDevMovs As DataTable = DtDevRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveRemision", "CveAlmacen", "CveAlmacenDestino"})
- If CveAlmacenUsado > 0 AndAlso DtSaldosAlmacenRemision IsNot Nothing Then
- SaldoAlmacenUsados = DtSaldosAlmacenRemision.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenUsado}")
- End If
+ For Each RowDevolucion As DataRow In DtDevMovs.Rows
+ CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero()
+ CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero()
- If Not ErrorCancelar AndAlso CveMovimientoUsado > 0 AndAlso SaldoAlmacenUsados <> 0 Then
- If CancelarInventarioUsado(ObjRemision, CveAlmacenUsado, CveMovimientoUsado, ObjInventario, ObjConta, Contabilizable:=False) <= 0 Then
- ErrorCancelar = True
- MensajeError = "Ocurrió un error al cancelar los usados. Por favor vuelva a intentar."
+ If CveAlmacen > 0 AndAlso DtSaldosAlmacenRemision IsNot Nothing Then
+ SaldoAlmacenExA = DtSaldosAlmacenRemision.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacen}")
End If
+
+ If SaldoAlmacenExA <> 0 Then
+ If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")}"), ObjVentas, ObjInventario, ObjConta) Then
+ ErrorCancelar = True
+ MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión."
+ Exit For
+ End If
+ End If
+
+ Next
+
+ 'CANCELAR MOVIMIENTOS DE USADOS SI TIENE
+ If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+ Dim CveAlmacenUsado As Integer = 0
+ Dim CveMovimientoUsado As Integer = 0
+
+ If ObjInventario.GetInv_Mov(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then
+ CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
+ CveAlmacenUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
+ Else
+ ErrorCancelar = True
+ MensajeError = "Ocurrió un error al cargar los datos de devolución de usado. Por favor vuelva a intentar."
+ End If
+
+ If CveAlmacenUsado > 0 AndAlso DtSaldosAlmacenRemision IsNot Nothing Then
+ SaldoAlmacenUsados = DtSaldosAlmacenRemision.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenUsado}")
+ End If
+
+ If Not ErrorCancelar AndAlso CveMovimientoUsado > 0 AndAlso SaldoAlmacenUsados <> 0 Then
+ If CancelarInventarioUsado(ObjRemision, CveAlmacenUsado, CveMovimientoUsado, ObjInventario, ObjConta, Contabilizable:=False) <= 0 Then
+ ErrorCancelar = True
+ MensajeError = "Ocurrió un error al cancelar los usados. Por favor vuelva a intentar."
+ End If
+ End If
+
+ 'CANCELAR MOVIMIENTOS DE GARANTIA SI TIENE
+ If Not ErrorCancelar AndAlso Not GenerarMovimientoGarantia(15, "Salida Garantía", ClsPaginas.NowADS(), ObjRemision, ObjAcum, ObjInventario, ObjConta) Then
+ ErrorCancelar = True
+ End If
+
+ 'CANCELA LOS FOLIOS DE GARANTIA
+ If Not ErrorCancelar AndAlso Not ObjAcum.UpdateGarantiaCancelacion(ObjRemision.CveVenta) Then
+ ErrorCancelar = True
+ MensajeError = "Ocurrió un error al actualizar la garantía"
+ End If
+
End If
- End If
+ If DtDevRemision IsNot Nothing Then
+ DtDevRemision.Dispose()
+ End If
- 'CANCELAR MOVIMIENTOS DE GARANTIA SI TIENE
- If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
- If Not GenerarMovimientoGarantia(15, "Salida Garantía", ClsPaginas.NowADS(), ObjRemision, ObjAcum, ObjInventario, ObjConta) Then
- ErrorCancelar = True
+ If DtDevMovs IsNot Nothing Then
+ DtDevMovs.Dispose()
End If
End If
- 'CANCELA LOS FOLIOS DE GARANTIA
- If Not ErrorCancelar Then
- If Not ObjAcum.UpdateGarantiaCancelacion(ObjRemision.CveVenta) Then
- ErrorCancelar = True
- MensajeError = "Ocurrió un error al actualizar la garantía"
- End If
- End If
-
- If DtDevRemision IsNot Nothing Then
- DtDevRemision.Dispose()
- End If
-
- If DtDevMovs IsNot Nothing Then
- DtDevMovs.Dispose()
- End If
-
+ Else
+ ErrorCancelar = True
+ MensajeError = "Ocurrió un error al cargar los datos de la remisión. Por favor vuelva a intentar."
End If
If ObjRemision IsNot Nothing Then
diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx
index dab9d8862..b87b8b817 100644
--- a/Ashx/CargaEventos.ashx
+++ b/Ashx/CargaEventos.ashx
@@ -554,7 +554,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
Dim cevent As CalendarEvent = New CalendarEvent()
cevent.id = dr("CveContrato").ToString.ToEntero
- cevent.title = dr("DescripcionContrato").ToString
+ cevent.title = If(dr("CodigoAF").ToString.Trim.Length > 0, $"#{dr("CodigoAF").ToString}-{dr("DescripcionContrato").ToString}", $"-{dr("DescripcionContrato").ToString}")
cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime)
cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime))
cevent.FechaFinal = String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)
diff --git a/Bancos/Creditos.aspx.vb b/Bancos/Creditos.aspx.vb
index 7ae86544c..6d1bb5b0a 100644
--- a/Bancos/Creditos.aspx.vb
+++ b/Bancos/Creditos.aspx.vb
@@ -965,7 +965,7 @@ Partial Class Bancos_Creditos
If CveCredito > 0 Then
If ObjCredito.UpdateCreditos(CveCredito, DdlTipoCredito.SelectedValue.ToEntero, TxtReferencia.Text, TxtObservaciones.Text, -1, -1, -1, DdlTipoMoneda.SelectedValue.ToEntero, TxtFechaInicio.Text.ToString.ToDate, FechaVencimiento, TxtTasa.Text.Trim.ToDouble, TxtSobreTasa.Text.Trim.ToDouble, TxtIVA.Text.ToDouble / 100,
TxtPlazo.Text.Trim.ToEntero, -1, TxtVehiculoValor.Text.ToString.ToDouble, TxtComisionValor.Text.ToString.ToDouble, TxtSeguroMensual.Text.ToString.ToDouble, TxtOtrosGastosValor.Text.ToString.ToDouble,
- DdlProveedores.SelectedValue.ToEntero, RBLClasificacionContable.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, AplicaAnticipo:=If(RBLAnticipo.SelectedValue.ToEntero = 1, True, False),
+ DdlProveedores.SelectedValue.ToEntero, RBLClasificacionContable.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, AplicaAnticipo:=If(RBLAnticipo.SelectedValue.ToEntero = 1, True, False),
CreditoAnticipo:=TxtVehiculoAnticipo.Text.ToDouble, ComisionAnticipo:=TxtComisionAnticipo.Text.ToDouble, SeguroAnticipo:=TxtSeguroAnticipo.Text.ToDouble, OtrosGastosAnticipo:=TxtOtrosGastosAnticipo.Text.ToDouble, FondoGarantia:=TxtFondoGarantia.Text.ToDouble, SeguroValor:=TxtSeguroValor.Text.ToDouble, TipoInteres:=ChkTipoInteres.Checked) Then
If RegeneraTablaAmortizacion Then
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index dfa005080..144da0e15 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -6423,10 +6423,21 @@ Partial Class Compras_Compras
Dim CvePrePoliza2Almacen As Integer = ObjConta.AddPrePolizas("Compras/Registrar/Almacen", If(EsContado And CvePlantillaPrePoliza = 1, 2, CvePlantillaPrePoliza), ImporteCompra, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, NowADS(), ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa))
If CvePrePoliza2Almacen > 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza2Almacen, True, importeMN.RoundSQL(2), importeMN.RoundSQL(2), 205, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=ContabilizableAlmacen) Then
+
+ Dim ImpPrepoliza As Decimal = 0D
+ Dim ImpPrepolizaMN As Decimal = 0D
+
+ For Each gvRowInv As GridViewRow In GvInv.Rows
+ Dim gvCantidad As Decimal = gvRowInv.FCTextBox("TbCantidad").Text.ToDecimal
+ Dim gvPU As Decimal = gvRowInv.DataKey("PU").ToDecimal
+ ImpPrepoliza = ImpPrepoliza + (gvCantidad * gvPU)
+ Next
+ ImpPrepolizaMN = ImpPrepoliza * tipoCambioActual * Multiplicador
+
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza2Almacen, True, ImpPrepolizaMN.RoundSQL(2), ImpPrepolizaMN.RoundSQL(2), 205, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=ContabilizableAlmacen) Then
ErrorPrepoliza = True
End If
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza2Almacen, False, importeMN.RoundSQL(2), importeMN.RoundSQL(2), 68, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=ContabilizableAlmacen) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza2Almacen, False, ImpPrepolizaMN.RoundSQL(2), ImpPrepolizaMN.RoundSQL(2), 68, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=ContabilizableAlmacen) Then
ErrorPrepoliza = True
End If
Else
@@ -13318,10 +13329,11 @@ Partial Class Compras_Compras
dtt = dtt.FiltraParametros($"Fecha >= #{NowADS.AddMonths(-12).ToString("yyyy/MM/dd")}#")
End If
DDLDevolucion.DataSource = dtt
- DDLDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
End If
objcompras.Dispose()
DDLDevolucion.DataBind()
+ DDLDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1"))
UPDevolucion.Update()
End Sub
@@ -14242,6 +14254,7 @@ Partial Class Compras_Compras
HdnVCveOC.Value = ""
HdnCveEstatusOC.Value = ""
+ Dim tmpPorcentajeProntoPago As Decimal = 0
Dim OC As New ClsOC
If PopUpOC Then
Dim ArrayCveOC As String() = CvesOC.Split(New Char() {","c})
@@ -14252,6 +14265,7 @@ Partial Class Compras_Compras
HdnCveEstatusOC.Value += String.Format("{0}{1}", If(HdnCveEstatusOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveEstatusSiguiente").ToString)
EntregaDirecta += If(OC.DtResultados.Rows(0)("EntregaDirecta").ToString = "True", 1, 0)
MetodoPagoOC = OC.DtResultados.Rows(0)("MetodoPagoOC").ToString.ToEntero
+ tmpPorcentajeProntoPago = OC.DtResultados.Rows(0)("PorcentajeProntoPago").ToString.ToDecimal
End If
End If
Next
@@ -14268,6 +14282,11 @@ Partial Class Compras_Compras
HdnCveEstatusOC.Value += String.Format("{0}{1}", If(HdnCveEstatusOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveEstatusSiguiente").ToString)
EntregaDirecta += If(OC.DtResultados.Rows(0)("EntregaDirecta").ToString = "True", 1, 0)
MetodoPagoOC = OC.DtResultados.Rows(0)("MetodoPagoOC").ToString.ToEntero
+
+ If tmpPorcentajeProntoPago = 0 Then
+ tmpPorcentajeProntoPago = OC.DtResultados.Rows(0)("PorcentajeProntoPago").ToString.ToDecimal
+ End If
+
End If
End If
Next
@@ -14281,6 +14300,11 @@ Partial Class Compras_Compras
PopUpOC = False
+ If tmpPorcentajeProntoPago > 0 Then
+ PorcentajeProntoPago = tmpPorcentajeProntoPago
+ End If
+
+
If HdnVCveOC.Value <> "" Then
If HdnCveEstatusOC.Value = "" Then
Alert("No se tiene especificado el siguiente estatus de la Orden(es) de Compra. Por favor verifique los estatus y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
diff --git a/Contratos/Presupuestos.aspx.vb b/Contratos/Presupuestos.aspx.vb
index 65d860f72..caa64a63f 100644
--- a/Contratos/Presupuestos.aspx.vb
+++ b/Contratos/Presupuestos.aspx.vb
@@ -412,7 +412,7 @@ Partial Class Contratos_Presupuestos
CveConceptoContableNom = CveAgrupador
End If
- If CveClasificacion > 0 Then
+ If CveClasificacion > 0 Or CveConceptoContableNom > 0 Then
If ImporteClasi > 0 Then
TieneError = Not ObjCont.AddPresupuestosDetalle(CvePresupuestoNuevo, CveClasificacion, CveTipoGasto, ImporteClasi, ObsDetalle, CveConceptoContableNom:=CveConceptoContableNom)
If TieneError Then
diff --git a/Contratos/RepPresupuestosDetalle.aspx.vb b/Contratos/RepPresupuestosDetalle.aspx.vb
index 36b32b15f..434af89c8 100644
--- a/Contratos/RepPresupuestosDetalle.aspx.vb
+++ b/Contratos/RepPresupuestosDetalle.aspx.vb
@@ -82,7 +82,9 @@ Partial Class Contratos_RepPresupuestosDetalle
Private Sub CargaSubProyecto()
DdlSubProyecto.Items.Clear()
If DdlProyecto.SelectedValue.ToEntero > 0 Or UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
- DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, 1))
+ DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110),
+ GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1),
+ GlobalDTSubProyectos(UsuarioActual.CveEmpresa, -1, DdlProyecto.SelectedValue.ToEntero, 1))
End If
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyecto.DataBind()
@@ -94,19 +96,21 @@ Partial Class Contratos_RepPresupuestosDetalle
Dim CveProyecto = IfNull(Request("CveProyecto"), -1).ToString.ToEntero
Dim CveSubProyecto = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero
Dim CveTipoGasto = IfNull(Request("CveTipoGasto"), -1).ToString.ToEntero
- Dim Agrupador = IfNull(Request("Agrupador"), -1).ToString.ToEntero
+ Dim Agrupador = IfNull(Request("Agrupador"), -1).ToString.ToEntero
+
Gpo = IfNull(Request("CveAgrupador"), -1).ToString.ToEntero
+
Dim Mensual = CBool(IfNull(Request("Mensual"), False))
Dim EsProyecto = CBool(IfNull(Request("EsProyecto"), False))
'If Agrupador = 1 Then Agrupador = 2 Else Agrupador = 1
DdlAgrupador.SelectedValueExist(Agrupador)
DdlClasificacion.SelectedValueExist(CveClasificacion)
- If DdlAgrupador.SelectedValue.ToEntero = 1 Then
+ If DdlAgrupador.SelectedValue.ToEntero = 1 Then 'Clasificación
DdlClasificacion.SelectedValueExist(Gpo)
DdlProyecto.SelectedValueExist(CveProyecto)
DdlSubProyecto.SelectedValueExist(CveSubProyecto)
- ElseIf DdlAgrupador.SelectedValue.ToEntero = 2 Then
+ ElseIf DdlAgrupador.SelectedValue.ToEntero = 2 Then ' Centro costo
If Not EsProyecto Then
Dim Dr As DataRow = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, Gpo)(0)
DdlProyecto.SelectedValueExist(Dr("CveProyecto"))
@@ -121,6 +125,10 @@ Partial Class Contratos_RepPresupuestosDetalle
TxtFiltrosFechaInicio.Text = FechaInicio
TxtFiltrosFechaFin.Text = FechaFin
ChkMensual.Checked = Mensual
+
+ If Agrupador = 1 Then Agrupador = 2 Else Agrupador = 1
+ DdlAgrupador.SelectedValueExist(Agrupador)
+
End Sub
#End Region
diff --git a/Inventarios/Kardex.aspx b/Inventarios/Kardex.aspx
index 937e82045..891cfad73 100644
--- a/Inventarios/Kardex.aspx
+++ b/Inventarios/Kardex.aspx
@@ -121,30 +121,33 @@
Kardex
-
+
+
diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb
index b1d45e4ba..de836aa38 100644
--- a/Inventarios/Kardex.aspx.vb
+++ b/Inventarios/Kardex.aspx.vb
@@ -1,11 +1,13 @@
Option Strict On
Option Explicit On
+Imports System
Imports System.Data
Imports System.Security.Cryptography.Pkcs
Imports ADSNetLibrary.SIGAPI.Models.CGame
Imports Extensiones
Imports Microsoft.Reporting.WebForms
+Imports Microsoft.VisualBasic
Imports Telerik.Web.UI
Partial Class Inventarios_Kardex
@@ -279,6 +281,10 @@ Partial Class Inventarios_Kardex
LnkSeries.Visible = AuxAplicaSerie
LnkCaducidad.Visible = AuxAplicaCad
+
+ If UsuarioActual.CveEmpresa = 172 Then
+ LnkExistenciasPorCapas.Visible = True
+ End If
'CARGA INDICADORES
If UsuarioActual.TienePermisoProceso(201) Then
@@ -574,6 +580,30 @@ Partial Class Inventarios_Kardex
Next
End Sub
+
+ Protected Sub LnkExistenciasPorCapas_OnClick(sender As Object, e As EventArgs) Handles LnkExistenciasPorCapas.Click
+
+ Dim FechaI As DateTime = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text.ToDateTime(), MinFecha)
+ Dim FechaF As DateTime = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text.ToDateTime(), MaxFecha)
+
+ Using ObjInv As New ClsInventarios
+ If ObjInv.GetInvExistenciasCapas(ddlProducto2.SelectedValue.ToEntero(), FechaI, FechaF, UsuarioActual.CveEmpresa, ddlAlmacen.GetSelectedValues()) Then
+ GvExistenciasCapas.DataSource = ObjInv.DtResultados
+ End If
+ End Using
+
+ GvExistenciasCapas.DataBind()
+ UpExistenciasCapas.Update()
+ RegistraScript(String.Format("$('#{0}').modal('show');", "DivModalExistenciasCapas"))
+ End Sub
+
+ Protected Sub GvExistenciasCapas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvExistenciasCapas.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ If e.Row.DBCampo("CodigoPS").Contains("Total") Then
+ e.Row.CssClass = "Totales"
+ End If
+ End If
+ End Sub
#End Region
diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx b/Inventarios/PopUpExistenciasAlmacen.aspx
index 25fdbcce1..2c2adac8d 100644
--- a/Inventarios/PopUpExistenciasAlmacen.aspx
+++ b/Inventarios/PopUpExistenciasAlmacen.aspx
@@ -19,88 +19,88 @@
-
-
diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx.vb b/Inventarios/PopUpExistenciasAlmacen.aspx.vb
index 10e644d70..99b2f1985 100644
--- a/Inventarios/PopUpExistenciasAlmacen.aspx.vb
+++ b/Inventarios/PopUpExistenciasAlmacen.aspx.vb
@@ -198,19 +198,15 @@ Partial Class Inventarios_Default
objPS.Dispose()
If UsuarioActual.CveEmpresa = 119 Then
If CBool(dr("AplicaIEPS")) Then
- LtlIEPS.Visible = True
LtlIEPSPorcentaje.Visible = True
- LtlIEPSPorcentaje.Text = $"% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}"
+ LtlIEPSPorcentaje.Text = $"IEPS: % {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}"
Else
- LtlIEPS.Visible = False
LtlIEPSPorcentaje.Visible = False
End If
If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then
- LtlIVA.Visible = True
LtlIVAPorcentaje.Visible = True
- LtlIVAPorcentaje.Text = $"Si"
+ LtlIVAPorcentaje.Text = $"IVA: Si"
Else
- LtlIVA.Visible = False
LtlIVAPorcentaje.Visible = False
End If
End If
diff --git a/Inventarios/TrasladoSolicitud.aspx b/Inventarios/TrasladoSolicitud.aspx
index dcf9b466e..47be19ad5 100644
--- a/Inventarios/TrasladoSolicitud.aspx
+++ b/Inventarios/TrasladoSolicitud.aspx
@@ -89,6 +89,8 @@
+
+
@@ -163,6 +165,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -185,14 +201,7 @@
- <%--
-
-
-
-
-
-
--%>
-
+
diff --git a/Inventarios/TrasladoSolicitud.aspx.vb b/Inventarios/TrasladoSolicitud.aspx.vb
index f0633a349..0741c1373 100644
--- a/Inventarios/TrasladoSolicitud.aspx.vb
+++ b/Inventarios/TrasladoSolicitud.aspx.vb
@@ -323,7 +323,7 @@ Partial Class Inventarios_TrasladoSolicitud
Estatus = 3
End If
- Dim Folio As Integer = ObjInventarios.AddTrasladoSolicitud("", DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, Estatus, -1, NowADS, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, EstatusAlmacen:=EstatusAlmacen)
+ Dim Folio As Integer = ObjInventarios.AddTrasladoSolicitud(TxtObservaciones.text, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, Estatus, -1, NowADS, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, EstatusAlmacen:=EstatusAlmacen)
If Folio > 0 Then
CveTraspasoSolicitud = ObjInventarios.CveTraspasoSolicitud
diff --git a/Nomina/CatPeriodos.aspx b/Nomina/CatPeriodos.aspx
index cd697aca8..1787267e5 100644
--- a/Nomina/CatPeriodos.aspx
+++ b/Nomina/CatPeriodos.aspx
@@ -187,7 +187,7 @@
-
@@ -383,6 +383,12 @@
+
+ Mes:
+
+
+
+
diff --git a/Nomina/CatPeriodos.aspx.vb b/Nomina/CatPeriodos.aspx.vb
index d195014ed..6a5f39df1 100644
--- a/Nomina/CatPeriodos.aspx.vb
+++ b/Nomina/CatPeriodos.aspx.vb
@@ -227,8 +227,8 @@ Partial Class Nomina_CatPeriodos
RegistraScript("$('#divAddPeriodo').modal('show');")
End Sub
Protected Sub BtnAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregar.Click
- Dim ObjNom_Periodos As New ClsNominas
+ Dim mensajeerror As String = ""
Dim EsInicioMes As Boolean
Dim EsFinMes As Boolean
Dim EsInicioSS As Boolean
@@ -237,72 +237,85 @@ Partial Class Nomina_CatPeriodos
Dim EsFinAño As Boolean
Dim FueCalculado As Boolean
Dim Numero As Integer = TxtNumeroAdd.Text.Trim.ToEntero()
- Dim FechaInicio As Date = TxtFechaInicioAdd.Text.Trim.ToDate
- Dim FechaFin As Date = TxtFechaFinAdd.Text.Trim.ToDate
- Dim Mes As Integer = FechaFin.Month
+ Dim FechaInicio As Date = TxtFechaInicioAdd.Text().Trim.ToDate()
+ Dim FechaFin As Date = TxtFechaFinAdd.Text.Trim().ToDate()
+ Dim Mes As Integer = TxtMes.Text.Trim().ToEntero()
+ If Not ((FechaFin.Month = 12 And (Mes = 1)) OrElse (FechaFin.Month = 1 And (Mes = 12)) OrElse (Math.Abs(FechaFin.Month - Mes) <= 1)) OrElse
+ Mes > 12 OrElse Mes < 1 Then
+ TxtMes.Text = FechaFin.Month.ToString()
+ mensajeerror = "El mes seleccionado para el periodo de nómina debe ser el mes actual, el mes anterior, o el mes siguiente a la fecha de finalización."
+ End If
Dim Ejercicio As Integer = FechaFin.Year
Dim CveTipoPeriodo As Integer = DdlTipoPeriodoAdd.SelectedValue.ToEntero()
Dim Estatus As Integer = DdlEstatusAdd.SelectedValue.ToEntero()
Dim CvePeriodo As Integer = hdnCvePerido.Value.ToEntero()
Dim CveSubTipoPeriodo As Integer = TxtCveSubTipoPeriodoAdd.Text.ToEntero()
- If CveSubTipoPeriodo <= 1 Then
- CveSubTipoPeriodo = 1
- End If
- For Each item As ListItem In CBLchk.Items
- Select Case item.Value.ToEntero()
- Case 1
- If item.Selected Then EsInicioMes = True Else EsInicioMes = False
- Case 2
- If item.Selected Then EsFinMes = True Else EsFinMes = False
- Case 3
- If item.Selected Then EsInicioSS = True Else EsInicioSS = False
- Case 4
- If item.Selected Then EsFinSS = True Else EsFinSS = False
- Case 5
- If item.Selected Then EsInicioAño = True Else EsInicioAño = False
- Case 6
- If item.Selected Then EsFinAño = True Else EsFinAño = False
- Case 7
- If item.Selected Then FueCalculado = True Else FueCalculado = False
- End Select
- Next
- If Comando = "Agregar" Then
+ If (mensajeerror = "") Then
- If ObjNom_Periodos.AddPeriodo(CveTipoPeriodo, Ejercicio, Mes, Numero, FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTurno.SelectedValue.ToEntero(), DdlEstatus.SelectedValue.ToEntero(), CveSubTipoPeriodo) Then
+ Using ObjNom_Periodos As New ClsNominas
+
+ If CveSubTipoPeriodo <= 1 Then
+ CveSubTipoPeriodo = 1
+ End If
+ For Each item As ListItem In CBLchk.Items
+ Select Case item.Value.ToEntero()
+ Case 1
+ If item.Selected Then EsInicioMes = True Else EsInicioMes = False
+ Case 2
+ If item.Selected Then EsFinMes = True Else EsFinMes = False
+ Case 3
+ If item.Selected Then EsInicioSS = True Else EsInicioSS = False
+ Case 4
+ If item.Selected Then EsFinSS = True Else EsFinSS = False
+ Case 5
+ If item.Selected Then EsInicioAño = True Else EsInicioAño = False
+ Case 6
+ If item.Selected Then EsFinAño = True Else EsFinAño = False
+ Case 7
+ If item.Selected Then FueCalculado = True Else FueCalculado = False
+ End Select
+ Next
+ If Comando = "Agregar" Then
+
+ If ObjNom_Periodos.AddPeriodo(CveTipoPeriodo, Ejercicio, Mes, Numero, FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTurno.SelectedValue.ToEntero(), DdlEstatus.SelectedValue.ToEntero(), CveSubTipoPeriodo) Then
+
+ Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion)
+ UpDatos.Update()
+ ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
+ CargaDatos()
+ If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
+ CargaGrid(ViewState("Orden").ToString())
+ Else
+ CargaGrid("")
+ End If
+
+ End If
+ ElseIf Comando = "Actualizar" Then
+
+ If ObjNom_Periodos.UpdatePeriodo(FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, FueCalculado, CveTipoPeriodo, Ejercicio, Mes, Numero, Estatus, CvePeriodo, UsuarioActual.CveEmpresa, DdlTurno.SelectedValue.ToEntero(), CveSubTipoPeriodo) Then
+
+ Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
+ UpDatos.Update()
+ ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
+ CargaDatos()
+ If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
+ CargaGrid(ViewState("Orden").ToString())
+ Else
+ CargaGrid("")
+ End If
+ End If
- Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion)
- UpDatos.Update()
- ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
- CargaDatos()
- If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
- CargaGrid(ViewState("Orden").ToString())
- Else
- CargaGrid("")
End If
- End If
- ElseIf Comando = "Actualizar" Then
-
- If ObjNom_Periodos.UpdatePeriodo(FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, FueCalculado, CveTipoPeriodo, Ejercicio, Mes, Numero, Estatus, CvePeriodo, UsuarioActual.CveEmpresa, DdlTurno.SelectedValue.ToEntero(), CveSubTipoPeriodo) Then
-
- Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
- UpDatos.Update()
- ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
- CargaDatos()
- If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
- CargaGrid(ViewState("Orden").ToString())
- Else
- CargaGrid("")
- End If
- End If
-
+ End Using
+ RegistraScript("$('#divAddPeriodo').modal('hide');")
+ Else
+ Alert(mensajeerror, TipoMensaje.MsgAdvertencia)
End If
- RegistraScript("$('#divAddPeriodo').modal('hide');")
-
'ObjNom_Periodos.Dispose()
End Sub
@@ -321,6 +334,7 @@ Partial Class Nomina_CatPeriodos
TxtFechaFinAdd.Text = GvRow.DataKey("FechaFin").ToString()
DdlEstatusAdd.SelectedValueExist(GvRow.DataKey("Estatus").ToString().ToEntero())
hdnCvePerido.Value = GvRow.DataKey("CvePeriodo").ToString()
+ TxtMes.Text = GvRow.DataKey("Mes").ToString()
TxtCveSubTipoPeriodoAdd.Text = GvRow.DataKey("CveSubTipoPeriodo").ToString()
For Each item As ListItem In CBLchk.Items
@@ -351,6 +365,7 @@ Partial Class Nomina_CatPeriodos
TxtNumeroAdd.Text = ""
TxtFechaInicioAdd.Text = ""
TxtFechaFinAdd.Text = ""
+ TxtMes.Text = ""
DdlEstatusAdd.SelectedValueExist(-1)
DdlTurno.SelectedValueExist(-1)
For Each item As ListItem In CBLchk.Items
diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx
index 39250c7b2..ca6d5a9d8 100644
--- a/Nomina/Nomina.aspx
+++ b/Nomina/Nomina.aspx
@@ -2533,13 +2533,13 @@
OnRowDataBound="GVNominaPendiente_RowDataBound">
-
-
+
+
-
-
+
+
diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs
index 0d18cbfba..3ed9e79df 100644
--- a/Nomina/Nomina.aspx.cs
+++ b/Nomina/Nomina.aspx.cs
@@ -3688,12 +3688,15 @@ public partial class Nomina_Nomina2 : ClsPaginas
//CvePeriodoSeleccionado
//SRCvePersonal
bool continuar = true;
+ bool msgFin = true;
if (SRCveConcepto > 0)
{
using (ClsNominas onom = new ClsNominas())
{
if (continuar = onom.DeleteNom_NominasDetalles(SRCveConcepto, SRCvePersonal, CvePeriodoSeleccionado))
{
+
+ msgFin = (onom.DtResultados.Rows.Count > 0 && onom.DtResultados.Rows[0]["AplicaFiniquito"].ToString().ToUpper().Contiene("1", "TRUE"));
}
}
}
@@ -3706,7 +3709,15 @@ public partial class Nomina_Nomina2 : ClsPaginas
UpGvConceptos.Update();
RegistraScript("$('#ModalUpConcepto').modal('hide');");
- Alert("el importe sera tomado del calculo y no del valor fijo");
+ if(msgFin)
+ {
+ Alert("recuerda eliminar el finiquito del modulo de finiquito si deseas eliminar el valor, esto para poder activar al empleado!",TipoMensaje.ToastAdventencia);
+ }
+ else
+ {
+ Alert("el importe sera tomado del calculo y no del valor fijo");
+ }
+
}
}
@@ -6239,7 +6250,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
paragraphh = new GemBox.Document.Paragraph(document, string.Format("Fecha Ingr:{0:dd/MM/yyyy}, S.D.:{1:N2}, S.D.I.:{2:N2}, S.B.C.:{3:N2} ", drow2["FechaIngreso"], drow2["SalarioDiario"], drow2["SalarioDiarioIntegrado"], drow2["SalarioDiarioIMSS"])); cell.Blocks.Add(paragraphh);
paragraphh.ParagraphFormat.Style = styilo;
- paragraphh = new GemBox.Document.Paragraph(document, string.Format("Días pagados:{0}, Retardos: {1}, Ausencias:{2},Incapacidad:{3},Vacaciones Disfrutadas:{4},Vacaciones Pagadas:{5} ", drow2["DiasLaborados"], drow2["DiasRetardos"], drow2["DiasFaltados"], drow2["DiasIncapacidad"], drow2["DiasVacaciones"], drow2["DiasVacacionesPorPagar"])); cell.Blocks.Add(paragraphh);
+ paragraphh = new GemBox.Document.Paragraph(document, string.Format("Días pagados:{0:N0}, Retardos: {1}, Ausencias:{2},Incapacidad:{3},Vacaciones Disfrutadas:{4},Vacaciones Pagadas:{5} ", drow2["DiasPago"], drow2["DiasRetardos"], drow2["DiasFaltados"], drow2["DiasIncapacidad"], drow2["DiasVacaciones"], drow2["DiasVacacionesPorPagar"])); cell.Blocks.Add(paragraphh);
paragraphh.ParagraphFormat.Style = styilo;
row = new GemBox.Document.Tables.TableRow(document);
diff --git a/OC/OC.aspx b/OC/OC.aspx
index 88f22bc33..9076a5274 100644
--- a/OC/OC.aspx
+++ b/OC/OC.aspx
@@ -477,6 +477,31 @@
+
+
Descuento:
+
+
+
+
+
+
+
+
Descuento Pronto Pago:
+
+
+
+
+
+
+
Edición Masiva:
+
+
+
+
+
+
+
+
@@ -944,6 +969,7 @@
+
<%-- 1 --%>
@@ -986,6 +1012,7 @@
+
@@ -1041,6 +1068,7 @@
+
@@ -1056,6 +1084,7 @@
+
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index c670ce3dc..904b1bf7b 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -6,6 +6,7 @@ Imports System.Data.SqlClient
Imports System.IO
Imports Extensiones
Imports GemBox.Spreadsheet
+Imports Microsoft.Ajax.Utilities
Imports Newtonsoft.Json
Partial Class OC_OC
@@ -964,6 +965,12 @@ Partial Class OC_OC
DdlSubProyectoGral.Visible = True
End If
+ If UsuarioActual.CveRol = 1 Then
+ TrDescuentoEscalonado.Visible = True
+ TrDescuentoProntoPago.Visible = True
+ TrEdicionMasiva.Visible = True
+ End If
+
End If
MostrarUsuarioAsignado()
@@ -1521,6 +1528,8 @@ Partial Class OC_OC
TxtNumRemision.Text = objOC.NumRemision
NumeroRemisionOriginal = objOC.NumRemision
+ TxtPorcentajeProntoPago.Text = (100 * objOC.PorcentajeProntoPago).ToString("###.00")
+
If Not IsNothing(objOC.Tipo) Then
Select Case objOC.Tipo.ToUpper
@@ -2709,6 +2718,11 @@ Partial Class OC_OC
Dim LugarEntrega As String = If(txtLugarEntrega.Text.Trim = "", "-1", txtLugarEntrega.Text.Trim)
LugarEntrega = If(DivLugarEntrega1.Visible, LugarEntrega, If(TxtLugarEntregaDirecta.Visible, TxtLugarEntregaDirecta.Text.Trim, ""))
+ Dim PorcentajeProntoPago As Decimal = 0
+ If TxtPorcentajeProntoPago.Text.ToDecimal > 0 Then
+ PorcentajeProntoPago = TxtPorcentajeProntoPago.Text.ToDecimal / 100
+ End If
+
'GUARDA'
If EsNuevo Then
@@ -2753,7 +2767,7 @@ Partial Class OC_OC
RequiereCotizacion:=ChkCotizacion.Checked, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal,
RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim,
IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text.Trim(), MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(),
- CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
+ CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then
CveOrdenCompraPadre = OC.CveOrdenCompra
If CveOrdenCompraPadre > 0 Then
@@ -2795,7 +2809,8 @@ Partial Class OC_OC
RequiereCotizacion:=ChkCotizacion.Checked, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero, CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text,
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1),
CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=ImporteAnticipos, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero,
- Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
+ Promocion:=Promocion, CveProveedorContacto:=CveProveedorContacto, NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero,
+ PorcentajeProntoPago:=PorcentajeProntoPago) Then
CveOrdenCompra = OC.CveOrdenCompra
CveEstatus = CboE.SelectedValue.ToEntero
@@ -2978,7 +2993,8 @@ Partial Class OC_OC
LugarEntrega, DdlMoneda.SelectedValue.ToEntero, CveProveedor, CveOrdenCompra, UsuarioActual.CveUsuario, Ddlcliente.txtValue.Value.ToEntero,
DdlVendedor.SelectedValue.ToEntero, txtobsprioridad.Text, IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, FolioAdicional:=TxtFolioAdicional.Text, EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1),
Guia:=TxtGuia.Text.Trim, IEPS:=TxtIEPS.Text.ToDecimal, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveProveedorContacto:=CveProveedorContacto,
- PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
+ PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), NumRemision:=TxtNumRemision.Text, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero,
+ PorcentajeProntoPago:=PorcentajeProntoPago) Then
If CveProveedorOriginal <> CveProveedor Then
If Not ObjConta.UpdateProveedorPoliza(CveOrdenCompra, CveProveedor, Proveedor) Then
TieneError = True
@@ -3403,8 +3419,16 @@ Partial Class OC_OC
' Exit Function
'End If
+
+
If TipoOS Then Return False
+
+ Dim PorcentajeProntoPago As Decimal = 0
+ If TxtPorcentajeProntoPago.Text.ToDecimal > 0 Then
+ PorcentajeProntoPago = TxtPorcentajeProntoPago.Text.ToDecimal / 100
+ End If
+
Dim CveCotizacion As Integer = 0
Dim CveColectiva As Integer = 0
Dim HuboError As Boolean = False
@@ -3452,7 +3476,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) Then
+ CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then
'CREA POLIZA POR CADA PROVEEDOR
@@ -3528,7 +3552,7 @@ Partial Class OC_OC
CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveUsuarioAsignado:=DdlUsuariosAsignado.SelectedValue.ToEntero(), CveCliente:=Ddlcliente.txtValue.Value.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text,
PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, 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, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero,
- Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero) Then
+ Promocion:=Promocion, NumRemision:=TxtNumRemision.Text.Trim, MetodoPago:=DdlMetodoPago.SelectedValue.ToEntero(), CveSubProyectoEntrega:=DdlSubProyectoEntrega.SelectedValue.ToEntero, PorcentajeProntoPago:=PorcentajeProntoPago) Then
'USA AC
@@ -4243,8 +4267,8 @@ Partial Class OC_OC
'End If
End If
- 'Agarra el nuevo AF si se modifico o deja el pasado
- CveActivoFijo = If(gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero > 0, gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero, HdnEditCveActivoFijo.Value.ToEntero)
+ 'Agarra el nuevo AF si se modifico o deja el pasado
+ CveActivoFijo = If(gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero > 0, gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero, HdnEditCveActivoFijo.Value.ToEntero)
Codigo = If(gvr.FCHiddenField("HdnCodigoAF").Value <> "-1", gvr.FCHiddenField("HdnCodigoAF").Value, HdnEditCodigo.Value)
HdnEditCveActivoFijo.Value = ""
@@ -9289,5 +9313,310 @@ Partial Class OC_OC
UPPDetalle.Update()
CargaFolios()
End Sub
+
+ Protected Sub BtnDescuenEscalonado_Click(sender As Object, e As EventArgs)
+
+ Dim descuentoParts As String() = TxtDescuentoEscalonado.Text.Split("+"c)
+
+
+ For Each dRow As DataRow In DtDetalle.Rows
+
+ Dim PU As Decimal = dRow("Importe").ToString.ToDecimal
+ Dim Cantidad As Decimal = dRow("Cantidad").ToString.ToDecimal
+ Dim IVAPorcentaje As Decimal = dRow("IVAPorcentaje").ToString.ToDecimal
+ Dim IEPSPSPorcentaje As Decimal = dRow("IEPSPSPorcentaje").ToString.ToDecimal
+ Dim IEPSPSIVAPorcentaje As Decimal = dRow("IEPSPSIVAPorcentaje").ToString.ToDecimal
+ Dim RetIVAPorcentaje As Decimal = dRow("RetIVAPorcentaje").ToString.ToDecimal
+ Dim RetISRPorcentaje As Decimal = dRow("RetISRPorcentaje").ToString.ToDecimal
+
+ Dim TotalTemp As Decimal = (PU * Cantidad)
+ Dim Descuento As Decimal = 0
+
+ If descuentoParts.Length = 0 Then
+ Descuento = 0
+ Else
+
+ For i As Integer = 0 To descuentoParts.Length - 1
+ Dim descuentoPart As Decimal = descuentoParts(i).Trim().ToDecimal
+ If descuentoPart > 0 Then
+ Descuento = Descuento + ((TotalTemp - Descuento) * (descuentoPart / 100))
+ Else
+ Continue For
+ End If
+ Next
+
+ End If
+
+ Dim Total As Decimal = If(PU > 0, (PU * Cantidad) - Descuento, 0)
+
+ dRow("Descuento") = Descuento
+
+ If dRow("Total").ToString.ToDecimal <> Total Then
+ dRow("Total") = Total
+
+ dRow("IEPSPS") = Math.Round(IEPSPSPorcentaje * Total, 2)
+ dRow("IEPSPSIVA") = Math.Round(IEPSPSIVAPorcentaje * Total, 2)
+
+ dRow("IVA") = Math.Round(IVAPorcentaje * Total, 2)
+
+ dRow("RetIVA") = (RetIVAPorcentaje * Total).RoundSQL(2)
+ dRow("RetISR") = (RetISRPorcentaje * Total).RoundSQL(2)
+ dRow("TipoDato") = 1
+
+ End If
+
+
+
+
+
+
+ Next
+
+ DtDetalle.AcceptChanges()
+
+ CalculaGenerales()
+
+ GvD.DataSource = DtDetalle
+ GvD.DataBind()
+
+ UpIvas.Update()
+ UPPDetalle.Update()
+
+
+ End Sub
+
+ Protected Sub BtnEdicionMasiva_Click(sender As Object, e As EventArgs)
+
+ If BtnEdicionMasiva.Text = "Editar" Then
+ BtnEdicionMasiva.Text = "Aplicar"
+
+ For Each GvRow As GridViewRow In GvD.Rows
+
+ GvRow.FCTextBox("TxtEMObsPS").Visible = True
+ GvRow.FCTextBox("TxtEMCantEdit").Visible = True
+ GvRow.FCTextBox("TxtEMDescuentoEdit").Visible = True
+ GvRow.FCTextBox("TxtEMImporteEdit").Visible = True
+
+ GvRow.FCLabel("LtlCantidad").Visible = False
+ GvRow.FCLiteral("LtlObsPS").Visible = False
+ GvRow.FCLiteral("LtlDescuento").Visible = False
+ GvRow.FCLabel("LtlImporte").Visible = False
+
+
+ 'observación, PU, descuento, cantidad
+ Next
+
+ Else
+
+ GvD_RecalculaEdicionMasiva()
+
+ BtnEdicionMasiva.Text = "Editar"
+ For Each GvRow As GridViewRow In GvD.Rows
+ GvRow.FCTextBox("TxtEMObsPS").Visible = False
+ GvRow.FCTextBox("TxtEMCantEdit").Visible = False
+ GvRow.FCTextBox("TxtEMDescuentoEdit").Visible = False
+ GvRow.FCTextBox("TxtEMImporteEdit").Visible = False
+
+ GvRow.FCLabel("LtlCantidad").Visible = True
+ GvRow.FCLiteral("LtlObsPS").Visible = True
+ GvRow.FCLiteral("LtlDescuento").Visible = True
+ GvRow.FCLabel("LtlImporte").Visible = True
+ Next
+
+
+
+ End If
+
+
+ UPPDetalle.Update()
+ uppEstatus.Update()
+
+ End Sub
+
+
+ Private Sub GvD_RecalculaEdicionMasiva()
+
+ For Each gvr As GridViewRow In GvD.Rows
+
+ Dim Cantidad, Importe, Descuento As Decimal
+ Dim CveUnidad, CveClasificacion, CvePS, CveSubProyecto, CveProyecto, CveCultivoCuadroDetalle As Integer
+ Dim Obs, UM, Clasificacion, PS, SubProyecto, Proyecto, Cuadro As String
+
+
+ Cantidad = gvr.FCTextBox("TxtEMCantEdit").Text.Trim.ToDecimal
+ Importe = gvr.FCTextBox("TxtEMImporteEdit").Text.Trim.ToDecimal
+ Descuento = gvr.FCTextBox("TxtEMDescuentoEdit").Text.Trim.ToDecimal
+ Obs = gvr.FCTextBox("TxtEMObsPS").Text.Trim
+
+ 'SubProyecto, Cantidad, Importe, Descuento, CveOrdenCompra, CveUnidadMedida, CvePresupuestoEgreso, PS,CveClasificacion, CvePS, CveSubProyecto, CveActivoFijo, CodigoAF, TipoDato, Observacion,
+ 'CveOrdenCompraDetalle,CveCompra,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,IEPSPSIVAPorcentaje,CantidadNoEditable,CveCultivoCuadroDetalle
+
+ CveUnidad = gvr.DataKey("CveUnidadMedida").ToEntero
+ UM = gvr.FCLiteral("LA").Text
+ CveClasificacion = gvr.DataKey("CveClasificacion").ToEntero
+ Clasificacion = gvr.FCLabel("LblClasificacion").Text
+
+ 'SE TOMAN VALORES EN CASO DE QUE LA CvePS SEA DIFERENTE DE LA ANTERIOR
+ Dim CvePSAnterior As Integer = gvr.DataKey("CvePS").ToEntero
+ PS = gvr.DataKey("PS").ToString
+ Dim RetISR As Decimal = gvr.DataKey("RetISRPorcentaje").ToDecimal
+ Dim RetIVA As Decimal = gvr.DataKey("RetIVAPorcentaje").ToDecimal
+ 'Dim IvaPS = gvr.DataKey("IVAPorcentaje").ToDecimal
+ Dim IEPSPS As Decimal = gvr.DataKey("IEPSPSPorcentaje").ToDecimal
+ Dim IEPSPSIVA As Decimal = gvr.DataKey("IEPSPSIVAPorcentaje").ToDecimal
+ Dim Total As Decimal = Importe * Cantidad - Descuento
+
+
+ 'VALORES DEL PS
+ 'CvePS = gvr.FCDropDownList("DdlPS").SelectedValue.ToEntero
+
+ 'PS = gvr.FCDropDownList("DdlPS").SelectedItem.Text
+ 'Dim DrPS As DataRow = GlobalDTPS(CveEmpresaActual, CvePS:=CvePS).FiltroPrimero("")
+ 'If DrPS Is Nothing Then
+ ' Alert("Ocurrió un error al cargar la información del producto para actualizar. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ ' Exit Sub
+ 'End If
+ 'Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal
+ 'IEPSPS = DrPS("IEPSPorcentaje").ToString.ToDecimal
+ 'IEPSPSIVA = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0)
+
+ 'If DdlProveedores.SelectedValue.ToEntero > 0 Then
+ ' 'Si es Proveedor Extranjero el IVA es 0%
+ ' Dim drProv As DataRow = GlobalDTCompProveedores(CveEmpresaActual, CveProveedor:=DdlProveedores.SelectedValue.ToEntero).FiltroPrimero("")
+ ' If drProv IsNot Nothing Then
+ ' If drProv("CodigoRegimenFiscal").ToString = "626" Then 'simplificado lleva retencion de 1.25 de isr
+ ' RetISR = 0.0125D
+ ' End If
+ ' End If
+ 'End If
+
+ 'If CvePS <> CvePSAnterior Or Not CveOrdenCompra > 0 Then
+ ' RetISR = DrPS("RetISR").ToString.ToDecimal
+ ' RetIVA = DrPS("RetIVA").ToString.ToDecimal
+ ' If Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2) = 0.08 Then
+ ' RetIVA = RetIVA / 2
+ ' End If
+ ' If IvaPS <> 0 Then IvaPS = -1
+ 'End If
+
+ 'CveSubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedValue.ToEntero
+ 'SubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedItem.Text
+
+ 'CveCultivoCuadroDetalle = gvr.FCDropDownList("DdlCultivosCuadroEdit").SelectedValue.ToEntero
+ 'Cuadro = ""
+ 'If CveCultivoCuadroDetalle > 0 Then
+ ' Cuadro = gvr.FCDropDownList("DdlCultivosCuadroEdit").SelectedItem.Text
+ 'End If
+
+ 'If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then
+ ' CveProyecto = -1
+ ' Proyecto = "Seleccione"
+ 'Else
+ ' CveProyecto = gvr.FCDropDownList("DdlProyectoEdit").SelectedValue.ToEntero
+ ' Proyecto = gvr.FCDropDownList("DdlProyectoEdit").SelectedItem.Text
+ 'End If
+
+ 'If UsuarioActual.Empresa.Funcionalidad(532).Contiene("1", "2") Then
+ ' Dim ObjCon As New ClsContratos
+ ' Dim CvePresupuesto As Integer = 0
+ ' Dim Autorizado As Decimal = 0
+ ' Dim Ejercido As Decimal = 0
+ ' If ObjCon.GetPresupuestos(-1, "-1", CveSubProyecto, 2, -1, UsuarioActual.CveEmpresa) Then
+ ' If ObjCon.DtResultados.Rows.Count > 0 Then
+ ' CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero
+ ' If CvePresupuesto > 0 Then
+ ' If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then
+ ' If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} And Importe > 0").Rows.Count > 0 Then
+ ' Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} And Importe > 0").Rows(0)("Importe").ToString.ToDecimal
+ ' End If
+ ' End If
+ ' If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{NowADS().Year - 1}".ToDate, NowADS(), UsuarioActual.CveEmpresa, CveProyecto,
+ ' CveSubProyecto, UsuarioActual.CveUsuario, CveClasificacion) Then
+ ' If ObjCon.DtResultados.Rows.Count > 0 Then
+ ' Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDecimal
+ ' End If
+ ' End If
+ ' End If
+ ' End If
+ ' End If
+ ' ObjCon.Dispose()
+
+ ' If CvePresupuesto > 0 And Autorizado > 0 Then
+ ' Dim Diferencia As Decimal = (Ejercido + Total) - Autorizado
+ ' If Diferencia > 0 Then
+ ' Alert($"No hay presupuesto disponible: - Subproyecto {SubProyecto} - Clasificación {Clasificacion} se excede por {Diferencia.FormatoNumero}", TipoMensaje.MsgAdvertencia)
+ ' Exit Sub
+ ' End If
+ ' End If
+ 'End If
+
+ 'Agarra el nuevo AF si se modifico o deja el pasado
+ 'CveActivoFijo = If(gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero > 0, gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero, HdnEditCveActivoFijo.Value.ToEntero)
+ 'Codigo = If(gvr.FCHiddenField("HdnCodigoAF").Value <> "-1", gvr.FCHiddenField("HdnCodigoAF").Value, HdnEditCodigo.Value)
+
+ 'HdnEditCveActivoFijo.Value = ""
+ 'HdnEditCodigo.Value = ""
+
+ Dim dr As DataRow() = DtDetalle.Select("CveOrdenCompraDetalle = " & gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero)
+
+ dr(0)("Cantidad") = Cantidad
+ 'dr(0)("CveUnidadMedida") = CveUnidad
+ 'dr(0)("UM") = UM
+ 'dr(0)("CveClasificacion") = CveClasificacion
+ 'dr(0)("Clasificacion") = Clasificacion
+
+ 'If isWithFamily() Then
+ ' dr(0)("CveSubFamilia") = CveClasificacion
+ ' dr(0)("SubFamilia") = Clasificacion
+ 'End If
+
+ 'dr(0)("CvePS") = CvePS
+ 'dr(0)("PS") = PS
+ dr(0)("Observacion") = Obs
+
+ 'dr(0)("CveSubProyecto") = CveSubProyecto
+ 'dr(0)("SubProyecto") = SubProyecto
+ 'dr(0)("CveProyecto") = CveProyecto
+ 'dr(0)("Proyecto") = Proyecto
+ dr(0)("Importe") = Importe
+ dr(0)("Descuento") = Descuento
+ dr(0)("Total") = Total
+ dr(0)("IEPSPS") = IEPSPS * Total
+ dr(0)("IEPSPSPorcentaje") = IEPSPS
+ dr(0)("IEPSPSIVA") = IEPSPSIVA * Total
+ dr(0)("IEPSPSIVAPorcentaje") = IEPSPSIVA
+
+ 'If DdlIVA.SelectedValue.ToDecimal = 1 Then dr(0)("IVA") = 0 Else dr(0)("IVA") = IvaPS * Total
+ 'dr(0)("IVAPorcentaje") = If(IvaPS = -1, Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), 0)
+ Dim TotalGravado As Decimal = Total
+ If IEPSPSIVA > 0 Then TotalGravado = Total * (1 + IEPSPSIVA) 'grava para iva, el importe del IEPS
+ dr(0)("IVA") = Math.Round(dr(0)("IVAPorcentaje").ToString.ToDecimal * TotalGravado, 2)
+
+ dr(0)("RetIVA") = (RetIVA * Total).RoundSQL(6)
+ dr(0)("RetIVAPorcentaje") = RetIVA
+ dr(0)("RetISR") = (RetISR * Total).RoundSQL(6)
+ dr(0)("RetISRPorcentaje") = RetISR
+
+
+ 'dr(0)("CveActivoFijo") = CveActivoFijo
+ 'dr(0)("CodigoAF") = Codigo
+
+ 'dr(0)("CveCultivoCuadroDetalle") = CveCultivoCuadroDetalle
+ 'dr(0)("Cuadro") = Cuadro
+
+ 'si el tipodato viene de la BD, entonces sufrió una actualización
+ If dr(0)("TipoDato").ToString.ToEntero = 2 Then dr(0)("TipoDato") = 1
+ DtDetalle.AcceptChanges()
+
+
+ Next
+
+
+ CargaDatosDetalles()
+
+
+ End Sub
+
End Class
+
diff --git a/Transportes/RepContratoDetalle.aspx b/Transportes/RepContratoDetalle.aspx
index 55fd4775b..64fbfe248 100644
--- a/Transportes/RepContratoDetalle.aspx
+++ b/Transportes/RepContratoDetalle.aspx
@@ -145,12 +145,12 @@
-
-
-
-
-
+
+
+
+
+
@@ -396,9 +396,46 @@
-
-
+
+
+
+
+
+
+
+
+
+ Historial de Modificación
+
+
+
+
+
+
+
+
+
+
+ Fecha
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<%-- Pre init --%>
@@ -593,7 +630,7 @@
Observacion
+ ID="TxtObservacion">
diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb
index eca2e6001..c5228d721 100644
--- a/Transportes/RepContratoDetalle.aspx.vb
+++ b/Transportes/RepContratoDetalle.aspx.vb
@@ -113,6 +113,7 @@ Partial Class RepContratoDetalle
CveViajePasajero = 0
Session("FileExtension") = ""
ArchivoUpdate = ""
+ CargaGvBitacora()
End If
End Sub
@@ -266,7 +267,7 @@ Partial Class RepContratoDetalle
Response.Clear()
Response.ClearHeaders()
Response.ClearContent()
- Response.AddHeader("Content-Disposition", "attachment; filename=" & LbFolio.Text & ".pdf")
+ Response.AddHeader("Content-Disposition", "attachment; filename=" & LbFolio.Text & $"{File.Extension}")
Response.AddHeader("Content-Length", File.Length.ToString())
'Response.ContentType = "text/plain"
Response.ContentType = "application/octet-stream"
@@ -298,7 +299,7 @@ Partial Class RepContratoDetalle
Try
If ObjContratos.UpdateContratos(CveContrato, LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "",
DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
- DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservacion.Text) Then
+ DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservaciones.Text) Then
Alert("Contrato actualizado correctamente")
End If
ObjContratos.Commit()
@@ -606,6 +607,19 @@ Partial Class RepContratoDetalle
End Sub
#End Region
+#Region "Bitacora historial"
+ Private Sub CargaGvBitacora()
+ ' COMENTADO POR IPP PARA SUBIR 5 ABRIL 2017
+ If CveContrato > 0 Then
+ Dim ObjGral As New ClsGenerales()
+ If ObjGral.GetHistorialBitacora(-1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
+ GvBitacora.DataSource = ObjGral.DtResultados
+ End If
+ ObjGral.Dispose()
+ End If
+ GvBitacora.DataBind()
+ End Sub
+#End Region
End Class
diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx
index 028bcf371..13f2f9301 100644
--- a/Transportes/RepContratosCalendario.aspx
+++ b/Transportes/RepContratosCalendario.aspx
@@ -126,7 +126,7 @@
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 60c99308e..6401a1de9 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -5082,6 +5082,12 @@ Partial Class Ventas
End If
End If
+
+ If CveEstatus = 5 Then
+ TrMotivoCancelacion.Visible = True
+ LblMotivoCancelacion.Text = DbRowVenta("MotivoCancelacion").ToString()
+ End If
+
If DbRowVenta("CveVentaRelacionada").ToString().ToEntero() > 0 Then
TrRefacturadaa.Visible = True
HplRefacturadaEn.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", DbRowVenta("CveVentaRelacionada"))
@@ -10283,6 +10289,21 @@ Partial Class Ventas
End If
End If
+ 'REASIGNAR LAS VARIABLES CUANDO HUBO EDICION POR JS O EN LA INTERFAZ
+ If GvImpuestosLocales2.Rows.Count > 0 Then
+ Dim ImpuestosLocales As Decimal = 0
+
+ For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
+ If gvr.RowType = DataControlRowType.DataRow Then
+ ImpuestosLocales += gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal
+ End If
+ Next
+
+ If ImpuestosLocales > 0 Then
+ CalculaTotalesVenta(RecalculaImpuestosLocales:=False, RecalcularTotalOriginal:=False)
+ End If
+ End If
+
CreaObjetosVenta(TipoDoctoViejo:=TipoDoctoViejo)
If ObjFactura Is Nothing OrElse (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then
@@ -16597,19 +16618,19 @@ Partial Class Ventas
Select Case RowIL("TipoImpuesto").ToString()
Case "1"
- If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, False, Importe, Importe * tipoCambio, 27, Concepto, Concepto, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then
+ If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, If(Factura.TipoDocto.Contiene("Egs"), True, False), Importe, Importe * tipoCambio, 27, Concepto, Concepto, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
End If
Case "3"
- If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, False, Importe, Importe * tipoCambio, 116, Concepto, Concepto, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then
+ If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, If(Factura.TipoDocto.Contiene("Egs"), True, False), Importe, Importe * tipoCambio, 116, Concepto, Concepto, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
End If
Case "4"
- If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, False, Importe, Importe * tipoCambio, 58, Concepto, Concepto, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then
+ If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, If(Factura.TipoDocto.Contiene("Egs"), True, False), Importe, Importe * tipoCambio, 58, Concepto, Concepto, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
End If
Case "5"
- If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, True, Importe, Importe * tipoCambio, 27, Concepto, Concepto, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then
+ If Not ObjConta.AddPrePolizasDetalle(Factura.CvePrePoliza, If(Factura.TipoDocto.Contiene("Egs"), False, True), Importe, Importe * tipoCambio, 27, Concepto, Concepto, CveVenta:=Factura.CveVenta, CveCliente:=Factura.CveCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
End If
End Select
@@ -16636,6 +16657,7 @@ Partial Class Ventas
TipoDoctoVistaPrevia = "Ing"
End If
+ CalculaTotalesVenta(RecalculaImpuestosLocales:=False, RecalcularTotalOriginal:=False)
CreaObjetosVenta(True, TipoDoctoVistaPrevia:=TipoDoctoVistaPrevia)
If ObjFactura Is Nothing Or (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then
@@ -29630,11 +29652,7 @@ Partial Class Ventas
GvImpuestosLocales2.DataSource = ObjVentas.DtResultados
GvImpuestosLocales2.DataBind()
- If (NuevaFactura = 1) Then
- GvImpuestosLocales2.Enabled = True
- Else
- GvImpuestosLocales2.Enabled = False
- End If
+ GvImpuestosLocales2.Enabled = True
GvImpuestosLocales2.Visible = True
End If
End If