-- cambios para BDH, poder dejar un importe para devolución sobre la misma cuenta
This commit is contained in:
@@ -25,6 +25,7 @@ Partial Class Bancos_DepositosCaja
|
||||
txtFechaF.Text = NowADS().ToShortDateString
|
||||
TxtComision.Attributes.Add("onKeyUp", "txtSuma(this);")
|
||||
TxtDescuento.Attributes.Add("onKeyUp", "txtSumaDescuento(this);")
|
||||
TxtCuentaRetorno.Attributes.Add("onKeyUp", "txtSumaCuentaRetorno(this);")
|
||||
TxtIVA.Attributes.Add("onKeyUp", "txtSumaIVA(this);")
|
||||
TxtComisionIntermediario.Attributes.Add("onKeyUp", "txtSumaTntermediario(this);")
|
||||
|
||||
@@ -32,7 +33,8 @@ Partial Class Bancos_DepositosCaja
|
||||
CargaCuentas()
|
||||
ChkFaltante.Attributes.Add("onclick", "CheckFaltante(this);")
|
||||
ChkDescuento.Attributes.Add("onclick", "CheckDescuento(this);")
|
||||
ChkIntermediario.Attributes.Add("onclick", "CheckIntermediario(this);")
|
||||
ChkIntermediario.Attributes.Add("onclick", "CheckIntermediario(this);")
|
||||
ChkCuentaRetorno.Attributes.Add("onclick", "CheckRowCuenta(this);")
|
||||
BtnConsultar.Attributes.Add("onclick", "Consultar(this);")
|
||||
BtnDepositar.Attributes.Add("onclick", "Depositar(this);")
|
||||
|
||||
@@ -41,7 +43,8 @@ Partial Class Bancos_DepositosCaja
|
||||
|
||||
Private Sub CargaCuentas()
|
||||
DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"})
|
||||
DdlCuentaDeposito.DataBind()
|
||||
DdlCuentaDeposito.DataBind()
|
||||
DdlCuentaDeposito.Items.Insert(0, New ListItem("-", "-1"))
|
||||
|
||||
DdlCajaChica.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"})
|
||||
DdlCajaChica.DataBind()
|
||||
@@ -54,6 +57,13 @@ Partial Class Bancos_DepositosCaja
|
||||
divFolio.Visible = True
|
||||
End If
|
||||
|
||||
DdlCajaChicaRetorno.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"})
|
||||
DdlCajaChicaRetorno.DataBind()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
DivRowCuenta.Visible = True
|
||||
End If
|
||||
|
||||
DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
||||
DdlSubProyectos.DataBind()
|
||||
DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
@@ -148,12 +158,19 @@ Partial Class Bancos_DepositosCaja
|
||||
Dim TotalImporte As Decimal = 0
|
||||
Dim TotalImportePrePoliza As Decimal
|
||||
Dim Comision As Decimal = TxtComision.Text.ToDecimal
|
||||
Dim Descuento As Decimal = TxtDescuento.Text.ToDecimal
|
||||
Dim Descuento As Decimal = TxtDescuento.Text.ToDecimal
|
||||
Dim CuentaRetorno As Decimal = TxtCuentaRetorno.Text.ToDecimal
|
||||
Dim IVA As Decimal = TxtIVA.Text.ToDecimal
|
||||
Dim ImporteInter As Decimal = TxtComisionIntermediario.Text.ToDecimal
|
||||
|
||||
Dim MsgError As String = "Ocurrió un error al realizar los depositos"
|
||||
|
||||
If DdlCuentaDeposito.SelectedValue.ToEntero <= 0 Then
|
||||
Alert("No se ha especificado la cuenta a depositar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
For Each Gvr As GridViewRow In GvFacturas.Rows
|
||||
If Gvr.FCCheckBox("ChkFactura").Checked Then TotalImporte += Gvr.DataKey("Importe").ToDecimal
|
||||
Next
|
||||
@@ -183,6 +200,15 @@ Partial Class Bancos_DepositosCaja
|
||||
End If
|
||||
End If
|
||||
|
||||
If CuentaRetorno <> 0 Then
|
||||
TotalImporte = TotalImporte - CuentaRetorno
|
||||
'Descuento = -(Descuento) ' se inverte el valor, va cargada
|
||||
'If DdlSubProyectoDescuento.SelectedValue.ToEntero = -1 Or DdlClasificacionDescuento.SelectedValue.ToEntero = -1 Then
|
||||
' Alert("Debes Seleccionar un Subproyecto y una Clasificación de descuento", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'End If
|
||||
End If
|
||||
|
||||
If TxtComisionIntermediario.Text.ToDecimal <> 0 Then
|
||||
TotalImporte = TotalImporte - TxtComisionIntermediario.Text.ToDecimal - IVA
|
||||
End If
|
||||
@@ -321,6 +347,17 @@ Partial Class Bancos_DepositosCaja
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
If Not OcurrioError AndAlso ChkCuentaRetorno.Checked Then
|
||||
CveTransaccionBanco = 13
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCajaChicaRetorno.SelectedValue.ToEntero, CveTransaccionBanco)
|
||||
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCajaChicaRetorno.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Retorno Depósito Bancario", CuentaRetorno, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, CuentaRetorno, CuentaRetorno * TipoCambio, 30, "", "Retorno", CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEOrigen) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not OcurrioError Then
|
||||
Dim i As Integer = 0
|
||||
For Each Gvr As GridViewRow In GvFacturas.Rows
|
||||
@@ -365,7 +402,7 @@ Partial Class Bancos_DepositosCaja
|
||||
Next
|
||||
Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEOrigen}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
|
||||
|
||||
documentos += String.Format("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/><br/> ", StrEncript, "Depósito Bancario")
|
||||
documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/> ", StrEncript, "Depósito Bancario")
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user