This commit is contained in:
2023-12-07 13:06:54 -07:00
parent c74eef479e
commit 7e6e7940a2

View File

@@ -271,10 +271,18 @@ Partial Class ContabilidadC_RegPrePolizaS
Beneficiario = "-1"
Actualizar = False
IdPoliza = -1
TipoPlantilla = -1
If IfNull(Request("Tipo"), "").ToString = "Ing" Then
TipoPlantilla = 1
LblEncabezado.Text = "Otros Ingresos"
End If
CargaPlantillas(TipoPlantilla)
CargaConceptosContablesE()
CargaModalConceptoCuentas()
CargaConceptos()
CargaSubProyectos()
CargaCuentasBancos()
If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then
DivTipoGasto.Visible = True
@@ -346,20 +354,6 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
TipoPlantilla = -1
If IfNull(Request("Tipo"), "").ToString = "Ing" Then
TipoPlantilla = 1
LblEncabezado.Text = "Otros Ingresos"
End If
'If UsuarioActual.CveRol = 1 Then trNotificar.Visible = True
CargaConceptos()
CargaSubProyectos()
CargaCuentasBancos()
'crea tabla temporal
ArregloMovs = New ArrayList
If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then
@@ -882,7 +876,7 @@ Partial Class ContabilidadC_RegPrePolizaS
e.Row.FCLinkButton("ImgBancos").Visible = True
If e.Row.DataKey("ContadoTipoTransaccion").ToEntero > 0 And e.Row.DataKey("ContadoCuenta").ToEntero > 0 And e.Row.DataKey("ContadoNumeroFolio").ToString.Length > 0 And
e.Row.DataKey("ContadoImporte").ToDecimal > 0 And e.Row.DataKey("ContadoBeneficiario").ToString.Length > 0 Then
e.Row.DataKey("ContadoBeneficiario").ToString.Length > 0 Then
e.Row.FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green"
End If
End If
@@ -905,10 +899,17 @@ Partial Class ContabilidadC_RegPrePolizaS
TotalCargos = TxtTotalCargos.Text.ToDecimal
TotalAbonos = TxtTotalAbonos.Text.ToDecimal
Else
For Each Gvr As GridViewRow In GvMov.Rows
TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal
TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal
Next
If GvPrePoliza.Visible Then
For Each Gvr As GridViewRow In GvPrePoliza.Rows
TotalCargos += Gvr.DataKey("Cargo").ToDecimal
TotalAbonos += Gvr.DataKey("Abono").ToDecimal
Next
Else
For Each Gvr As GridViewRow In GvMov.Rows
TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal
TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal
Next
End If
End If
'validaciones
@@ -974,28 +975,6 @@ Partial Class ContabilidadC_RegPrePolizaS
'inserto las compras que voy a pagarDdlSaldos
For Each gvr As GridViewRow In Gv.Rows
'Registra movimieno bancario
If gvr.DataKey("CveConceptoContable").ToEntero = 30 AndAlso (gvr.DataKey("ContadoImporte").ToDecimal <> 0 OrElse TipoGrid = 1) Then
Dim tFolio As String = gvr.DataKey("ContadoNumeroFolio").ToString
If tFolio.ToEntero = 0 Then tFolio = SiguienteFolioBancos(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero)
Dim tCveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCuenta.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda").ToEntero
CveIE = ObjIE.AddBancos_IE(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text.ToDate, tFolio,
gvr.DataKey("ContadoBeneficiario"), gvr.DataKey("ContadoImporte").ToDecimal, tCveMoneda, 0, gvr.DataKey("ContadoObservaciones"), "",
False, False, 0, CvePrePolizaInsertada, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveIE < 0 Then
MsgError = "No se pudo registrar movimiento bancario"
Exit For
Else
If tFolio <> "0" Or tFolio <> "" Then
FolioIE = tFolio
Else
FolioIE = ObjIE.Folio
End If
End If
End If
ImporteME = 0
TipoCambio = 1
@@ -1035,6 +1014,7 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
End If
If Not gvr.DataKey("CveConceptoContable").Contiene("30", "10", "204") Then ' 30-bancos, 10-anticipos proveedores, 204- blancos complementaria
If gvr.DataKey("CveConceptoContable").ToEntero = 41 Then
CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
@@ -1043,6 +1023,29 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
End If
'Registra movimieno bancario
If gvr.DataKey("CveConceptoContable").ToEntero = 30 Then
Dim tFolio As String = gvr.DataKey("ContadoNumeroFolio").ToString
If tFolio.ToEntero = 0 Then tFolio = SiguienteFolioBancos(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero)
Dim tCveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCuenta.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda").ToEntero
CveIE = ObjIE.AddBancos_IE(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text.ToDate, tFolio,
gvr.DataKey("ContadoBeneficiario"), Importe, tCveMoneda, 0, gvr.DataKey("ContadoObservaciones"), "",
False, False, 0, CvePrePolizaInsertada, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveIE < 0 Then
MsgError = "No se pudo registrar movimiento bancario"
Exit For
Else
If tFolio <> "0" Or tFolio <> "" Then
FolioIE = tFolio
Else
FolioIE = ObjIE.Folio
End If
End If
End If
If Importe <> 0 OrElse TipoGrid = 1 Then 'si es diferente de cero o si viene de grid prepolizas, que registre todo
Dim tCveCuenta As Integer = gvr.DataKey("CveCuenta").ToEntero
Dim tReferencia, tConcepto As String
@@ -1688,8 +1691,8 @@ Partial Class ContabilidadC_RegPrePolizaS
dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue
dr("Concepto") = TxtConceptoE.Text
dr("Referencia") = TxtReferenciaE.Text
dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDecimal) > 0, False, True)
dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDecimal) > 0, TxtCargoE.Text.ToDecimal, TxtAbonoE.Text.ToDecimal)
dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDecimal) <> 0, False, True)
dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDecimal) <> 0, TxtCargoE.Text.ToDecimal, TxtAbonoE.Text.ToDecimal)
dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue
dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text
dr("CveClasificacion") = DdlClasificacionesE.SelectedValue.ToEntero
@@ -1707,7 +1710,7 @@ Partial Class ContabilidadC_RegPrePolizaS
dr("ContadoNumeroFolio") = TxtModalConceptoDocumentoFolio.Text
dr("ContadoBeneficiario") = TxtModalConceptoDocumentoBeneficiario.Text
dr("ContadoObservaciones") = TxtModalConceptoDocumentoObservaciones.Text
dr("ContadoImporte") = TxtModalConceptoDocumentoImporte.Text.ToDecimal
'dr("ContadoImporte") = TxtModalConceptoDocumentoImporte.Text.ToDecimal
If DdlComprasE.Visible = True AndAlso DdlComprasE.SelectedValue.ToEntero > 0 Then dr("FolioFactura") = DdlComprasE.SelectedItem.ToString()
If DdlVentasE.Visible = True AndAlso DdlVentasE.SelectedValue.ToEntero > 0 Then dr("FolioFactura") = DdlVentasE.SelectedItem.ToString()
@@ -1720,7 +1723,7 @@ Partial Class ContabilidadC_RegPrePolizaS
If DdlPorcentajeIVAE.Visible Then dr("PorcentajeImpuesto") = DdlPorcentajeIVAE.SelectedValue.ToDecimal
If TxtCargoE.Text <> "" Then
If TxtCargoE.Text <> "" AndAlso TxtCargoE.Text.ToDecimal <> 0 Then
dr("Cargo") = TxtCargoE.Text.ToDecimal : dr("Abono") = 0
Else
dr("Abono") = TxtAbonoE.Text.ToDecimal : dr("Cargo") = 0