Merge branch 'master' of http://rpimienta@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -1,181 +1,181 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Bancos_CatBancos
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.GetBancos() Then
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtEjecutivo.Text.Trim, TxtTelefono.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtBanco.Text = ""
|
||||
TxtEjecutivo.Text = ""
|
||||
TxtTelefono.Text = ""
|
||||
Alert("El nuevo Banco se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulos.Update()
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(156) 'BANCO
|
||||
e.Row.Cells(1).Width = Unit.Pixel(206) 'EJECUTIVO
|
||||
e.Row.Cells(2).Width = Unit.Pixel(106) 'TELEFONO
|
||||
e.Row.Cells(3).Width = Unit.Pixel(95) 'ESTATUS
|
||||
e.Row.Cells(4).Width = Unit.Pixel(95) 'FECHA
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100) 'USUARIO
|
||||
e.Row.Cells(6).Width = Unit.Pixel(100) 'EDITAR
|
||||
e.Row.Cells(7).Width = Unit.Pixel(65) 'ELIMINAR
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.RemoveBancos(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
|
||||
Dim ObjBancos As New ClsBancos
|
||||
|
||||
Dim Banco As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtBanco"), TextBox).Text.Trim
|
||||
Dim Ejecutivo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtEjecutivo"), TextBox).Text.Trim
|
||||
Dim Telefono As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtTelefono"), TextBox).Text.Trim
|
||||
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveBanco As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
|
||||
If ObjBancos.UpdateBancos(Banco, Ejecutivo, Telefono, Estatus, CveBanco) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTBancos"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTBancos"), DataTable)
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Bancos_CatBancos
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.GetBancos() Then
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtEjecutivo.Text.Trim, TxtTelefono.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtBanco.Text = ""
|
||||
TxtEjecutivo.Text = ""
|
||||
TxtTelefono.Text = ""
|
||||
Alert("El nuevo Banco se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulos.Update()
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(156) 'BANCO
|
||||
e.Row.Cells(1).Width = Unit.Pixel(206) 'EJECUTIVO
|
||||
e.Row.Cells(2).Width = Unit.Pixel(106) 'TELEFONO
|
||||
e.Row.Cells(3).Width = Unit.Pixel(95) 'ESTATUS
|
||||
e.Row.Cells(4).Width = Unit.Pixel(95) 'FECHA
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100) 'USUARIO
|
||||
e.Row.Cells(6).Width = Unit.Pixel(100) 'EDITAR
|
||||
e.Row.Cells(7).Width = Unit.Pixel(65) 'ELIMINAR
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.RemoveBancos(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
|
||||
Dim ObjBancos As New ClsBancos
|
||||
|
||||
Dim Banco As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtBanco"), TextBox).Text.Trim
|
||||
Dim Ejecutivo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtEjecutivo"), TextBox).Text.Trim
|
||||
Dim Telefono As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtTelefono"), TextBox).Text.Trim
|
||||
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveBanco As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
|
||||
If ObjBancos.UpdateBancos(Banco, Ejecutivo, Telefono, Estatus, CveBanco) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTBancos"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTBancos"), DataTable)
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
3068
Bancos/IE.aspx
3068
Bancos/IE.aspx
File diff suppressed because it is too large
Load Diff
37530
Compras/Compras.aspx.vb
37530
Compras/Compras.aspx.vb
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,388 +1,388 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Compras_RepRembolsoComprobaciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Private ReadOnly Property CveCajaChica As Integer
|
||||
Get
|
||||
Return ViewState("CveCajaChica").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private ReadOnly Property CvePersonal As Integer
|
||||
Get
|
||||
Return ViewState("CvePersonal").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private Property CveMoneda As Integer
|
||||
Get
|
||||
Return ViewState("CveMoneda").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveMoneda") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property IdCuentaBancaria As Integer
|
||||
Get
|
||||
Return ViewState("IdCuentaBancaria").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("IdCuentaBancaria") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property NumeroReembolso As String
|
||||
Get
|
||||
NumeroReembolso = ViewState("NumeroReembolso").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("NumeroReembolso") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtCheques As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtCheques"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtCheques") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
Private Sub Compras_RepRembolsoComprobaciones_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
ViewState("CveMoneda") = 1
|
||||
|
||||
'Cargar Filtros
|
||||
Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario)
|
||||
dt = dt.FiltraParametros(String.Format("CveTipoCuenta = 1")) 'caja chica = 1
|
||||
DdlCajaChica.DataSource = dt
|
||||
DdlCajaChica.DataBind()
|
||||
|
||||
Dim ObjPersonal As New ClsRH
|
||||
ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa)
|
||||
DdlPersonal.DataSource = ObjPersonal.DtResultados
|
||||
ObjPersonal.Dispose()
|
||||
DdlPersonal.DataBind()
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlTipoPago_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ViewState("CveCajaChica") = -2
|
||||
ViewState("CvePersonal") = -2
|
||||
|
||||
LtTituloPago.Text = ""
|
||||
|
||||
If DdlTipoPago.SelectedValue = "1" Then
|
||||
DdlPersonal.Visible = True
|
||||
DdlPersonal.SelectedValue = "-2"
|
||||
LtTituloPago.Text = "F / E:"
|
||||
|
||||
'Valida Proceso 120 para ROL Administrador de obra - para FyE solo puede ver los del UsuarioActual
|
||||
If UsuarioActual.TienePermisoProceso(120) Then
|
||||
If UsuarioActual.CvePersonal > 0 Then
|
||||
DdlPersonal.SelectedValue = UsuarioActual.CvePersonal.ToString
|
||||
ViewState("CvePersonal") = UsuarioActual.CvePersonal
|
||||
End If
|
||||
DdlPersonal.Enabled = False
|
||||
End If
|
||||
|
||||
Else
|
||||
DdlPersonal.Visible = False
|
||||
DdlPersonal.SelectedValue = "-2"
|
||||
|
||||
DdlPersonal.Enabled = True
|
||||
End If
|
||||
|
||||
If DdlTipoPago.SelectedValue = "2" Then
|
||||
DdlCajaChica.Visible = True
|
||||
DdlCajaChica.SelectedValue = "-2"
|
||||
LtTituloPago.Text = "Caja Chica:"
|
||||
Else
|
||||
DdlCajaChica.Visible = False
|
||||
DdlCajaChica.SelectedValue = "-2"
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPersonal.SelectedIndexChanged
|
||||
ViewState("CvePersonal") = DdlPersonal.SelectedValue
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlCajaChica_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCajaChica.SelectedIndexChanged
|
||||
ViewState("CveCajaChica") = DdlCajaChica.SelectedValue
|
||||
End Sub
|
||||
|
||||
Protected Sub GvCxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxP.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.BackColor = Drawing.Color.LightGray
|
||||
End If
|
||||
'If e.Row.RowIndex = 1 Then
|
||||
' e.Row.Cells(0).Width = Unit.Pixel(100)
|
||||
' e.Row.Cells(1).Width = Unit.Pixel(300)
|
||||
' e.Row.Cells(2).Width = Unit.Pixel(70)
|
||||
' e.Row.Cells(3).Width = Unit.Pixel(70)
|
||||
' e.Row.Cells(4).Width = Unit.Pixel(80)
|
||||
' e.Row.Cells(5).Width = Unit.Pixel(40)
|
||||
' e.Row.Cells(6).Width = Unit.Pixel(60)
|
||||
' e.Row.Cells(7).Width = Unit.Pixel(60)
|
||||
'End If
|
||||
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right
|
||||
|
||||
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(7).ForeColor = Drawing.Color.Red
|
||||
If e.Row.DBCampo("DiasVencidos").ToDouble > 0 AndAlso CType(sender, GridView).ID = "GvCxP" Then e.Row.Cells(5).ForeColor = Drawing.Color.Red
|
||||
If e.Row.DBCampo("Original").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldoOriginal"), Literal).Text = ""
|
||||
If e.Row.DBCampo("Abonado").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlAbonado"), Literal).Text = ""
|
||||
If e.Row.DBCampo("Saldo").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldo"), Literal).Text = ""
|
||||
If Not e.Row.DBCampo("IdPoliza").ToEntero > 0 Then e.Row.Cells(13).Text = ""
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LbkUnificar_Click(sender As Object, e As EventArgs) Handles LbkUnificar.Click
|
||||
Dim ObjComp As New ClsCompras()
|
||||
Dim ObjMov As New ClsContabilidad(ObjComp.IniciaTransacSQL)
|
||||
Dim ObjAC As ClsContPAQi = Nothing
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
ObjAC.IniciaTransacSQL()
|
||||
End If
|
||||
Dim TieneError = False
|
||||
Dim CvePrePoliza As Integer = 0
|
||||
Dim IdPoliza As Integer = 0
|
||||
Dim Msg As New StringBuilder
|
||||
|
||||
CvePrePoliza = ObjMov.AddPrePolizas("Compras/Registrar", 1, DtDatos(0)("Original").ToString.ToDecimal, DtDatos(0)("Original").ToString.ToDecimal, CveMoneda, TxtFechaUnificacion.Text.Trim.ToDate(), TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
|
||||
|
||||
If CvePrePoliza > 0 AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then
|
||||
If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, DdlPersonal.SelectedValue.ToEntero, -1, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
If CvePrePoliza > 0 AndAlso DdlCajaChica.SelectedValue.ToEntero > 0 Then
|
||||
If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, -1, DdlCajaChica.SelectedValue.ToEntero, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
||||
If ObjMov.ValorPolizaDescuadre > 0 Then
|
||||
GuardaLogAD($"Compras/RepRembolsoComprobaciones - Unificar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
Msg.AppendFormat("Se unificaron todas las compras con éxito")
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.UsaContabilidad AndAlso Not TieneError Then
|
||||
If ObjAC Is Nothing Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
If Not ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
|
||||
TieneError = True
|
||||
Alert($"Ocurrio un error al contabilizar {ObjMov.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
IdPoliza = ObjMov.ContaIdPoliza
|
||||
End If
|
||||
End If
|
||||
|
||||
If IdPoliza > 0 AndAlso Not TieneError Then
|
||||
Msg.AppendFormat("<br/><br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
ObjComp.Commit()
|
||||
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
ObjComp.RollBack()
|
||||
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
||||
Alert("Ocurrió un error al unificar las compras", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
ObjComp.Dispose()
|
||||
ObjMov.Dispose()
|
||||
If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaCxP()
|
||||
End Sub
|
||||
Private Sub CargaDatos(tCveIE As Integer)
|
||||
Dim ObjIE As New ClsBancos()
|
||||
|
||||
If ObjIE.GetBancosIE(tCveIE, UsuarioActual.CveEmpresa) Then
|
||||
If ObjIE.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Else
|
||||
Alert("El Documento solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ObjIE.Dispose()
|
||||
|
||||
End Sub
|
||||
Protected Sub CargaCxP()
|
||||
Dim ObjMovtos As New ClsMovimientos
|
||||
|
||||
GvCxP.Visible = True
|
||||
|
||||
ObjMovtos.GetCxPPersonalCajaChica(UsuarioActual.CveEmpresa, CvePersonal, CveCajaChica, If(TxtNumeroReembolso.Text.Trim = "", "-1", TxtNumeroReembolso.Text.Trim))
|
||||
DtDatos = ObjMovtos.DtResultados
|
||||
GvCxP.DataSource = DtDatos
|
||||
|
||||
'cargo si tiene cheques pendientes sin amortizar
|
||||
If CvePersonal > 0 Then
|
||||
If DtDatos.Rows.Count > 0 AndAlso TxtNumeroReembolso.Text.Trim <> "" Then
|
||||
TxtConcepto.Text = $"{DdlPersonal.SelectedItem} R#{TxtNumeroReembolso.Text} ${DtDatos(0)("Original").ToString.FormatoNumero}"
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
divUnificar.Visible = True
|
||||
If DtDatos.Rows.Count > 1 Then TxtFechaUnificacion.Text = DtDatos(1)("FechaCompra").ToString.ToDate.ToShortDateString
|
||||
End If
|
||||
CargaEgresosSinComprobar()
|
||||
Else
|
||||
If UsuarioActual.CveEmpresa = 119 Then divUnificar.Visible = False
|
||||
End If
|
||||
'ObjMovtos.GetEgresosSinComprobarPersonalDetalle(CvePersonal, UsuarioActual.CveEmpresa)
|
||||
Else
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
divUnificar.Visible = True
|
||||
If DtDatos.Rows.Count > 1 Then TxtFechaUnificacion.Text = DtDatos(1)("FechaCompra").ToString.ToDate.ToShortDateString
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso CveCajaChica > 0 AndAlso DtDatos.Rows.Count > 0 AndAlso TxtNumeroReembolso.Text.Trim <> "" Then
|
||||
TxtConcepto.Text = $"{DdlCajaChica.SelectedItem} R#{TxtNumeroReembolso.Text} ${DtDatos(0)("Original").ToString.FormatoNumero}"
|
||||
|
||||
divUnificar.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjMovtos.Dispose()
|
||||
GvCxP.DataBind()
|
||||
|
||||
LnkImprimir.Visible = True
|
||||
NumeroReembolso = TxtNumeroReembolso.Text
|
||||
If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then
|
||||
If NumeroReembolso <> "" AndAlso CvePersonal > 0 AndAlso DtDatos.MAX("CvePrePolizaComprobacionSinBancos").ToEntero > 0 Then
|
||||
DivVincularEgreso.Visible = True
|
||||
Else
|
||||
DivVincularEgreso.Visible = False
|
||||
End If
|
||||
If DtDatos.MAX("IdPoliza").ToEntero > 0 Then
|
||||
LbkUnificar.Visible = False
|
||||
Else
|
||||
LbkUnificar.Visible = True
|
||||
End If
|
||||
End If
|
||||
UpAcciones.Update()
|
||||
|
||||
UPCompras.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "PDF"
|
||||
Protected Sub LnkImprimir_Click(sender As Object, e As EventArgs) Handles LnkImprimir.Click
|
||||
Imprimir("PDF")
|
||||
End Sub
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
Imprimir("EXCEL")
|
||||
End Sub
|
||||
|
||||
Private Sub Imprimir(Formato As String)
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
|
||||
If Archivo.Exists Then
|
||||
params.Add(New ReportParameter("Numero", NumeroReembolso))
|
||||
params.Add(New ReportParameter("Anio", DtDatos.FiltraParametros("CveCompra > 0").MAX("Fecha").ToDate.Year.ToString))
|
||||
params.Add(New ReportParameter("Nombre", DtDatos.MAX("SubProyecto")))
|
||||
params.Add(New ReportParameter("Fecha", Now.Date.ToString))
|
||||
params.Add(New ReportParameter("Elaboro", ""))
|
||||
params.Add(New ReportParameter("Autorizo", ""))
|
||||
params.Add(New ReportParameter("ElaboroPuesto", ""))
|
||||
params.Add(New ReportParameter("AutorizoPuesto", ""))
|
||||
ImprimirPDF(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta), DtDatos.FiltraParametros("CveCompra > 0"), params, "Reembolso", RDSName:="DsCompras")
|
||||
Else
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
|
||||
|
||||
params.Add(New ReportParameter("CajaChica", If(DdlCajaChica.SelectedValue.ToEntero > 0, "Caja chica: " & DdlCajaChica.SelectedItem.Text, "Funcionario/Empleado: " & DdlPersonal.SelectedItem.Text)))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepRembolsosComprobaciones.rdlc", DtDatos, params, "RepRembolsosComprobaciones", Formato:=Formato)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub CargaEgresosSinComprobar()
|
||||
If CvePersonal > 0 Then
|
||||
DdlCheque.Items.Clear()
|
||||
Dim ObjMov As New ClsMovimientos
|
||||
If ObjMov.GetEgresosSinComprobarPersonalDetalle(CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
DdlCheque.DataSource = ObjMov.DtResultados.FiltraParametros("CveIE > 0", "FechaDocumento, FolioFecha")
|
||||
DdlCheque.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
ObjMov.Dispose()
|
||||
DdlCheque.DataBind()
|
||||
UPCompras.Update()
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnVincularEgreso_Click(sender As Object, e As EventArgs)
|
||||
If Not DdlCheque.SelectedValue.ToEntero > 0 Then
|
||||
Alert("Tiene que tener seleccionado un egreso sin comprobar", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjIE As New ClsBancos
|
||||
If ObjIE.UpdateComprobacionSinBancos(DdlCheque.SelectedValue.ToEntero, DtDatos.MAX("CvePrePolizaComprobacionSinBancos").ToEntero,
|
||||
CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Vinculado correctamente")
|
||||
DdlCheque.SelectedIndex = 0
|
||||
CargaEgresosSinComprobar()
|
||||
End If
|
||||
ObjIE.Dispose()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Compras_RepRembolsoComprobaciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Private ReadOnly Property CveCajaChica As Integer
|
||||
Get
|
||||
Return ViewState("CveCajaChica").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private ReadOnly Property CvePersonal As Integer
|
||||
Get
|
||||
Return ViewState("CvePersonal").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private Property CveMoneda As Integer
|
||||
Get
|
||||
Return ViewState("CveMoneda").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveMoneda") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property IdCuentaBancaria As Integer
|
||||
Get
|
||||
Return ViewState("IdCuentaBancaria").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("IdCuentaBancaria") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property NumeroReembolso As String
|
||||
Get
|
||||
NumeroReembolso = ViewState("NumeroReembolso").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("NumeroReembolso") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtCheques As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtCheques"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtCheques") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
Private Sub Compras_RepRembolsoComprobaciones_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
ViewState("CveMoneda") = 1
|
||||
|
||||
'Cargar Filtros
|
||||
Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario)
|
||||
dt = dt.FiltraParametros(String.Format("CveTipoCuenta = 1")) 'caja chica = 1
|
||||
DdlCajaChica.DataSource = dt
|
||||
DdlCajaChica.DataBind()
|
||||
|
||||
Dim ObjPersonal As New ClsRH
|
||||
ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa)
|
||||
DdlPersonal.DataSource = ObjPersonal.DtResultados
|
||||
ObjPersonal.Dispose()
|
||||
DdlPersonal.DataBind()
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlTipoPago_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ViewState("CveCajaChica") = -2
|
||||
ViewState("CvePersonal") = -2
|
||||
|
||||
LtTituloPago.Text = ""
|
||||
|
||||
If DdlTipoPago.SelectedValue = "1" Then
|
||||
DdlPersonal.Visible = True
|
||||
DdlPersonal.SelectedValue = "-2"
|
||||
LtTituloPago.Text = "F / E:"
|
||||
|
||||
'Valida Proceso 120 para ROL Administrador de obra - para FyE solo puede ver los del UsuarioActual
|
||||
If UsuarioActual.TienePermisoProceso(120) Then
|
||||
If UsuarioActual.CvePersonal > 0 Then
|
||||
DdlPersonal.SelectedValue = UsuarioActual.CvePersonal.ToString
|
||||
ViewState("CvePersonal") = UsuarioActual.CvePersonal
|
||||
End If
|
||||
DdlPersonal.Enabled = False
|
||||
End If
|
||||
|
||||
Else
|
||||
DdlPersonal.Visible = False
|
||||
DdlPersonal.SelectedValue = "-2"
|
||||
|
||||
DdlPersonal.Enabled = True
|
||||
End If
|
||||
|
||||
If DdlTipoPago.SelectedValue = "2" Then
|
||||
DdlCajaChica.Visible = True
|
||||
DdlCajaChica.SelectedValue = "-2"
|
||||
LtTituloPago.Text = "Caja Chica:"
|
||||
Else
|
||||
DdlCajaChica.Visible = False
|
||||
DdlCajaChica.SelectedValue = "-2"
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPersonal.SelectedIndexChanged
|
||||
ViewState("CvePersonal") = DdlPersonal.SelectedValue
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlCajaChica_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCajaChica.SelectedIndexChanged
|
||||
ViewState("CveCajaChica") = DdlCajaChica.SelectedValue
|
||||
End Sub
|
||||
|
||||
Protected Sub GvCxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxP.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.BackColor = Drawing.Color.LightGray
|
||||
End If
|
||||
'If e.Row.RowIndex = 1 Then
|
||||
' e.Row.Cells(0).Width = Unit.Pixel(100)
|
||||
' e.Row.Cells(1).Width = Unit.Pixel(300)
|
||||
' e.Row.Cells(2).Width = Unit.Pixel(70)
|
||||
' e.Row.Cells(3).Width = Unit.Pixel(70)
|
||||
' e.Row.Cells(4).Width = Unit.Pixel(80)
|
||||
' e.Row.Cells(5).Width = Unit.Pixel(40)
|
||||
' e.Row.Cells(6).Width = Unit.Pixel(60)
|
||||
' e.Row.Cells(7).Width = Unit.Pixel(60)
|
||||
'End If
|
||||
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right
|
||||
|
||||
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(7).ForeColor = Drawing.Color.Red
|
||||
If e.Row.DBCampo("DiasVencidos").ToDouble > 0 AndAlso CType(sender, GridView).ID = "GvCxP" Then e.Row.Cells(5).ForeColor = Drawing.Color.Red
|
||||
If e.Row.DBCampo("Original").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldoOriginal"), Literal).Text = ""
|
||||
If e.Row.DBCampo("Abonado").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlAbonado"), Literal).Text = ""
|
||||
If e.Row.DBCampo("Saldo").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldo"), Literal).Text = ""
|
||||
If Not e.Row.DBCampo("IdPoliza").ToEntero > 0 Then e.Row.Cells(13).Text = ""
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LbkUnificar_Click(sender As Object, e As EventArgs) Handles LbkUnificar.Click
|
||||
Dim ObjComp As New ClsCompras()
|
||||
Dim ObjMov As New ClsContabilidad(ObjComp.IniciaTransacSQL)
|
||||
Dim ObjAC As ClsContPAQi = Nothing
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
ObjAC.IniciaTransacSQL()
|
||||
End If
|
||||
Dim TieneError = False
|
||||
Dim CvePrePoliza As Integer = 0
|
||||
Dim IdPoliza As Integer = 0
|
||||
Dim Msg As New StringBuilder
|
||||
|
||||
CvePrePoliza = ObjMov.AddPrePolizas("Compras/Registrar", 1, DtDatos(0)("Original").ToString.ToDecimal, DtDatos(0)("Original").ToString.ToDecimal, CveMoneda, TxtFechaUnificacion.Text.Trim.ToDate(), TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
|
||||
|
||||
If CvePrePoliza > 0 AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then
|
||||
If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, DdlPersonal.SelectedValue.ToEntero, -1, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
If CvePrePoliza > 0 AndAlso DdlCajaChica.SelectedValue.ToEntero > 0 Then
|
||||
If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, -1, DdlCajaChica.SelectedValue.ToEntero, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
||||
If ObjMov.ValorPolizaDescuadre > 0 Then
|
||||
GuardaLogAD($"Compras/RepRembolsoComprobaciones - Unificar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
Msg.AppendFormat("Se unificaron todas las compras con éxito")
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.UsaContabilidad AndAlso Not TieneError Then
|
||||
If ObjAC Is Nothing Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
If Not ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
|
||||
TieneError = True
|
||||
Alert($"Ocurrio un error al contabilizar {ObjMov.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
IdPoliza = ObjMov.ContaIdPoliza
|
||||
End If
|
||||
End If
|
||||
|
||||
If IdPoliza > 0 AndAlso Not TieneError Then
|
||||
Msg.AppendFormat("<br/><br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
ObjComp.Commit()
|
||||
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
ObjComp.RollBack()
|
||||
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
||||
Alert("Ocurrió un error al unificar las compras", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
ObjComp.Dispose()
|
||||
ObjMov.Dispose()
|
||||
If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaCxP()
|
||||
End Sub
|
||||
Private Sub CargaDatos(tCveIE As Integer)
|
||||
Dim ObjIE As New ClsBancos()
|
||||
|
||||
If ObjIE.GetBancosIE(tCveIE, UsuarioActual.CveEmpresa) Then
|
||||
If ObjIE.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Else
|
||||
Alert("El Documento solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ObjIE.Dispose()
|
||||
|
||||
End Sub
|
||||
Protected Sub CargaCxP()
|
||||
Dim ObjMovtos As New ClsMovimientos
|
||||
|
||||
GvCxP.Visible = True
|
||||
|
||||
ObjMovtos.GetCxPPersonalCajaChica(UsuarioActual.CveEmpresa, CvePersonal, CveCajaChica, If(TxtNumeroReembolso.Text.Trim = "", "-1", TxtNumeroReembolso.Text.Trim))
|
||||
DtDatos = ObjMovtos.DtResultados
|
||||
GvCxP.DataSource = DtDatos
|
||||
|
||||
'cargo si tiene cheques pendientes sin amortizar
|
||||
If CvePersonal > 0 Then
|
||||
If DtDatos.Rows.Count > 0 AndAlso TxtNumeroReembolso.Text.Trim <> "" Then
|
||||
TxtConcepto.Text = $"{DdlPersonal.SelectedItem} R#{TxtNumeroReembolso.Text} ${DtDatos(0)("Original").ToString.FormatoNumero}"
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
divUnificar.Visible = True
|
||||
If DtDatos.Rows.Count > 1 Then TxtFechaUnificacion.Text = DtDatos(1)("FechaCompra").ToString.ToDate.ToShortDateString
|
||||
End If
|
||||
CargaEgresosSinComprobar()
|
||||
Else
|
||||
If UsuarioActual.CveEmpresa = 119 Then divUnificar.Visible = False
|
||||
End If
|
||||
'ObjMovtos.GetEgresosSinComprobarPersonalDetalle(CvePersonal, UsuarioActual.CveEmpresa)
|
||||
Else
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
divUnificar.Visible = True
|
||||
If DtDatos.Rows.Count > 1 Then TxtFechaUnificacion.Text = DtDatos(1)("FechaCompra").ToString.ToDate.ToShortDateString
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso CveCajaChica > 0 AndAlso DtDatos.Rows.Count > 0 AndAlso TxtNumeroReembolso.Text.Trim <> "" Then
|
||||
TxtConcepto.Text = $"{DdlCajaChica.SelectedItem} R#{TxtNumeroReembolso.Text} ${DtDatos(0)("Original").ToString.FormatoNumero}"
|
||||
|
||||
divUnificar.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjMovtos.Dispose()
|
||||
GvCxP.DataBind()
|
||||
|
||||
LnkImprimir.Visible = True
|
||||
NumeroReembolso = TxtNumeroReembolso.Text
|
||||
If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then
|
||||
If NumeroReembolso <> "" AndAlso CvePersonal > 0 AndAlso DtDatos.MAX("CvePrePolizaComprobacionSinBancos").ToEntero > 0 Then
|
||||
DivVincularEgreso.Visible = True
|
||||
Else
|
||||
DivVincularEgreso.Visible = False
|
||||
End If
|
||||
If DtDatos.MAX("IdPoliza").ToEntero > 0 Then
|
||||
LbkUnificar.Visible = False
|
||||
Else
|
||||
LbkUnificar.Visible = True
|
||||
End If
|
||||
End If
|
||||
UpAcciones.Update()
|
||||
|
||||
UPCompras.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "PDF"
|
||||
Protected Sub LnkImprimir_Click(sender As Object, e As EventArgs) Handles LnkImprimir.Click
|
||||
Imprimir("PDF")
|
||||
End Sub
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
Imprimir("EXCEL")
|
||||
End Sub
|
||||
|
||||
Private Sub Imprimir(Formato As String)
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
|
||||
If Archivo.Exists Then
|
||||
params.Add(New ReportParameter("Numero", NumeroReembolso))
|
||||
params.Add(New ReportParameter("Anio", DtDatos.FiltraParametros("CveCompra > 0").MAX("Fecha").ToDate.Year.ToString))
|
||||
params.Add(New ReportParameter("Nombre", DtDatos.MAX("SubProyecto")))
|
||||
params.Add(New ReportParameter("Fecha", Now.Date.ToString))
|
||||
params.Add(New ReportParameter("Elaboro", ""))
|
||||
params.Add(New ReportParameter("Autorizo", ""))
|
||||
params.Add(New ReportParameter("ElaboroPuesto", ""))
|
||||
params.Add(New ReportParameter("AutorizoPuesto", ""))
|
||||
ImprimirPDF(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta), DtDatos.FiltraParametros("CveCompra > 0"), params, "Reembolso", RDSName:="DsCompras")
|
||||
Else
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
|
||||
|
||||
params.Add(New ReportParameter("CajaChica", If(DdlCajaChica.SelectedValue.ToEntero > 0, "Caja chica: " & DdlCajaChica.SelectedItem.Text, "Funcionario/Empleado: " & DdlPersonal.SelectedItem.Text)))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepRembolsosComprobaciones.rdlc", DtDatos, params, "RepRembolsosComprobaciones", Formato:=Formato)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub CargaEgresosSinComprobar()
|
||||
If CvePersonal > 0 Then
|
||||
DdlCheque.Items.Clear()
|
||||
Dim ObjMov As New ClsMovimientos
|
||||
If ObjMov.GetEgresosSinComprobarPersonalDetalle(CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
DdlCheque.DataSource = ObjMov.DtResultados.FiltraParametros("CveIE > 0", "FechaDocumento, FolioFecha")
|
||||
DdlCheque.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
ObjMov.Dispose()
|
||||
DdlCheque.DataBind()
|
||||
UPCompras.Update()
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnVincularEgreso_Click(sender As Object, e As EventArgs)
|
||||
If Not DdlCheque.SelectedValue.ToEntero > 0 Then
|
||||
Alert("Tiene que tener seleccionado un egreso sin comprobar", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjIE As New ClsBancos
|
||||
If ObjIE.UpdateComprobacionSinBancos(DdlCheque.SelectedValue.ToEntero, DtDatos.MAX("CvePrePolizaComprobacionSinBancos").ToEntero,
|
||||
CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Vinculado correctamente")
|
||||
DdlCheque.SelectedIndex = 0
|
||||
CargaEgresosSinComprobar()
|
||||
End If
|
||||
ObjIE.Dispose()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -203,7 +203,7 @@
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>www.adsistemas.mx|facturacion@adssistemas.mx</Value>
|
||||
<Value>www.adssistemas.mx|facturacion@adssistemas.mx</Value>
|
||||
<Style>
|
||||
<FontStyle>Normal</FontStyle>
|
||||
<FontFamily>Calibri</FontFamily>
|
||||
|
||||
@@ -8,14 +8,6 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#DivShipment {
|
||||
z-index: 1999;
|
||||
}
|
||||
|
||||
#DivStop {
|
||||
z-index: 2000;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
@@ -257,11 +249,13 @@
|
||||
<asp:RequiredFieldValidator ID="RFVName" runat="server" ControlToValidate="TxtLocName" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Name''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLocName.ClientID.ToString()%>">Name:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLocID" CssClass="form-control " runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtLocID" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Location''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLocID.ClientID.ToString()%>">Location ID:</label>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLocID" CssClass="form-control " runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtLocID" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Location''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLocID.ClientID.ToString()%>">Location ID:</label>
|
||||
</div>
|
||||
</form>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
@@ -306,19 +300,27 @@
|
||||
<div class="row v-center">
|
||||
<label class="col-md-12" style="color: gray">Early Arrival Time:</label>
|
||||
</div>
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtFechaStopI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaIStop" runat="server" ControlToValidate="TxtFechaStopI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Early Arrival Time''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEI" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaIStop" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm">
|
||||
<asp:TextBox ID="TxtFechaStopI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaIStop" runat="server" ControlToValidate="TxtFechaStopI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Early Arrival Time''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEI" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaIStop" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row v-center">
|
||||
<label class="col-md-12" style="color: gray">Late Arrival Time:</label>
|
||||
</div>
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtFechaStopF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaFStop" runat="server" ControlToValidate="TxtFechaStopF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Late Arrival Time''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEF" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaFStop" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm">
|
||||
<asp:TextBox ID="TxtFechaStopF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaFStop" runat="server" ControlToValidate="TxtFechaStopF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Late Arrival Time''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEF" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaFStop" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@@ -346,9 +348,16 @@
|
||||
<asp:RequiredFieldValidator ID="RFVStopRole" runat="server" ControlToValidate="DdlStopRole" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Stop Role''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlStopRole.ClientID.ToString()%>">Stop Role:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLoc" CssClass="form-control " runat="server"></asp:TextBox>
|
||||
<label for="<%= TxtLoc.ClientID.ToString()%>">Search Location:</label>
|
||||
<div class="row v-center">
|
||||
<div class="col-md-9">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLoc" CssClass="form-control" runat="server"></asp:TextBox>
|
||||
<label for="<%= TxtLoc.ClientID.ToString()%>">Search Location:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 v-center">
|
||||
<button type="button" class="btn btn-primary" onclick="BtnBuscar();">Buscar</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
@@ -510,6 +519,9 @@
|
||||
var markersEvent = [];
|
||||
var markerEvent;
|
||||
|
||||
var searchBox;
|
||||
var searchBoxEvent;
|
||||
|
||||
$(document).ready(function () {
|
||||
initMap();
|
||||
Sys.Application.add_load(function (s, e) {
|
||||
@@ -517,9 +529,10 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('#DivShipment').on('hidden.bs.modal', function () {
|
||||
return false;
|
||||
});
|
||||
|
||||
//$("form").submit(function (event) {
|
||||
// event.preventDefault();
|
||||
//});
|
||||
|
||||
function initMap() {
|
||||
|
||||
@@ -544,65 +557,23 @@
|
||||
directionsDisplayEvent.setOptions({ suppressMarkers: true });
|
||||
directionsDisplayEvent.setMap(mapEvent);
|
||||
|
||||
var searchBox = new google.maps.places.SearchBox(document.getElementById("<%= TxtLoc.ClientID%>"));
|
||||
var searchBoxEvent = new google.maps.places.SearchBox(document.getElementById("<%= TxtLoc2.ClientID%>"));
|
||||
searchBox = new google.maps.places.SearchBox(document.getElementById("<%= TxtLoc.ClientID%>"));
|
||||
searchBoxEvent = new google.maps.places.SearchBox(document.getElementById("<%= TxtLoc2.ClientID%>"));
|
||||
|
||||
$("#<%= TxtLoc.ClientID%>").bind('keypress', function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#<%= TxtLoc2.ClientID%>").bind('keypress', function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
searchBox.addListener('places_changed', function () {
|
||||
var places = searchBox.getPlaces();
|
||||
if (places.length == 0) {
|
||||
return;
|
||||
}
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
places.forEach(function (place) {
|
||||
if (!place.geometry) {
|
||||
console.log("Returned place contains no geometry");
|
||||
return;
|
||||
}
|
||||
var lat = place.geometry.location.lat();
|
||||
var lng = place.geometry.location.lng();
|
||||
|
||||
$("#<%= TxtLatLong.ClientID%>").val(lat + ',' + lng);
|
||||
|
||||
getDirecciones(lat, lng);
|
||||
|
||||
var icon = {
|
||||
url: 'http://maps.google.com/mapfiles/ms/micons/truck.png',
|
||||
size: new google.maps.Size(71, 71),
|
||||
origin: new google.maps.Point(0, 0),
|
||||
anchor: new google.maps.Point(17, 34),
|
||||
scaledSize: new google.maps.Size(25, 25)
|
||||
};
|
||||
|
||||
marker = new google.maps.Marker({
|
||||
map: map,
|
||||
icon: icon,
|
||||
title: place.name,
|
||||
position: place.geometry.location,
|
||||
draggable: true,
|
||||
animation: google.maps.Animation.DROP
|
||||
});
|
||||
|
||||
google.maps.event.addListener(marker, 'dragend', function () {
|
||||
var pos = marker.getPosition();
|
||||
getDirecciones(pos.lat(), pos.lng());
|
||||
});
|
||||
// Create a marker for each place.
|
||||
deleteMarkers(markers);
|
||||
markers.push(marker);
|
||||
|
||||
if (place.geometry.viewport) {
|
||||
// Only geocodes have viewport.
|
||||
bounds.union(place.geometry.viewport);
|
||||
} else {
|
||||
bounds.extend(place.geometry.location);
|
||||
}
|
||||
|
||||
map.fitBounds(bounds);
|
||||
map.setCenter(bounds.getCenter());
|
||||
|
||||
});
|
||||
|
||||
var places = searchBox.getPlaces();
|
||||
BuscarDireccion(places);
|
||||
});
|
||||
|
||||
searchBoxEvent.addListener('places_changed', function () {
|
||||
@@ -632,6 +603,67 @@
|
||||
});
|
||||
|
||||
}
|
||||
function BtnBuscar() {
|
||||
var input = document.getElementById("<%= TxtLoc.ClientID%>");
|
||||
|
||||
google.maps.event.trigger(input, 'focus', {});
|
||||
google.maps.event.trigger(input, 'keydown', { keyCode: 13 });
|
||||
google.maps.event.trigger(this, 'focus', {});
|
||||
}
|
||||
function BuscarDireccion(places) {
|
||||
if (places.length == 0) {
|
||||
return;
|
||||
}
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
places.forEach(function (place) {
|
||||
if (!place.geometry) {
|
||||
console.log("Returned place contains no geometry");
|
||||
return;
|
||||
}
|
||||
var lat = place.geometry.location.lat();
|
||||
var lng = place.geometry.location.lng();
|
||||
|
||||
$("#<%= TxtLatLong.ClientID%>").val(lat + ',' + lng);
|
||||
|
||||
getDirecciones(lat, lng);
|
||||
|
||||
var icon = {
|
||||
url: 'http://maps.google.com/mapfiles/ms/micons/truck.png',
|
||||
size: new google.maps.Size(71, 71),
|
||||
origin: new google.maps.Point(0, 0),
|
||||
anchor: new google.maps.Point(17, 34),
|
||||
scaledSize: new google.maps.Size(25, 25)
|
||||
};
|
||||
|
||||
marker = new google.maps.Marker({
|
||||
map: map,
|
||||
icon: icon,
|
||||
title: place.name,
|
||||
position: place.geometry.location,
|
||||
draggable: true,
|
||||
animation: google.maps.Animation.DROP
|
||||
});
|
||||
|
||||
google.maps.event.addListener(marker, 'dragend', function () {
|
||||
var pos = marker.getPosition();
|
||||
getDirecciones(pos.lat(), pos.lng());
|
||||
});
|
||||
// Create a marker for each place.
|
||||
deleteMarkers(markers);
|
||||
markers.push(marker);
|
||||
|
||||
if (place.geometry.viewport) {
|
||||
// Only geocodes have viewport.
|
||||
bounds.union(place.geometry.viewport);
|
||||
} else {
|
||||
bounds.extend(place.geometry.location);
|
||||
}
|
||||
|
||||
map.fitBounds(bounds);
|
||||
map.setCenter(bounds.getCenter());
|
||||
|
||||
});
|
||||
}
|
||||
function cargapin(lat, lng) {
|
||||
setTimeout(function () { SetMapPinEvent(lat, lng) }, 1000);
|
||||
}
|
||||
@@ -682,22 +714,21 @@
|
||||
}
|
||||
markers = [];
|
||||
}
|
||||
|
||||
function getDirecciones(lat, lng) {
|
||||
var url = '<%= ClsPaginas.UrlDirecciones%>' + 'nominatim/reverse.php?format=jsonv2&zoom=18&addressdetails=1&lat=' + lat + '&lon=' + lng;
|
||||
$.getJSON(url, function (data) {
|
||||
if (typeof (data.error) === 'undefined') {
|
||||
|
||||
$("#<%= TxtLatLong.ClientID%>").val(lat + ',' + lng);
|
||||
$("#<%= TxtAddress.ClientID%>").val(data.display_name);
|
||||
$("#<%= TxtCity.ClientID%>").val(data.address.city);
|
||||
$("#<%= TxtState.ClientID%>").val(data.address.state);
|
||||
$("#<%= TxtContry.ClientID%>").val(data.address.country);
|
||||
$("#<%= TxtPostalCode.ClientID%>").val(data.address.postcode);
|
||||
|
||||
$('#DivShipment').modal({ backdrop: 'static', keyboard: false });
|
||||
}
|
||||
});
|
||||
}
|
||||
$("#<%= TxtAddress.ClientID%>").val(data.display_name);
|
||||
$("#<%= TxtCity.ClientID%>").val(data.address.city);
|
||||
$("#<%= TxtState.ClientID%>").val(data.address.state);
|
||||
$("#<%= TxtContry.ClientID%>").val(data.address.country);
|
||||
$("#<%= TxtPostalCode.ClientID%>").val(data.address.postcode);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<script
|
||||
|
||||
@@ -1311,31 +1311,32 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Dim TxtCantidad = GvDatos.Rows(Gvr.RowIndex).FCTextBox("TbCantidadF")
|
||||
If Gvr.DataKey("CantidadF").ToDecimal - TxtCantidad.Text.ToDecimal - 1 >= 0 Then
|
||||
|
||||
|
||||
|
||||
''VALIDA EXISTENCIA
|
||||
If TipoMovimiento = 1 Then
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim Existencia = ObjInventario.GetExistenciasPS(Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=If(TipoEntrega = 2, 1, -1))
|
||||
ObjInventario.Dispose()
|
||||
If Not Existencia >= TxtCantidad.Text.ToDecimal + 1 Then
|
||||
TxtCodigoPS.Text = ""
|
||||
Alert($"No hay existencias suficientes del producto: <br/><b>""{Gvr.DataKey("Codigo")}-{Gvr.DataKey("PS")}""</b>. <br/>Solo hay disponibles <b>{Existencia.FormatoNumero}</b> en Almacen. Por favor Verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);")
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
Exit Sub
|
||||
End If
|
||||
Else
|
||||
If DtExistencias IsNot Nothing Then
|
||||
Dim Existencia = DtExistencias.SUM("Cantidad", $"CvePS = {Gvr.DataKey("CvePS")} AND CveUM = {Gvr.DataKey("CveUM").ToString.ToEntero}")
|
||||
If Not Existencia >= TxtCantidad.Text.ToDecimal + 1 Then
|
||||
TxtCodigoPS.Text = ""
|
||||
Alert($"No hay existencias suficientes del producto: <br/><b>""{Gvr.DataKey("Codigo")}-{Gvr.DataKey("PS")}""</b>. <br/>Solo hay disponibles <b>{Existencia.FormatoNumero}</b> en Almacen. Por favor Verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);")
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
If Not TipoDocto.Contiene("Dev") Then
|
||||
If TipoMovimiento = 1 Then
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim Existencia = ObjInventario.GetExistenciasPS(Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=If(TipoEntrega = 2, 1, -1))
|
||||
ObjInventario.Dispose()
|
||||
If Not Existencia >= TxtCantidad.Text.ToDecimal + 1 Then
|
||||
TxtCodigoPS.Text = ""
|
||||
Alert($"No hay existencias suficientes del producto: <br/><b>""{Gvr.DataKey("Codigo")}-{Gvr.DataKey("PS")}""</b>. <br/>Solo hay disponibles <b>{Existencia.FormatoNumero}</b> en Almacen. Por favor Verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);")
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
Exit Sub
|
||||
End If
|
||||
Else
|
||||
If DtExistencias IsNot Nothing Then
|
||||
Dim Existencia = DtExistencias.SUM("Cantidad", $"CvePS = {Gvr.DataKey("CvePS")} AND CveUM = {Gvr.DataKey("CveUM").ToString.ToEntero}")
|
||||
If Not Existencia >= TxtCantidad.Text.ToDecimal + 1 Then
|
||||
TxtCodigoPS.Text = ""
|
||||
Alert($"No hay existencias suficientes del producto: <br/><b>""{Gvr.DataKey("Codigo")}-{Gvr.DataKey("PS")}""</b>. <br/>Solo hay disponibles <b>{Existencia.FormatoNumero}</b> en Almacen. Por favor Verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);")
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Gvr.DataKey("AplicaSerieLote") = "True" Then
|
||||
TdSeriePS.Visible = True
|
||||
TxtSeriePS.Focus()
|
||||
|
||||
6980
Ventas/PV.aspx
6980
Ventas/PV.aspx
File diff suppressed because it is too large
Load Diff
10948
Ventas/PV.aspx.vb
10948
Ventas/PV.aspx.vb
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user