Baja
@@ -238,6 +241,7 @@
+
@@ -250,6 +254,17 @@
+
+
+
+ Faltante
+
+
+
+
+
+
+ +
@@ -289,7 +304,7 @@
-
+
@@ -317,7 +332,7 @@
diff --git a/AF/OrdenTrabajo.aspx.vb b/AF/OrdenTrabajo.aspx.vb
index 17c74f7c4..522701bf7 100644
--- a/AF/OrdenTrabajo.aspx.vb
+++ b/AF/OrdenTrabajo.aspx.vb
@@ -25,6 +25,18 @@ Partial Class AF_OrdenTrabajo
End Set
End Property
+ Property CveOrdenCompra As Integer
+ Get
+ If ViewState("CveOrdenCompra") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("CveOrdenCompra").ToString.ToEntero
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("CveOrdenCompra") = value
+ End Set
+ End Property
@@ -33,14 +45,21 @@ Partial Class AF_OrdenTrabajo
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
+ CargaCombos()
If Request("CveOrdenTrabajo") IsNot Nothing Then
CveOrdenTrabajo = Request("CveOrdenTrabajo").ToEntero
+
+ DVFechaFin.Visible = True
Tab.Visible = True
+
CargaDatos()
+
+
+
End If
- CargaCombos()
+
End If
End Sub
@@ -94,19 +113,45 @@ Partial Class AF_OrdenTrabajo
#End Region
-#Region " CARGA DATOS "
- 'Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs)
- ' CargaDatos()
- 'End Sub
-
-
-#End Region
#Region " GV DATOS "
Private Sub CargaDatos()
+
+
+ Dim ObjAF As New ClsAF
+
+ If ObjAF.GetOrdenesTrabajo(CveOrdenTrabajo, -1, -1, -1, -1, -1, MinFecha, MaxFecha, Nothing, -1, UsuarioActual.CveEmpresa) Then
+
+ If ObjAF.DtResultados IsNot Nothing AndAlso ObjAF.DtResultados.Rows.Count > 0 Then
+
+ LblFolio.Text = $"Folio OT: {ObjAF.DtResultados(0)("Folio").ToString}"
+
+ DdlSubProyecto.SelectedValueExist(ObjAF.DtResultados(0)("CveSubProyecto").ToString)
+ DdlAF.SelectedValueExist(ObjAF.DtResultados(0)("CveAF").ToString)
+ DdlTipoServicio.SelectedValueExist(ObjAF.DtResultados(0)("CveTipoServicio").ToString)
+ TxtServicio.Text = ObjAF.DtResultados(0)("Servicio").ToString
+ DdlPrioridad.SelectedValueExist(ObjAF.DtResultados(0)("Prioridad").ToString)
+ txtFechaI.Text = ObjAF.DtResultados(0)("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy")
+
+ CveOrdenCompra = ObjAF.DtResultados(0)("CveOrdenCompra").ToString.ToEntero
+
+ If ObjAF.DtResultados(0)("FechaFin").ToString.Length > 0 Then
+ txtFechaF.Text = ObjAF.DtResultados(0)("FechaFin").ToString.ToDate.ToString("dd/MM/yyyy")
+ End If
+
+ 'txtFechaFinReal.Text ""
+ DdlOrdenesTrabajoEstatus.SelectedValueExist(ObjAF.DtResultados(0)("CveEstatusOT").ToString)
+ Else
+ Alert("No se encontro la orden de trabajo", TipoMensaje.MsgAdvertencia)
+ End If
+ End If
+
+ ObjAF.Dispose()
+
+
CargaMaterial()
CargaActividades()
CargaCheckList()
@@ -152,6 +197,71 @@ Partial Class AF_OrdenTrabajo
Else
+ Dim ObjAF As New ClsAF
+ ObjAF.IniciaTransacSQL()
+ Dim ErrorProceso As Boolean = False
+
+
+ Dim FechaFinal As Date = MaxFecha
+ Dim FechaFinReal As Date = MaxFecha
+
+
+ If txtFechaF.Text.ToDate > MinFecha Then
+ FechaFinal = txtFechaF.Text.ToDate
+ End If
+
+ If Not ObjAF.UpdateOrdenesTrabajo(CveOrdenTrabajo, DdlTipoServicio.SelectedValue.ToEntero, DdlAF.SelectedValue.ToEntero, TxtServicio.Text.Trim, DdlSubProyecto.SelectedValue.ToEntero, DdlPrioridad.SelectedValue.ToEntero, txtFechaI.Text.ToDate, FechaFinal, MaxFecha, DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
+ ErrorProceso = True
+ End If
+
+ If Not ErrorProceso Then
+ For Each GvRow As GridViewRow In GvActividades.Rows
+
+ Dim Chk As CheckBox = GvRow.FCCheckBox("Chk")
+ Dim TxtObservaciones As TextBox = GvRow.FCTextBox("TxtObservaciones")
+ Dim CveOrdenTrabajoActividad As Integer = GvRow.DataKey("CveOrdenTrabajoActividad").ToEntero
+
+ If Not ObjAF.UpdateOrdenesTrabajoActividades(CveOrdenTrabajoActividad, "-1", If(Chk.Checked, 1, 0), TxtObservaciones.Text, UsuarioActual.CveEmpresa) Then
+ ErrorProceso = True
+ Exit For
+ End If
+
+ Next
+ End If
+
+
+ If Not ErrorProceso Then
+ For Each GvRow As GridViewRow In GvCheckList.Rows
+
+ Dim Chk As CheckBox = GvRow.FCCheckBox("Chk")
+ Dim TxtObservaciones As TextBox = GvRow.FCTextBox("TxtObservaciones")
+ Dim CveOrdenTrabajoCheckList As Integer = GvRow.DataKey("CveOrdenTrabajoCheckList").ToEntero
+ Dim RBL As RadioButtonList = GvRow.FCRadioButtonList("RDLSINOND")
+ Dim Estatus As Integer = 0
+
+ If RBL.SelectedValue.ToEntero > 0 Then
+ Estatus = RBL.SelectedValue.ToEntero
+ End If
+
+ If CveOrdenTrabajoCheckList > 0 Then
+
+ If Not ObjAF.UpdateOrdenesTrabajoCheckList(CveOrdenTrabajoCheckList, "-1", If(Chk.Checked, 1, 0), TxtObservaciones.Text, Estatus, UsuarioActual.CveEmpresa) Then
+ ErrorProceso = True
+ Exit For
+ End If
+
+ End If
+ Next
+ End If
+
+
+ If Not ErrorProceso Then
+ ObjAF.Commit()
+ Alert($"Orden de trabajo actualizada correctamente.")
+ Else
+ ObjAF.RollBack()
+ End If
+
End If
@@ -161,165 +271,6 @@ Partial Class AF_OrdenTrabajo
-#Region "DESCARGA EXCEL"
-
- 'Public Sub ExportToExcelG(Gv1 As GridView, NombreArchivoXLSx As String, Usuario As Usuario, Titulo As String, Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100, Optional filtros As String = "")
-
-
-
- ' For Each GvRow As GridViewRow In Gv1.Rows
-
- ' Dim IDX_LIMPIAR As Integer = 1
-
- ' For IDX_LIMPIAR = 1 To 15
- ' GvRow.Cells(IDX_LIMPIAR).Text = GvRow.FCTextBox($"TxtMetrica{IDX_LIMPIAR}").Text
- ' Next
-
- ' If GvRow.FCDropDownList("DDLPersonal").SelectedValue.ToEntero > 0 Then
- ' GvRow.Cells(16).Text = GvRow.FCDropDownList("DDLPersonal").SelectedItem.Text
- ' Else
- ' GvRow.Cells(16).Text = ""
- ' End If
-
- ' Next
-
-
-
- ' Dim sw1 As New StringWriter()
- ' Dim htw1 As New HtmlTextWriter(sw1)
- ' Gv1.RenderControl(htw1)
-
- ' Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault
- ' Dim htmlStream1 = New MemoryStream(options.Encoding.GetBytes(sw1.ToString()))
-
- ' htmlStream1.Position = 0
- ' Dim sr1 As New StreamReader(htmlStream1)
- ' Dim myStr1 = sr1.ReadToEnd()
-
- ' sr1.Dispose()
- ' htmlStream1.Dispose()
- ' sw1.Dispose()
-
- ' Dim HtmlCompleto As String = myStr1
-
-
- ' HtmlCompleto = Regex.Replace(HtmlCompleto, "\<[\/]*a[^\>]*\>", "")
-
- ' Dim asd As String = ""
-
-
- ' Dim htmlStream5 = New MemoryStream(options.Encoding.GetBytes(HtmlCompleto))
-
- ' GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet())
-
- ' Dim excel As GemBox.Spreadsheet.ExcelFile
-
- ' excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream5, options)
-
- ' If Usuario IsNot Nothing Then
- ' Dim TotalRowHeader As Integer = 8
- ' Dim TotalRowFooter As Integer = 2
-
- ' Dim worksheet = excel.Worksheets(0)
- ' worksheet.Rows.InsertEmpty(0, TotalRowHeader)
- ' Dim celdasConTexto = worksheet.GetUsedCellRange(True)
- ' celdasConTexto.Style.Font.Name = "Calibri Light"
-
- ' Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
- ' RangoNombreEmpresa.Merged = True
- ' RangoNombreEmpresa.Value = Usuario.Empresa.Empresa
- ' RangoNombreEmpresa.Style.Font.Size = 18 * 20
- ' RangoNombreEmpresa.Style.Font.Name = "Calibri Light"
- ' RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
- ' RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
-
-
- ' Dim RangoFiltros = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex)
- ' RangoFiltros.Merged = True
- ' RangoFiltros.Value = filtros
- ' RangoFiltros.Style.Font.Size = 15 * 20
- ' RangoFiltros.Style.Font.Name = "Calibri Light"
- ' RangoFiltros.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left
- ' RangoFiltros.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
-
-
- ' Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
- ' RangoTitulo.Merged = True
- ' RangoTitulo.Value = Titulo
- ' RangoTitulo.Style.Font.Size = 20 * 20
- ' RangoTitulo.Style.Font.Name = "Calibri Light"
- ' RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
- ' RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
-
- ' For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
- ' worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20
- ' worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
- ' worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
-
- ' worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
- ' worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
-
-
-
-
- ' If i > 0 Then
- ' Try
- ' worksheet.Columns(i).AutoFit(1)
- ' Catch ex As Exception
- ' End Try
- ' End If
-
- ' Next
-
- ' Dim IndexEndTable As Integer = Gv1.Rows.Count + 4 + TotalRowHeader + TotalRowFooter
-
- ' worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió"
- ' worksheet.Rows(IndexEndTable + 1).Cells(0).Value = Usuario.Nombre
-
- ' worksheet.Rows(IndexEndTable).Cells(2).Value = "Fecha Impresión"
- ' worksheet.Rows(IndexEndTable + 1).Cells(2).Value = DateTime.Now.ToString("dd/MM/yyyy")
-
- ' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
-
- ' If Imagen.Exists Then
- ' Dim Ruta As String = String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)
- ' Using sr As New StreamReader(Ruta)
- ' Dim ms As New MemoryStream()
- ' sr.BaseStream.CopyTo(ms)
- ' worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel)
- ' End Using
- ' End If
-
- ' End If
-
-
-
-
- ' Dim memoryStream As New MemoryStream()
- ' excel.Save(memoryStream, SaveOptions.XlsxDefault)
- ' ReporteBytes = memoryStream.ToArray()
- ' memoryStream.Dispose()
-
- 'End Sub
-
-
- 'Protected Sub LnkDescargaReporte_Click(sender As Object, e As EventArgs)
-
-
- ' Response.ContentType = "application/force-download"
- ' Response.AppendHeader("Content-Disposition", $"attachment;filename=RegistroRevision{Now.ToString("yyyyMMddmmss")}.xlsx")
- ' Response.BinaryWrite(ReporteBytes)
- ' Response.End()
-
- 'End Sub
-
-
- 'Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
- 'End Sub
-
-#End Region
-
-
#Region "FOLIOS"
@@ -377,16 +328,27 @@ Partial Class AF_OrdenTrabajo
Private Sub CargaMaterial()
Dim ObjAF As New ClsAF
+ Dim MaterialFaltante As Decimal = 0
If ObjAF.GetOrdenesTrabajoMateriales(CveOrdenTrabajo, UsuarioActual.CveEmpresa) Then
GvMaterial.DataSource = ObjAF.DtResultados
+ MaterialFaltante = ObjAF.DtResultados.SUMD("Faltante")
Else
GvMaterial.DataSource = Nothing
End If
ObjAF.Dispose()
+
+
+
+ If MaterialFaltante > 0 AndAlso CveOrdenCompra <= 0 Then
+
+ GvMaterial.Columns(4).Visible = True
+ End If
+
GvMaterial.DataBind()
+
UpGvMaterial.Update()
End Sub
@@ -432,9 +394,31 @@ Partial Class AF_OrdenTrabajo
Protected Sub GvMaterial_RowDataBound(sender As Object, e As GridViewRowEventArgs)
+ If e.Row.RowType = DataControlRowType.Header Then
+
+ If GvMaterial.Columns(4).Visible Then
+
+ Dim HLOC As HyperLink = e.Row.FCHyperLink("HLOC")
+ HLOC.NavigateUrl = $"../OC/OC.aspx?CveOrdenTrabajo={CveOrdenTrabajo}"
+
+ End If
+
+ End If
+
End Sub
Protected Sub GvActividades_RowDataBound(sender As Object, e As GridViewRowEventArgs)
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ Dim Chk As CheckBox = e.Row.FCCheckBox("Chk")
+
+ If Boolean.Parse(e.Row.DataKey("Terminado")) Then
+ Chk.Checked = True
+ Else
+ Chk.Checked = False
+ End If
+ End If
+
+
End Sub
Protected Sub GvCheckList_RowDataBound(sender As Object, e As GridViewRowEventArgs)
@@ -447,13 +431,15 @@ Partial Class AF_OrdenTrabajo
If e.Row.DataKey("CveOrdenTrabajoCheckList").ToEntero = 0 Then
e.Row.FCLiteral("LtlNROW").Text = e.Row.DataKey("CheckListActividadGrupo").ToString
-
e.Row.Attributes.Add("style", "background-color:#DDD")
Chk.Visible = False
RDLSINOND.Visible = False
TxtObservaciones.Visible = False
Else
+ Dim Estatus As String = e.Row.DataKey("Estatus")
+
+ RDLSINOND.SelectedValuesIfExist(Estatus)
If Boolean.Parse(e.Row.DataKey("Terminado")) Then
Chk.Checked = True
@@ -464,9 +450,6 @@ Partial Class AF_OrdenTrabajo
End If
-
-
-
End If
End Sub
diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb
index 09c6e2dce..c70e0c563 100644
--- a/App_Code/ClsAF.vb
+++ b/App_Code/ClsAF.vb
@@ -4279,6 +4279,66 @@ Public Class ClsAF
+ Public Function UpdateOrdenesTrabajo(CveOrdenTrabajo As Integer, CveTipoServicio As Integer, CveAF As Integer, Servicio As String, CveSubProyecto As Integer, Prioridad As Integer, FechaInicio As Date, FechaFin As Date, FechaFinReal As Date, CveEstatusOT As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_OrdenesTrabajoUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+
+ .Add("@CveOrdenTrabajo", SqlDbType.Int).Value = CveOrdenTrabajo
+ .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
+ .Add("@CveAF", SqlDbType.Int).Value = CveAF
+ .Add("@Servicio", SqlDbType.VarChar).Value = Servicio
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@Prioridad", SqlDbType.Int).Value = Prioridad
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@FechaFinReal", SqlDbType.Date).Value = FechaFinReal
+ .Add("@CveEstatusOT", SqlDbType.Int).Value = CveEstatusOT
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar la orden de trabajo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+
+ Public Function UpdateOrdenesTrabajoOC(CveOrdenTrabajo As Integer, CveOrdenCompra As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_OrdenesTrabajoOCUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+
+ .Add("@CveOrdenTrabajo", SqlDbType.Int).Value = CveOrdenTrabajo
+ .Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar la orden de trabajo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
Public Function GetOrdenesTrabajoMateriales(CveOrdenTrabajo As Integer, CveEmpresa As Integer) As Boolean
@@ -4330,6 +4390,35 @@ Public Class ClsAF
End Function
+
+ Public Function UpdateOrdenesTrabajoActividades(CveOrdenTrabajoActividad As Integer, Valor As String, Terminado As Integer, Observaciones As String, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_OrdenesTrabajoActividadesUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveOrdenTrabajoActividad", SqlDbType.Int).Value = CveOrdenTrabajoActividad
+ .Add("@Valor", SqlDbType.VarChar).Value = Valor
+ .Add("@Terminado", SqlDbType.Int).Value = Terminado
+ .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar las actividades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
Public Function GetOrdenesTrabajoCheckList(CveOrdenTrabajo As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -4355,6 +4444,35 @@ Public Class ClsAF
End Function
+ Public Function UpdateOrdenesTrabajoCheckList(CveOrdenTrabajoCheckList As Integer, Valor As String, Terminado As Integer, Observaciones As String, Estatus As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_OrdenesTrabajoCheckListUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveOrdenTrabajoCheckList", SqlDbType.Int).Value = CveOrdenTrabajoCheckList
+ .Add("@Valor", SqlDbType.VarChar).Value = Valor
+ .Add("@Terminado", SqlDbType.Int).Value = Terminado
+ .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
+ .Add("@Estatus", SqlDbType.Int).Value = Estatus
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el check list", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
#End Region
#End Region
diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb
index b9f29edb9..af063505a 100644
--- a/App_Code/ClsBancos.vb
+++ b/App_Code/ClsBancos.vb
@@ -3130,7 +3130,7 @@ Public Class ClsBancos
Retorno = True
Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
+ If Ex1.Message.Contains("Número: 2627;") Or Ex1.Message.Contains("Número: 2601;") Then
Alert("Ya existe un registro con el mismo Folio", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al guardar los cambios", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 0fa040293..e9188b31e 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -1562,6 +1562,30 @@ Public Class ClsContabilidad
#End Region
+
+ Public Function GetCuentasConceptos(CveTipoSaldo As Integer, CveEmpresa As Integer, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveCuentaBancos As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Conta_CuentasConceptosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveTipoSaldo", SqlDbType.Int).Value = CveTipoSaldo
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@CveCuentaBancos", SqlDbType.Int).Value = CveCuentaBancos
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener lod datos de Concepto Contables.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
#Region " C O N T A B I L I D A D - T I P O - P O L I Z A "
Public Function GetConta_TiposPoliza(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -4579,22 +4603,22 @@ Public Class ClsContabilidad
Return Retorno
End Function
- Public Function GetCuentasyConceptos(CveCliente As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Conta_GetCuentasyConceptos")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- End With
+ 'Public Function GetCuentasyConceptos(CveCliente As Integer) As Boolean
+ ' Dim Retorno As Boolean = False
+ ' DataAdapter("PA_Conta_GetCuentasyConceptos")
+ ' With SqlAdapter.SelectCommand.Parameters
+ ' .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ ' End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al consultar las cuentas y conceptos", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al consultar las cuentas y conceptos", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ ' End Try
- Return Retorno
- End Function
+ ' Return Retorno
+ 'End Function
Public Function UpdateCuentaCompaq(CveCuenta As Integer, IdCompaq As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index 7b066db54..da45dd81c 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -1551,6 +1551,33 @@ Public Class ClsInventarios
End Function
+ Public Function GetExistenciasProductoSerie(CvePS As Integer, CveAlmacen As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Inv_ExistenciaPSSeriesGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .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 el kardex de almacen.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el kardex de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
#End Region
#Region " INVENTARIOS - REPORTES "
diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb
index 055d4bf36..10ec25ddd 100644
--- a/App_Code/ClsProductosServicios.vb
+++ b/App_Code/ClsProductosServicios.vb
@@ -1682,13 +1682,13 @@ Public Class ClsProductosServicios
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
-
+
+
#Region "Precios Lista"
Public Function GetPSPreciosLista(CveEmpresa As Integer, CvePrecioLista As Integer, Optional CveClasificacion As Integer = -1, Optional CvePS As Integer = -1,
- Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1") As Boolean
+ Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1", Optional CveModelo As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PSPrecioListaGet")
With SqlAdapter.SelectCommand.Parameters
@@ -1699,6 +1699,7 @@ Public Class ClsProductosServicios
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@Estado", SqlDbType.Int).Value = Estado
.Add("@Marcas", SqlDbType.VarChar).Value = Marcas
+ .Add("@CveModelo", SqlDbType.Int).Value = CveModelo
End With
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/DtDatos.xsd b/App_Code/DtDatos.xsd
index f64700eb6..1a5c1befa 100644
--- a/App_Code/DtDatos.xsd
+++ b/App_Code/DtDatos.xsd
@@ -12,7 +12,7 @@
-
+
@@ -28,7 +28,7 @@
-
+
@@ -46,7 +46,7 @@
-
+
@@ -64,7 +64,7 @@
-
+
@@ -87,7 +87,7 @@
-
+
@@ -111,7 +111,7 @@
-
+
@@ -137,7 +137,7 @@
-
+
@@ -153,7 +153,7 @@
-
+
@@ -170,7 +170,7 @@
-
+
@@ -179,7 +179,7 @@
-
+
@@ -215,7 +215,7 @@
-
+
@@ -240,7 +240,7 @@
-
+
@@ -256,7 +256,7 @@
-
+
@@ -294,6 +294,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/App_Code/DtDatos.xss b/App_Code/DtDatos.xss
index e0a664890..7c380feb0 100644
--- a/App_Code/DtDatos.xss
+++ b/App_Code/DtDatos.xss
@@ -4,21 +4,23 @@
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
-->
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 7b3891368..4313f8638 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -974,17 +974,25 @@ Partial Class Bancos_IE
LnkEliminar.OnClientClick = "return confirm('¿Está seguro de eliminar el documento y su póliza?');"
EstaContabilizado = True
+
+ TxtFechaDocumento.Enabled = False
+ ImgCalendario.Visible = False
+
+
Else
BtnContabilizar.Visible = True
BtnDescontabilizar.Visible = False
HplIrPoliza.Visible = False
-
EstaContabilizado = False
+
+ 'TxtFechaDocumento.Enabled = True
+ 'ImgCalendario.Visible = True
+
End If
UPPDesContabilizar.Update()
'ImgImprimir.Visible = True
- LblRegistroFecha.Text = ObjIE.FechaIng.ToShortDateString
+ LblRegistroFecha.Text = ObjIE.FechaIng.ToString
LblRegistroUsuario.Text = ObjIE.Usuario
CveEstatusIE = ObjIE.CveEstatusIE
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index 2fc14f0ad..be8eb8dba 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -3903,7 +3903,7 @@
CréditosAcreedoresCaja Chica
- Viaticos
+ ViáticosDeudores
@@ -3911,7 +3911,7 @@
-
+
@@ -3971,7 +3971,7 @@
-
+
@@ -4000,7 +4000,7 @@
-
+
@@ -4029,11 +4029,12 @@
+
-
+
@@ -4052,7 +4053,7 @@
-
+
@@ -4070,16 +4071,18 @@
+
-
+
+
-
+
@@ -4105,7 +4108,7 @@
-
+
@@ -4119,15 +4122,17 @@
+
-
+
+
-
+ D.D
@@ -4235,7 +4240,7 @@
-
+
@@ -4267,10 +4272,11 @@
+
-
+
@@ -4295,7 +4301,7 @@
-
+
@@ -4308,6 +4314,7 @@
+
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index c151a54f5..6c267c75d 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -12842,6 +12842,7 @@ Partial Class Compras_Compras
End Sub
Protected Sub RBLContado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLContado.SelectedIndexChanged
+ LblCheq.Text = RBLContado.SelectedItem.Text
CargaContado()
End Sub
Private Sub RBLTipoDeudor_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLTipoDeudor.SelectedIndexChanged
@@ -18006,8 +18007,13 @@ Partial Class Compras_Compras
Private Sub ReclasificaSubProyecto()
If Not GvPS.Rows.Count > 0 Then
- Alert("No hay partidas para reclasificar el SubProyecto", TipoMensaje.MsgAdvertencia)
- Exit Sub
+
+ If CveCompra <> Nothing And CveCompra > 0 Then
+ Alert("No hay partidas para reclasificar el SubProyecto", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+
End If
If Not DdlAsignaSubProyecto.SelectedValue.ToEntero > 0 Then
diff --git a/Contabilidad/RepIVA.aspx b/Contabilidad/RepIVA.aspx
index 5e60f096a..6c146f4f5 100644
--- a/Contabilidad/RepIVA.aspx
+++ b/Contabilidad/RepIVA.aspx
@@ -145,7 +145,7 @@
-
+
diff --git a/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs
index 7c6df76ed..dae766096 100644
--- a/Contabilidad/RepIVA.aspx.cs
+++ b/Contabilidad/RepIVA.aspx.cs
@@ -25,6 +25,16 @@ public partial class Contabilidad_RepIVA : ClsPaginas
get { return DtIVAAcreditable = (DataTable)ViewState["DtIVAAcreditable"]; }
set { ViewState["DtIVAAcreditable"] = value; }
}
+ private DataTable DtIEPSA
+ {
+ get { return DtIVAAcreditable = (DataTable)ViewState["DtIEPSA"]; }
+ set { ViewState["DtIEPSA"] = value; }
+ }
+ private DataTable DtIVAA
+ {
+ get { return DtIVAAcreditable = (DataTable)ViewState["DtIVAA"]; }
+ set { ViewState["DtIVAA"] = value; }
+ }
private double TCEspecifico
{
get { return TCEspecifico = (double)ViewState["TCEspecifico"]; }
@@ -72,11 +82,13 @@ public partial class Contabilidad_RepIVA : ClsPaginas
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
GvIEPSA.DataSource = ObjCont.DtResultados;
+ DtIEPSA = ObjCont.DtResultados;
}
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
GvIVAA.DataSource = ObjCont.DtResultados;
+ DtIVAA = ObjCont.DtResultados;
}
}
@@ -205,7 +217,8 @@ public partial class Contabilidad_RepIVA : ClsPaginas
para.Add(new CrystalParametro("Excel", Formato));
string Ruta = (ModExtensiones.DirectorioBaseEmpresas + $@"Empresas\Grales\Formatos\{Formato}");
Ruta.GuardaLogAD();
- ImprimirbytesPDF(ImprimirPDFCrystal(Ruta, Dt, para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
+ ImprimirbytesPDF(ImprimirSubRepPDFCrystal(Ruta,Dt,para, DtIEPSA,DtIVAA,"RepIEPSPorcentaje.rpt","RepIVAPorcentaje.rpt", "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
+ //ImprimirbytesPDF(ImprimirPDFCrystal(Ruta, Dt, para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
}
else
{
diff --git a/Empresas/Grales/Formatos/RepIVA.rpt b/Empresas/Grales/Formatos/RepIVA.rpt
index d3b3d6240..a9b34948e 100644
Binary files a/Empresas/Grales/Formatos/RepIVA.rpt and b/Empresas/Grales/Formatos/RepIVA.rpt differ
diff --git a/Empresas/Grales/Formatos/RepIVAAcreditable.rpt b/Empresas/Grales/Formatos/RepIVAAcreditable.rpt
index d29e92534..af959d4b5 100644
Binary files a/Empresas/Grales/Formatos/RepIVAAcreditable.rpt and b/Empresas/Grales/Formatos/RepIVAAcreditable.rpt differ
diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb
index 2837ec487..245310417 100644
--- a/General/SaldosIniciales.aspx.vb
+++ b/General/SaldosIniciales.aspx.vb
@@ -1169,10 +1169,11 @@ Partial Class General_SaldosIniciales
' Exit For
'End If
Else
+ Dim CveSATEstado As Integer = GlobalDTEstado("MEX").FiltroPrimeroValor("CveSATEstado", String.Format("NombreEstado ='{0}'", Estado)).ToEntero
If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, NumExt.ToString, "", Colonia, Poblacion, Poblacion, Estado, Pais, RFC, CodigoPostal, Telefono, Contacto, "", "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, PlazoCobranza, -1,
"-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", Codigo, LimiteCredito, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado,
- BonificacionUsado:=BonificacionUsado, CobranzaContacto:=CobranzaContacto, CobranzaCorreo:=CobranzaCorreo, DiasEspecifico:=DiasPagoEspecifico, DiasRevision:=DìaVisita, CobranzaTelefono:=CobranzaTelefono, CveFormaPago33:=CveFormaPago33, CveUsoCFDI:=CveUsoCFDI) Then
+ BonificacionUsado:=BonificacionUsado, CobranzaContacto:=CobranzaContacto, CobranzaCorreo:=CobranzaCorreo, DiasEspecifico:=DiasPagoEspecifico, DiasRevision:=DìaVisita, CobranzaTelefono:=CobranzaTelefono, CveFormaPago33:=CveFormaPago33, CveUsoCFDI:=CveUsoCFDI, CveSATEstado:=CveSATEstado) Then
ErrorClientes = True
RFC.GuardaLog
@@ -1251,7 +1252,7 @@ Partial Class General_SaldosIniciales
If Not CveProveedor > 0 Then Alert(String.Format("No se encontró el Proveedor con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorCompras = True : Exit For
If Not CveProveedorSucursal > 0 Then CveProveedorSucursal = -1
- TipoDocto = IIf(TipoDocto = "Ingresos", "Fac", "NC").ToString
+ TipoDocto = IIf(TipoDocto.ToUpper = "INGRESOS", "Fac", "NC").ToString
'Temporalmente SE BORRARA
diff --git a/Inventarios/Kardex.aspx b/Inventarios/Kardex.aspx
index ca1b60934..6dc8dfaf9 100644
--- a/Inventarios/Kardex.aspx
+++ b/Inventarios/Kardex.aspx
@@ -116,15 +116,22 @@
Kardex
-
- Generar PDF
-
-
- Generar Excel
-
-
-
-
+
+
+
+ Generar PDF
+
+
+ Generar Excel
+
+
+ Series
+
+
+
+
+
+
@@ -493,6 +500,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb
index 448dcc4e4..040ca2bc1 100644
--- a/Inventarios/Kardex.aspx.vb
+++ b/Inventarios/Kardex.aspx.vb
@@ -203,6 +203,8 @@ Partial Class Inventarios_Kardex
If AplicaLote Then GvM.Columns(9).Visible = True
If AplicaCaducidad Then GvM.Columns(10).Visible = True
+ Dim AuxAplicaSerie As Boolean = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimeroValor("AplicaSerie") = "True"
+ LnkSeries.Visible = AuxAplicaSerie
'CARGA INDICADORES
If UsuarioActual.TienePermisoProceso(201) Then
DivIndicadores.Visible = True
@@ -238,6 +240,7 @@ Partial Class Inventarios_Kardex
End If
GvM.DataSource = DtTemp
GvM.DataBind()
+ UpAcciones.Update()
End If
Else
Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia)
@@ -299,6 +302,15 @@ Partial Class Inventarios_Kardex
End If
End Sub
+
+ Private Sub CargarExistenciasProductosSeries()
+ Dim ObjInventarios As New ClsInventarios
+ If ObjInventarios.GetExistenciasProductoSerie(ddlProducto2.SelectedValue.ToEntero(), ddlAlmacen.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+ GvSeries.DataSource = ObjInventarios.DtResultados
+ End If
+ ObjInventarios.Dispose()
+ GvSeries.DataBind()
+ End Sub
#End Region
#Region " IMPRIMIR "
@@ -409,5 +421,14 @@ Partial Class Inventarios_Kardex
#End Region
+#Region "Acciones"
+ Protected Sub LnkSeries_OnClick(sender As Object, e As EventArgs) Handles LnkSeries.Click
+ CargarExistenciasProductosSeries()
+ UpGridSeries.Update()
+ RegistraScript(String.Format("$('#{0}').modal('show');", "DivModalSerie"))
+ End Sub
+#End Region
+
+
End Class
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index 29e39b48d..4f86550c6 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -167,7 +167,14 @@ Partial Class OC
End Property
Private Property NumCotizaciones As Integer
Get
- NumCotizaciones = ViewState("NumCotizaciones").ToString.ToEntero
+
+ If ViewState("NumCotizaciones") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("NumCotizaciones").ToString.ToEntero
+ End If
+
+
End Get
Set(value As Integer)
ViewState("NumCotizaciones") = value
@@ -524,6 +531,22 @@ Partial Class OC
End Set
End Property
+
+
+
+ Private Property CveOrdenTrabajo As Integer
+ Get
+ If ViewState("CveOrdenTrabajo") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("CveOrdenTrabajo").ToString.ToEntero
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("CveOrdenTrabajo") = value
+ End Set
+ End Property
+
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -672,6 +695,14 @@ Partial Class OC
'ASIGNA ESTATUS OC
CboE_SelectedIndexChanged(New Object, New EventArgs)
+
+ If Request("CveOrdenTrabajo") IsNot Nothing AndAlso Request("CveOrdenTrabajo").ToString.ToEntero > 0 Then
+ CveOrdenTrabajo = Request("CveOrdenTrabajo").ToEntero
+ CargaOT()
+ End If
+
+
+
End If
@@ -2548,6 +2579,20 @@ Partial Class OC
Else
TieneError = True
End If
+
+
+
+ If CveOrdenTrabajo > 0 Then
+
+ Dim ObjAF As New ClsAF(OC.IniciaTransacSQL)
+ If Not ObjAF.UpdateOrdenesTrabajoOC(CveOrdenTrabajo, CveOrdenCompra, UsuarioActual.CveEmpresa) Then
+ TieneError = True
+ End If
+
+ End If
+
+
+
End If
@@ -8076,4 +8121,112 @@ Partial Class OC
' End If
' ObjVentas.Dispose()
'End Sub
+
+
+ Private Sub CargaOT()
+
+ If CveOrdenTrabajo > 0 Then
+
+ Dim ObjAF As New ClsAF
+
+ Dim CveSubProyecto As Integer = 0
+ Dim SubProyecto As String = ""
+
+ Dim CveProyecto As Integer = 0
+ Dim Proyecto As String = ""
+
+ If ObjAF.GetOrdenesTrabajo(CveOrdenTrabajo, -1, -1, -1, -1, -1, MinFecha, MaxFecha, Nothing, -1, UsuarioActual.CveEmpresa) Then
+
+ If ObjAF.DtResultados IsNot Nothing AndAlso ObjAF.DtResultados.Rows.Count > 0 Then
+
+ lblFolio.Text = $"Folio OT: {ObjAF.DtResultados(0)("Folio").ToString}"
+
+ CveSubProyecto = ObjAF.DtResultados(0)("CveSubProyecto").ToString.ToEntero
+ SubProyecto = GlobalDTSubProyectos(-1, CveSubProyecto)(0)("SubProyecto").ToString
+
+ CveProyecto = GlobalDTSubProyectos(-1, CveSubProyecto)(0)("CveProyecto").ToString.ToEntero
+ Proyecto = GlobalDTSubProyectos(-1, CveSubProyecto)(0)("Proyecto").ToString
+
+ 'DdlAF.SelectedValueExist(ObjAF.DtResultados(0)("CveAF").ToString)
+ 'DdlTipoServicio.SelectedValueExist(ObjAF.DtResultados(0)("CveTipoServicio").ToString)
+ 'TxtServicio.Text = ObjAF.DtResultados(0)("Servicio").ToString
+ DdlPrioridad.SelectedValueExist(ObjAF.DtResultados(0)("Prioridad").ToString)
+ 'txtFechaI.Text = ObjAF.DtResultados(0)("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy")
+
+ If ObjAF.DtResultados(0)("FechaFin").ToString.Length > 0 Then
+ 'txtFechaF.Text = ObjAF.DtResultados(0)("FechaFin").ToString.ToDate.ToString("dd/MM/yyyy")
+ End If
+
+ 'txtFechaFinReal.Text ""
+ 'DdlOrdenesTrabajoEstatus.SelectedValueExist(ObjAF.DtResultados(0)("CveEstatusOT").ToString)
+ Else
+ Alert("No se encontro la orden de trabajo", TipoMensaje.MsgAdvertencia)
+ End If
+ End If
+
+ If ObjAF.GetOrdenesTrabajoMateriales(CveOrdenTrabajo, UsuarioActual.CveEmpresa) Then
+
+
+ For Each DRow As DataRow In ObjAF.DtResultados.Rows
+
+ Dim Cantidad As Decimal = DRow("Faltante").ToString.ToDecimal
+
+ If Cantidad > 0 Then
+
+
+ Dim CvePS As Integer = DRow("CvePS").ToString.ToEntero
+ Dim PrecioUnitario As Double = 0
+
+ Dim dr As DataRow = DtDetalle.NewRow
+ Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=CvePS).FiltroPrimero("")
+ If DrPS Is Nothing Then
+ Alert("Ocurrió un error al cargar la información de los productos del archivo. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ Continue For
+ End If
+ Dim RetIVA As Double = DrPS("RetIVA").ToString.ToDouble
+ Dim RetISR As Double = DrPS("RetISR").ToString.ToDouble
+ Dim PS As String = DrPS("PS").ToString
+ Dim TotalPS As Double = If(PrecioUnitario > 0, PrecioUnitario * Cantidad, 0)
+ Dim CveUnidadMedida As Integer = DrPS("CveUnidadMedida").ToString.ToEntero
+ Dim UM As String = DrPS("UnidadMedida").ToString
+ Dim IvaPS As Double = DrPS("IVA").ToString.ToDouble
+ 'If IvaPS = -1 Then
+ ' Dim Drr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero())(0)
+ ' IvaPS = Drr("IVA").ToString().ToDouble()
+ 'End If
+ Dim IEPSPS As Double = DrPS("IEPSPorcentaje").ToString.ToDouble
+ Dim IEPSPSIVA As Double = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0)
+ Dim CveClasificacion As Integer = DrPS("CveClasificacion").ToString.ToEntero
+ Dim Clasificacion As String = DrPS("Clasificacion").ToString
+ Dim CveActivoFijo = HdnCveActivoFijo.Value.ToEntero
+ Dim IdCuentaPorEjercer As Integer = If(HdnCveCuentaPorEjercer.Value = String.Empty, -1, HdnCveCuentaPorEjercer.Value.ToEntero)
+ Dim IdCuentaComprometido As Integer = If(HdnCveCuentaComprometido.Value = String.Empty, -1, HdnCveCuentaComprometido.Value.ToEntero)
+ Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100
+
+ AddPS(Cantidad, CvePS, PS, "", PrecioUnitario, 0, TotalPS, CveUnidadMedida, IvaPS, IEPSPS, IEPSPSIVA, CveClasificacion, UM, Clasificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto, LblCodigo.Text,
+ CveActivoFijo, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer, IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero,
+ DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR)
+
+ End If
+
+
+ Next
+
+ End If
+
+
+
+
+ ObjAF.Dispose()
+
+ GvD.DataSource = DtDetalle
+ GvD.DataBind()
+
+ End If
+
+
+ End Sub
+
+
+
End Class
diff --git a/Ventas/ActualizarPrecios.aspx b/Ventas/ActualizarPrecios.aspx
index e11bc84a5..7fa9d0f4f 100644
--- a/Ventas/ActualizarPrecios.aspx
+++ b/Ventas/ActualizarPrecios.aspx
@@ -54,6 +54,7 @@
+
@@ -67,6 +68,11 @@
Incativos
+
+
+
+
+
diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb
index 0bb9d3497..54e4822da 100644
--- a/Ventas/ActualizarPrecios.aspx.vb
+++ b/Ventas/ActualizarPrecios.aspx.vb
@@ -66,6 +66,7 @@ Partial Class Ventas_ActualizarPrecios
CargaPreciosLista()
CargaProveedores()
CargarMarcas()
+ CargarModelos()
End Sub
Public Sub CargaDDlClasif()
DDlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
@@ -73,32 +74,32 @@ Partial Class Ventas_ActualizarPrecios
DDlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
- Public Sub CargaPreciosLista()
-
- DdlPrecioLista.Items.Clear()
-
- If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'si manneja precios de lista
- Dim ObjVta As New ClsVentas
- Dim primerItem As String = ""
- If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
- DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy()
- DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy()
- primerItem = ObjVta.DtResultados.FiltroPrimeroValor("CvePrecioLista")
- End If
- ObjVta.Dispose()
-
-
- DdlPrecioLista.DataBind()
- DdlPrecioListaCarga.DataBind()
-
- If (DdlPrecioLista.Items.Count = 1) Then
- DdlPrecioLista.Items.FindByValue(primerItem).Selected = True
- End If
- Else
+ Public Sub CargaPreciosLista()
+
+ DdlPrecioLista.Items.Clear()
+
+ If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'si manneja precios de lista
+ Dim ObjVta As New ClsVentas
+ Dim primerItem As String = ""
+ If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
+ DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy()
+ DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy()
+ primerItem = ObjVta.DtResultados.FiltroPrimeroValor("CvePrecioLista")
+ End If
+ ObjVta.Dispose()
+
+
+ DdlPrecioLista.DataBind()
+ DdlPrecioListaCarga.DataBind()
+
+ If (DdlPrecioLista.Items.Count = 1) Then
+ DdlPrecioLista.Items.FindByValue(primerItem).Selected = True
+ End If
+ Else
DdlPrecioLista.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))
- DdlPrecioListaCarga.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))
- End If
-
+ DdlPrecioListaCarga.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))
+ End If
+
End Sub
Public Sub CargaPS()
@@ -141,6 +142,20 @@ Partial Class Ventas_ActualizarPrecios
DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
+ Private Sub CargarModelos()
+ If UsuarioActual.Empresa.Funcionalidad(558).ToString = "1" Then
+ lblModelo.visible = True
+ DdlModelo.Visible = True
+ Dim ObjGeneral As New ClsGenerales
+ If ObjGeneral.GetModelos(UsuarioActual.CveEmpresa) Then
+ DdlModelo.DataSource = ObjGeneral.DtResultados
+ End If
+ ObjGeneral.Dispose()
+ DdlModelo.DataBind()
+ End If
+ DdlModelo.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
+ End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
Dim objPS As New ClsProductosServicios
Dim CveProveedor As Integer = -1
@@ -156,7 +171,7 @@ Partial Class Ventas_ActualizarPrecios
End If
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, DdlPrecioLista.SelectedValue.ToEntero, DDlClasificacion.SelectedValue.ToEntero, CvePS,
- CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas) Then
+ CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero) Then
GVPrecios.DataSource = objPS.DtResultados
End If
objPS.Dispose()
@@ -208,7 +223,7 @@ Partial Class Ventas_ActualizarPrecios
ObjPS.Dispose()
BtnConsultar_Click(Nothing, Nothing)
- RegistraScript("$('#divAgregar').modal('hide')")
+ RegistraScript("$('#divAgregar').modal('hide')")
TxtImporte.Text = ""
TxtPrecio.Text = ""
TxtPorcentaje.Text = ""
@@ -395,26 +410,26 @@ Partial Class Ventas_ActualizarPrecios
Dim Correcto As Boolean = False
Dim CvePS As Integer = DtPS.FiltroPrimeroValor("CvePS", String.Format("Codigo='{0}' AND CveEmpresa={1}", row(0).ToString(), UsuarioActual.CveEmpresa))
Dim CvePrecioLista As Integer = DdlPrecioListaCarga.SelectedValue.ToEntero()
- Dim PrecioNuevo As Decimal = row("Precio").ToString().ToDecimal()
+ Dim PrecioNuevo As Decimal = row("Precio").ToString().ToDecimal()
Dim Porcentaje As Decimal = -1
- If CvePS > 0 AndAlso CvePrecioLista > 0 Then
-
-
+ If CvePS > 0 AndAlso CvePrecioLista > 0 Then
+
+
Correcto = ObjPS.UpdatePSPreciosLista(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
If Correcto Then
RowsCargados += 1
End If
- Else
- If CvePS > 0 AndAlso CvePrecioLista = -2 Then
- Correcto = ObjPS.UpdatePSPrecios(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
- If Correcto Then
- RowsCargados += 1
- End If
- Else
- Correcto = False
- End If
-
+ Else
+ If CvePS > 0 AndAlso CvePrecioLista = -2 Then
+ Correcto = ObjPS.UpdatePSPrecios(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
+ If Correcto Then
+ RowsCargados += 1
+ End If
+ Else
+ Correcto = False
+ End If
+
End If
If Not Correcto Then
ProductosNoCargados.AppendFormat("{0},", row("Producto / Servicio").ToString())
@@ -493,12 +508,12 @@ Partial Class Ventas_ActualizarPrecios
End While
Return dataTable
- End Function
+ End Function
#End Region
-
- Protected Sub gvSucursal_RowDataBound(sender As Object, e As GridViewRowEventArgs)
- If e.Row.RowType = DataControlRowType.DataRow Then
- e.Row.FCTextBox("TxtPrecioMinimo").Attributes.Add("onKeyUp", String.Format("FncSeleccionaChk({0});", e.Row.FCCheckBox("chkSucursal").ClientID))
- End If
- End Sub
+
+ Protected Sub gvSucursal_RowDataBound(sender As Object, e As GridViewRowEventArgs)
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ e.Row.FCTextBox("TxtPrecioMinimo").Attributes.Add("onKeyUp", String.Format("FncSeleccionaChk({0});", e.Row.FCCheckBox("chkSucursal").ClientID))
+ End If
+ End Sub
End Class
\ No newline at end of file