GlobalDTOCEstatusUsuarios, GlobalDTBancosCuentas, OC anticpos
This commit is contained in:
@@ -289,14 +289,38 @@ Partial Class Bancos_IE
|
||||
ViewState("CveMoneda") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveOCSolicitudAnticipo As Integer
|
||||
Get
|
||||
Return ViewState("CveOCSolicitudAnticipo").ToString.ToEntero
|
||||
|
||||
If ViewState("CveOCSolicitudAnticipo") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return ViewState("CveOCSolicitudAnticipo").ToString.ToEntero
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveOCSolicitudAnticipo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property SaldoOCAnticipo As Decimal
|
||||
Get
|
||||
If ViewState("SaldoOCAnticipo") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return ViewState("SaldoOCAnticipo").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("SaldoOCAnticipo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Private Property EstaContabilizado As Boolean
|
||||
Get
|
||||
Return CBool(ViewState("EstaContabilizado"))
|
||||
@@ -1561,7 +1585,7 @@ Partial Class Bancos_IE
|
||||
Banco.Dispose()
|
||||
TxtFolio.Text = Folio.ToString
|
||||
|
||||
Dim drI As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue))
|
||||
Dim drI As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue))
|
||||
|
||||
If drI IsNot Nothing Then
|
||||
CargaNotas(drI("CveMoneda").ToString.ToEntero)
|
||||
@@ -1574,7 +1598,7 @@ Partial Class Bancos_IE
|
||||
TxtFolio.Text = ""
|
||||
End If
|
||||
|
||||
Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue))
|
||||
Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue))
|
||||
If dr IsNot Nothing Then
|
||||
|
||||
|
||||
@@ -1741,9 +1765,9 @@ Partial Class Bancos_IE
|
||||
Dim dt As DataTable
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(127) = "1" Then
|
||||
dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario)
|
||||
dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
Else
|
||||
dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas
|
||||
dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas
|
||||
End If
|
||||
|
||||
|
||||
@@ -2441,7 +2465,19 @@ Partial Class Bancos_IE
|
||||
EsValido = False
|
||||
End If
|
||||
End If
|
||||
Dep.Dispose()
|
||||
Dep.Dispose()
|
||||
|
||||
|
||||
|
||||
'If CveOCSolicitudAnticipo > 0 Then
|
||||
' If TxtImporte.Text.ToDecimal > SaldoOCAnticipo Then
|
||||
|
||||
' EsValido = False
|
||||
' Alert($"El importe del movimiento es mayor al saldo de la orden de compra importe movmiento {TxtImporte.Text.FormatoNumero } saldo orden de compra: {SaldoOCAnticipo.ToString.FormatoNumero}", TipoMensaje.MsgAdvertencia)
|
||||
|
||||
' End If
|
||||
'End If
|
||||
|
||||
|
||||
Return EsValido
|
||||
End Function
|
||||
@@ -2457,9 +2493,6 @@ Partial Class Bancos_IE
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Dim ObjIE As New ClsBancos()
|
||||
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
|
||||
Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL)
|
||||
@@ -2477,8 +2510,9 @@ Partial Class Bancos_IE
|
||||
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
|
||||
Dim Msg As New StringBuilder
|
||||
|
||||
If CveIE = -1 Then
|
||||
|
||||
If CveIE = -1 Then
|
||||
|
||||
|
||||
Dim CveCuentaDeposito As Integer = 0
|
||||
If DdlCuentaDeposito.Items.Count > 0 Then
|
||||
CveCuentaDeposito = DdlCuentaDeposito.SelectedValue.ToEntero
|
||||
@@ -2654,7 +2688,7 @@ Partial Class Bancos_IE
|
||||
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PagueseA, TxtImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero,
|
||||
TxtTipoCambio.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, ChkAplicaImpuestos.Checked, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
CveCuentaDeposito:=CveCuentaDeposito, CveEstatusIE:=DdlEstatusIE.SelectedValue.ToString.ToEntero, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1),
|
||||
ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1"), CveCorte:=Me.CveCorte)
|
||||
ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1"), CveCorte:=Me.CveCorte, CveOCAnticipo:=CveOCSolicitudAnticipo)
|
||||
|
||||
If CveIE > 0 Then
|
||||
|
||||
@@ -5405,19 +5439,45 @@ Partial Class Bancos_IE
|
||||
Private Sub InicializaSolicitudAnticipoOC()
|
||||
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSSINFACT" Then
|
||||
If Request("CveOC") IsNot Nothing AndAlso Request("CveOC").ToString.ToEntero > 0 Then
|
||||
|
||||
CveOCSolicitudAnticipo = Request("CveOC").ToString.ToEntero
|
||||
TxtImporte.Enabled = False
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
If CveOCSolicitudAnticipo > 0 Then
|
||||
|
||||
|
||||
Dim ObjOC As New ClsOC
|
||||
|
||||
If ObjOC.GetOCAnticipoSaldo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) Then
|
||||
SaldoOCAnticipo = ObjOC.DtResultados(0)("Saldo").ToString.ToDecimal
|
||||
Else
|
||||
SaldoOCAnticipo = 0
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If ObjOC.GetSolicitudAnticipo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Dim DrOC = ObjOC.DtResultados.FiltroPrimero("")
|
||||
If DrOC("TipoTermino").ToString.ToEntero.Contiene(0, 3) AndAlso DrOC("CveIEAnticipo").ToString = "" Then
|
||||
|
||||
If DrOC("TipoTermino").ToString.ToEntero.Contiene(0, 3) Then
|
||||
TxtObservaciones.Text = DrOC("Descripcion").ToString
|
||||
TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero
|
||||
TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero)
|
||||
|
||||
If DrOC("ImporteAnticipo").ToString.ToDecimal > SaldoOCAnticipo Then
|
||||
|
||||
'TxtImporte.Text = SaldoOCAnticipo.ToString().FormatoNumero
|
||||
'TxtImporteLetra.Text = SaldoOCAnticipo.ToString().FormatoNumero.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero)
|
||||
|
||||
Alert($"El importe solcitado es superior al saldo de la compra, importe solicitado: {DrOC("ImporteAnticipo").ToString.FormatoNumero} saldo: {SaldoOCAnticipo.ToString().FormatoNumero }", TipoMensaje.MsgAdvertencia)
|
||||
BtnGuardar.Enabled = False
|
||||
Else
|
||||
TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero
|
||||
TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero)
|
||||
End If
|
||||
|
||||
DdlMoneda.SelectedValue = DrOC("CveMoneda").ToString
|
||||
CveMoneda = DrOC("CveMoneda").ToString.ToEntero
|
||||
CargaCuenta(DrOC("CveMoneda").ToString.ToEntero)
|
||||
@@ -5433,19 +5493,72 @@ Partial Class Bancos_IE
|
||||
End If
|
||||
CveOCSolicitudAnticipo = DrOC("CveOC").ToString.ToEntero
|
||||
Else
|
||||
If DrOC("CveIEAnticipo").ToString <> "" Then
|
||||
Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ya se le ha generado un anticipo.", TipoMensaje.MsgError)
|
||||
End If
|
||||
'If DrOC("CveIEAnticipo").ToString <> "" Then
|
||||
' Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ya se le ha generado un anticipo.", TipoMensaje.MsgError)
|
||||
'End If
|
||||
|
||||
If DrOC("TipoTermino").ToString = "3" Then ' cuando es tipo rechazado
|
||||
|
||||
Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ha sido cancelada.", TipoMensaje.MsgError)
|
||||
CveOCSolicitudAnticipo = -1
|
||||
BtnGuardar.Enabled = False
|
||||
|
||||
End If
|
||||
|
||||
CveOCSolicitudAnticipo = -1
|
||||
BtnGuardar.Enabled = False
|
||||
|
||||
End If
|
||||
Else
|
||||
Alert("Ocurrió un error al actualizar el estatus de anticipo de la OC/REQ. Por favor actualice y vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
|
||||
'If ObjOC.GetSolicitudAnticipo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then
|
||||
' Dim DrOC = ObjOC.DtResultados.FiltroPrimero("")
|
||||
' If DrOC("TipoTermino").ToString.ToEntero.Contiene(0, 3) AndAlso DrOC("CveIEAnticipo").ToString = "" Then
|
||||
' TxtObservaciones.Text = DrOC("Descripcion").ToString
|
||||
|
||||
' If DrOC("ImporteAnticipo").ToString.ToDecimal > SaldoOCAnticipo Then
|
||||
|
||||
' 'TxtImporte.Text = SaldoOCAnticipo.ToString().FormatoNumero
|
||||
' 'TxtImporteLetra.Text = SaldoOCAnticipo.ToString().FormatoNumero.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero)
|
||||
|
||||
' Alert($"El importe solcitado es superior al saldo de la compra, importe solicitado: {DrOC("ImporteAnticipo").ToString.FormatoNumero} saldo: {SaldoOCAnticipo.ToString().FormatoNumero } se cambio", TipoMensaje.MsgAdvertencia)
|
||||
' Else
|
||||
' TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero
|
||||
' TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero)
|
||||
' End If
|
||||
|
||||
' DdlMoneda.SelectedValue = DrOC("CveMoneda").ToString
|
||||
' CveMoneda = DrOC("CveMoneda").ToString.ToEntero
|
||||
' CargaCuenta(DrOC("CveMoneda").ToString.ToEntero)
|
||||
' UpCuentaDeposito.Update()
|
||||
' If DrOC("CveProveedor").ToString.ToEntero > 0 Then
|
||||
' HdnCveProveedor.Value = DrOC("CveProveedor").ToString
|
||||
' RBL.SelectedValue = "P"
|
||||
' RBL_SelectedIndexChanged(RBL, Nothing)
|
||||
' DdlProveedores.SelectedValue = HdnCveProveedor.Value
|
||||
' DdlProveedores_selectedindexchange(DdlProveedores, Nothing)
|
||||
' DdlProveedores.SelectedText = RazonSocial
|
||||
' ' BuscaCargaProveedor()
|
||||
' End If
|
||||
' CveOCSolicitudAnticipo = DrOC("CveOC").ToString.ToEntero
|
||||
' Else
|
||||
' If DrOC("CveIEAnticipo").ToString <> "" Then
|
||||
' Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ya se le ha generado un anticipo.", TipoMensaje.MsgError)
|
||||
' End If
|
||||
' If DrOC("TipoTermino").ToString = "3" Then ' cuando es tipo rechazado
|
||||
' Alert($"La {DrOC("Tipo")} #{DrOC("Folio")} ha sido cancelada.", TipoMensaje.MsgError)
|
||||
' End If
|
||||
|
||||
' CveOCSolicitudAnticipo = -1
|
||||
' BtnGuardar.Enabled = False
|
||||
' End If
|
||||
'Else
|
||||
' Alert("Ocurrió un error al actualizar el estatus de anticipo de la OC/REQ. Por favor actualice y vuelva a intentar.", TipoMensaje.MsgError)
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
ObjOC.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user