cambio en todecimal y se agregó más texto a referencia

This commit is contained in:
2021-04-15 17:58:22 -07:00
parent 5940680d2f
commit 0ee009a9a0
2 changed files with 24 additions and 24 deletions

View File

@@ -268,7 +268,7 @@
alert("No es posible poner una comision superior a lo seleccionado") alert("No es posible poner una comision superior a lo seleccionado")
} }
if (comision > 0) { if (comision != 0) {
$('#LblSubproyecto').css("display", "block"); $('#LblSubproyecto').css("display", "block");
$('#divSubProyecto').css("display", "block"); $('#divSubProyecto').css("display", "block");
$('#LblClasificacion').css("display", "block"); $('#LblClasificacion').css("display", "block");

View File

@@ -41,7 +41,7 @@ Partial Class Bancos_DepositosCaja
DdlSubProyectoDeposito.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) DdlSubProyectoDeposito.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
DdlSubProyectoDeposito.DataBind() DdlSubProyectoDeposito.DataBind()
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=2)
DdlClasificacion.DataBind() DdlClasificacion.DataBind()
End Sub End Sub
@@ -71,20 +71,21 @@ Partial Class Bancos_DepositosCaja
Dim TotalImporte As Decimal = 0 Dim TotalImporte As Decimal = 0
Dim TotalImportePrePoliza As Decimal Dim TotalImportePrePoliza As Decimal
Dim Comision As Integer = IIf(TxtComision.Text.ToEntero > 0, TxtComision.Text.ToEntero, (TxtComision.Text.ToEntero * -1)).ToString.ToEntero Dim Comision As Decimal = TxtComision.Text.Todecimal
For Each Gvr As GridViewRow In GvFacturas.Rows For Each Gvr As GridViewRow In GvFacturas.Rows
If Gvr.FCCheckBox("ChkFactura").Checked Then TotalImporte += Gvr.DataKey("Importe").ToDecimal If Gvr.FCCheckBox("ChkFactura").Checked Then TotalImporte += Gvr.DataKey("Importe").ToDecimal
Next Next
If TotalImporte = 0 Then If TotalImporte = 0 Then
Alert("Seleccion una factura para realizar el deposito", TipoMensaje.MsgAdvertencia) Alert("Seleccion una factura para realizar el depósito", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
TotalImportePrePoliza = TotalImporte TotalImportePrePoliza = TotalImporte
If Comision > 0 Then If Comision <> 0 Then
TotalImporte = TotalImporte - TxtComision.Text.ToEntero TotalImporte = TotalImporte + Comision
Comision = -(Comision) ' se inverte el valor, va cargada
If DdlSubProyectoDeposito.SelectedValue.ToEntero = -1 Or DdlClasificacion.SelectedValue.ToEntero = -1 Then If DdlSubProyectoDeposito.SelectedValue.ToEntero = -1 Or DdlClasificacion.SelectedValue.ToEntero = -1 Then
Alert("Debes Seleccionar un Subproyecto y una Clasificación", TipoMensaje.MsgAdvertencia) Alert("Debes Seleccionar un Subproyecto y una Clasificación", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
@@ -126,28 +127,28 @@ Partial Class Bancos_DepositosCaja
NuevaCvePrePoliza = ObjContabilidad.AddPrePolizas("Vta", 13, TotalImportePrePoliza, TotalImportePrePoliza, CveMoneda, Fecha, "Depósito Bancario", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) NuevaCvePrePoliza = ObjContabilidad.AddPrePolizas("Vta", 13, TotalImportePrePoliza, TotalImportePrePoliza, CveMoneda, Fecha, "Depósito Bancario", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'Entrada a bancos
'Salida de Caja Chica
FolioIE = ObjBancos.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToEntero, 8) FolioIE = ObjBancos.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToEntero, 8)
If Not FolioIE > 0 Then If Not FolioIE > 0 Then
OcurrioError = True OcurrioError = True
End If End If
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, 8, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, 8, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Comision > 0 Then documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Depósito: {1}</a> &nbsp &nbsp <br/> ", CveIEOrigen, FolioIE)
CveSubProyecto = DdlSubProyectoDeposito.SelectedValue.ToEntero
CveClasificacion = DdlClasificacion.SelectedValue.ToEntero
If ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveIE:=CveIEOrigen, ImporteMX:=TotalImporte * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then If ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveIE:=CveIEOrigen, ImporteMX:=TotalImporte * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TxtComision.Text.ToEntero, "Comisión", 51, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, ImporteMX:=TxtComision.Text.ToEntero * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
If Comision <> 0 Then
CveSubProyecto = DdlSubProyectoDeposito.SelectedValue.ToEntero
CveClasificacion = DdlClasificacion.SelectedValue.ToEntero
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Comision, "Comisión", 51, "Depósito Bancario ", Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, ImporteMX:=Comision * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
OcurrioError = True OcurrioError = True
End If End If
Else OcurrioError = True
End If End If
Else Else
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveIE:=CveIEOrigen, ImporteMX:=TotalImporte * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then OcurrioError = True
OcurrioError = True
End If
End If End If
For Each Gvr As GridViewRow In GvFacturas.Rows For Each Gvr As GridViewRow In GvFacturas.Rows
@@ -156,7 +157,7 @@ Partial Class Bancos_DepositosCaja
'Datos de las Nuevas PrePolizas 'Datos de las Nuevas PrePolizas
'Entrada a Bancos 'Entrada a Bancos
Dim Importe As Double = Gvr.DataKey("Importe").ToDouble Dim Importe As Decimal = Gvr.DataKey("Importe").ToDecimal
Dim SerieFolio As String = Gvr.DataKey("SerieFolio").ToString Dim SerieFolio As String = Gvr.DataKey("SerieFolio").ToString
'Datos de las Prepolizas A Cancelar 'Datos de las Prepolizas A Cancelar
@@ -168,10 +169,10 @@ Partial Class Bancos_DepositosCaja
If Not FolioIE > 0 Then If Not FolioIE > 0 Then
OcurrioError = True OcurrioError = True
End If End If
CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, "Depósito Bancario", Importe, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe.ToDecimal, SerieFolio, 30, "Depósito Bancario", Fecha, IdCuentaBancariaDestino, -1, CveIE:=CveIEDestino, ImporteMX:=Importe.ToDecimal * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
OcurrioError = True OcurrioError = True
End If End If
@@ -180,21 +181,20 @@ Partial Class Bancos_DepositosCaja
OcurrioError = True OcurrioError = True
End If End If
Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}") Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
'documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Documento {1}</a> &nbsp &nbsp ", CveIEDestino.ToString, SerieFolio)
'documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/><br/> ", StrEncript, SerieFolio) 'documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/><br/> ", StrEncript, SerieFolio)
End If End If
Next Next
If OcurrioError Then If OcurrioError Then
ObjContabilidad.RollBack() ObjContabilidad.RollBack()
Alert("Ocurrio un error al realizar los depositos", TipoMensaje.MsgError) Alert("Ocurrio un error al realizar los depositos", TipoMensaje.MsgError)
Else Else
ObjContabilidad.Commit() ObjContabilidad.Commit()
CargaDatos() CargaDatos()
documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Prepóliza</a> <br/><br/> ", NuevaCvePrePoliza) documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Prepóliza</a> <br/><br/> ", NuevaCvePrePoliza)
Alert(documentos.ToString) Alert(documentos.ToString)