-- mejoras, para considerar las devoluciones de caja
This commit is contained in:
@@ -50,7 +50,8 @@ Partial Class Bancos_DepositosCaja
|
||||
DdlTipoPago.Items.Remove(DdlTipoPago.Items.FindByValue("-1"))
|
||||
End If
|
||||
|
||||
DivDescuentocheck.Visible = False
|
||||
divdescuento2.Visible = False
|
||||
divdescuento3.Visible = False
|
||||
DivIntercheck.Visible = False
|
||||
End If
|
||||
|
||||
@@ -93,7 +94,12 @@ Partial Class Bancos_DepositosCaja
|
||||
DdlSubProyectoDescuento.DataBind()
|
||||
DdlSubProyectoDescuento.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=2)
|
||||
Dim dtclasif As DataTable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=2)
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
dtclasif = dtclasif.FiltraParametros("AplicaDepositoCaja = 1")
|
||||
End If
|
||||
|
||||
DdlClasificacion.DataSource = dtclasif
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
@@ -154,10 +160,12 @@ Partial Class Bancos_DepositosCaja
|
||||
ChkFaltante.Checked = False
|
||||
ChkDescuento.Checked = False
|
||||
ChkIntermediario.Checked = False
|
||||
ChkCuentaRetorno.Checked = False
|
||||
TxtComision.Text = ""
|
||||
TxtDescuento.Text = ""
|
||||
TxtIVA.Text = ""
|
||||
TxtComisionIntermediario.Text = ""
|
||||
TxtCuentaRetorno.Text = ""
|
||||
'lblValorTotal.Text = "0.0"
|
||||
lblValorTotalSeleccionado.Text = "0.0"
|
||||
divLabelTotal.Visible = True
|
||||
@@ -172,7 +180,6 @@ Partial Class Bancos_DepositosCaja
|
||||
|
||||
Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click
|
||||
|
||||
|
||||
If Not Validaciones() Then
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -185,7 +192,7 @@ Partial Class Bancos_DepositosCaja
|
||||
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"
|
||||
Dim MsgError As String = ""
|
||||
|
||||
If DdlCuentaDeposito.SelectedValue.ToEntero <= 0 Then
|
||||
Alert("No se ha especificado la cuenta a depositar.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -216,10 +223,10 @@ Partial Class Bancos_DepositosCaja
|
||||
If Descuento <> 0 Then
|
||||
TotalImporte = TotalImporte - Descuento
|
||||
'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
|
||||
'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 CuentaRetorno <> 0 Then
|
||||
@@ -365,17 +372,22 @@ Partial Class Bancos_DepositosCaja
|
||||
CveSubProyectoComision = DdlSubProyectoDeposito.SelectedValue.ToEntero
|
||||
CveClasificacionComision = DdlClasificacion.SelectedValue.ToEntero
|
||||
If Comision <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Comision, Comision * TipoCambio, 78, $"Depósito Bancario - FALTANTE/SOBRANTE - {tSubProyectoDeposito}", $"Depósito Bancario - {tSubProyectoDeposito}", CveClasificacion:=CveClasificacionComision, CveSubProyecto:=CveSubProyectoComision) Then
|
||||
Dim tCveConcepto As Integer = 78
|
||||
Dim tTipoMovto As Boolean = True
|
||||
If Comision < 0 Then
|
||||
tCveConcepto = 51 : Comision = -Comision : tTipoMovto = False
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, tTipoMovto, Comision, Comision * TipoCambio, tCveConcepto, $"Depósito Bancario - FALTANTE/SOBRANTE - {tSubProyectoDeposito}", $"Depósito Bancario - {tSubProyectoDeposito}", CveClasificacion:=CveClasificacionComision, CveSubProyecto:=CveSubProyectoComision) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not OcurrioError AndAlso ChkDescuento.Checked Then
|
||||
CveSubProyectoDescuento = DdlSubProyectoDescuento.SelectedValue.ToEntero
|
||||
CveSubProyectoDescuento = CveSubProyecto 'DdlSubProyectoDescuento.SelectedValue.ToEntero
|
||||
CveClasificacionDescuento = DdlClasificacionDescuento.SelectedValue.ToEntero
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Descuento, Descuento * TipoCambio, 51, DdlClasificacionDescuento.SelectedItem.Text, DdlClasificacionDescuento.SelectedItem.Text & " " & DdlPersonal.SelectedItem.Text, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyectoDescuento, CvePersonal:=DdlPersonal.SelectedValue.ToEntero) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Descuento, Descuento * TipoCambio, 257, "", DdlPersonal.SelectedItem.Text, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyectoDescuento, CvePersonal:=DdlPersonal.SelectedValue.ToEntero, CveIE:=CveIEOrigen) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
@@ -384,11 +396,7 @@ Partial Class Bancos_DepositosCaja
|
||||
End If
|
||||
|
||||
If Not OcurrioError AndAlso ChkCuentaRetorno.Checked Then
|
||||
CveTransaccionBanco = 13
|
||||
FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, CveTransaccionBanco)
|
||||
Dim CveIEOrigenRetorno As Integer = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, $"Retorno Depósito Bancario - {tSubProyectoDeposito}", CuentaRetorno, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, True, CuentaRetorno, CuentaRetorno * TipoCambio, 30, $"Depósito Bancario - CAJA - {tSubProyectoDeposito}", TxtCuentaRetornoObs.Text.Trim, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEOrigenRetorno) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, True, CuentaRetorno, CuentaRetorno * TipoCambio, 325, $"Depósito Bancario - CAJA - {tSubProyectoDeposito}", TxtCuentaRetornoObs.Text.Trim, CveSubProyecto:=CveSubProyecto) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
@@ -415,6 +423,7 @@ Partial Class Bancos_DepositosCaja
|
||||
Dim CveVenta As Integer = Gvr.DataKey("CveVenta").ToEntero
|
||||
Dim CveCuentaBancaria As Integer = Gvr.DataKey("CveCuenta").ToEntero
|
||||
Dim tCveSubProyecto As Integer = Gvr.DataKey("CveSubProyecto").ToEntero
|
||||
If tCveSubProyecto <= 0 Then tCveSubProyecto = CveSubProyecto 'sino llega a tenerlo por caso de devolución, que tome el general
|
||||
|
||||
FolioIE = ObjBancos.GetNextFolio(CveCuentaBancaria, 2)
|
||||
If Not FolioIE > 0 Then
|
||||
|
||||
Reference in New Issue
Block a user