diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb
index 9eb7eea46..ddd4f4960 100644
--- a/Bancos/DepositosCaja.aspx.vb
+++ b/Bancos/DepositosCaja.aspx.vb
@@ -157,6 +157,7 @@ Partial Class Bancos_DepositosCaja
Dim imprimirFolios As String = ""
Dim CveSubProyectoIntermediario As Integer = -1
Dim CveClasificacionIntermediario As Integer = -1
+ Dim CveProveedorIntermediario As Integer = -1
If drOrigen IsNot Nothing Then
CveMoneda = drOrigen("CveMoneda").ToString.ToEntero
@@ -170,7 +171,7 @@ Partial Class Bancos_DepositosCaja
CveCuentaBancariaDestino = drDestino("IdCtaContableSIG").ToString.ToEntero
End If
- 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, CveTipoPoliza:=1)
If ChkIntermediario.Checked Then
@@ -229,90 +230,75 @@ Partial Class Bancos_DepositosCaja
CveSubProyectoDescuento = DdlSubProyectoDescuento.SelectedValue.ToEntero
CveClasificacionDescuento = DdlClasificacionDescuento.SelectedValue.ToEntero
- If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Descuento, DdlClasificacionDescuento.SelectedItem.Text, 51, DdlClasificacionDescuento.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, ImporteMX:=Comision * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
+ If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Descuento, DdlClasificacionDescuento.SelectedItem.Text, 51, DdlClasificacionDescuento.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, ImporteMX:=Comision * TipoCambio) Then
OcurrioError = True
End If
End If
- If 1 = 1 Then
- CveSubProyectoIntermediario = DdlSubProyectoIntermediario.SelectedValue.ToEntero
- CveSubProyectoIntermediario = DdlClasificacionIntermediario.SelectedValue.ToEntero
- If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Descuento, DdlClasificacionDescuento.SelectedItem.Text, 51, DdlClasificacionDescuento.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, ImporteMX:=Comision * TipoCambio) Then
- OcurrioError = True
- End If
+ Else
+ OcurrioError = True
+ End If
- If IVA <> 0 Then
- If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, IVA, DdlClasificacionIntermediario.SelectedItem.Text, 14, DdlClasificacion.SelectedItem.Text, Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacionIntermediario, CveSubProyecto:=CveSubProyectoIntermediario, ImporteMX:=IVA, CveCuenta:=CveCuentaBancariaOrigen, PorcentajeImpuesto:=0.16D) Then
- OcurrioError = True
- End If
- End If
+ For Each Gvr As GridViewRow In GvFacturas.Rows
+ If Gvr.FCCheckBox("ChkFactura").Checked Then
+ 'Datos de las Nuevas PrePolizas
+ 'Entrada a Bancos
+
+ Dim Importe As Decimal = Gvr.DataKey("Importe").ToDecimal
+ Dim SerieFolio As String = Gvr.DataKey("SerieFolio").ToString
+
+ 'Datos de las Prepolizas A Cancelar
+ Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero
+ Dim CveVenta As Integer = Gvr.DataKey("CveVenta").ToEntero
+ Dim CvePrePoliza As Integer = Gvr.DataKey("CvePrePoliza").ToEntero
+
+ FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, 2)
+ If Not FolioIE > 0 Then
+ OcurrioError = True
+ Exit For
+ End If
+ 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, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
+ OcurrioError = True
+ Exit For
End If
- Else
- OcurrioError = True
- End If
-
- For Each Gvr As GridViewRow In GvFacturas.Rows
-
- If Gvr.FCCheckBox("ChkFactura").Checked Then
- 'Datos de las Nuevas PrePolizas
- 'Entrada a Bancos
-
- Dim Importe As Decimal = Gvr.DataKey("Importe").ToDecimal
- Dim SerieFolio As String = Gvr.DataKey("SerieFolio").ToString
-
- 'Datos de las Prepolizas A Cancelar
- Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero
- Dim CveVenta As Integer = Gvr.DataKey("CveVenta").ToEntero
- Dim CvePrePoliza As Integer = Gvr.DataKey("CvePrePoliza").ToEntero
-
- FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, 2)
- If Not FolioIE > 0 Then
- OcurrioError = True
- Exit For
- End If
- 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, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
- OcurrioError = True
- Exit For
- End If
-
- 'Asignamos la cuenta Deposito
- If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEDestino, CveIE) Then
- OcurrioError = True
- Exit For
- End If
- Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
-
- 'documentos += String.Format("Imprimir {1}
", StrEncript, SerieFolio)
+ 'Asignamos la cuenta Deposito
+ If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEDestino, CveIE) Then
+ OcurrioError = True
+ Exit For
End If
+ Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
- Next
-
-
- If OcurrioError Then
- ObjContabilidad.RollBack()
- Alert("Ocurrio un error al realizar los depositos", TipoMensaje.MsgError)
- Else
- ObjContabilidad.Commit()
- CargaDatos()
-
- documentos += String.Format("Prepóliza