+
-
¿Cual de las siguientes acciones es la que desea realizar?
+ <%--
¿Cual de las siguientes acciones es la que desea realizar?
Cancelar Complemento
Cancelar Pago y Complemento
-
+ --%>
-
-
-
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 78282a279..73a07f5c1 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -408,12 +408,52 @@ Partial Class Bancos_IE
Set(value As Integer)
ViewState("IdCtaAnticipoExtranjera") = value
End Set
- End Property
-
-
-
+ End Property
+
+ Private Property CveEstatusIE As Integer
+ Get
+ If ViewState("CveEstatusIE") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("CveEstatusIE").ToString.ToEntero
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("CveEstatusIE") = value
+ End Set
+
+ End Property
+
+ Private Property CuentaOld As String
+ Get
+ Return CType(ViewState("CuentaOld"), String)
+ End Get
+ Set(value As String)
+ ViewState("CuentaOld") = value
+ End Set
+ End Property
+ Private Property FechaOld As String
+ Get
+ Return CType(ViewState("FechaOld"), String)
+ End Get
+ Set(value As String)
+ ViewState("FechaOld") = value
+ End Set
+ End Property
+
+ Private Property FolioOld As String
+ Get
+ Return CType(ViewState("FolioOld"), String)
+ End Get
+ Set(value As String)
+ ViewState("FolioOld") = value
+ End Set
+ End Property
+
+
+
#Region "CANCELACIÓN COMPLEMENTO MODAL V2"
-
+
Property CveComplementoPagoCancelar As Integer
Get
If ViewState("CveComplementoPagoCancelar") Is Nothing Then
@@ -630,7 +670,7 @@ Partial Class Bancos_IE
End If
'08/05/2018 - Se deshabilita opcion Eliminar IE si tiene un complemento de pago relacionado
- If CveIE = -1 Or (CveIE > 0 AndAlso VerificaComplementos()) Then
+ If CveIE = -1 Or (CveIE > 0 AndAlso VerificaComplementos(False)) Then
LnkEliminar.Visible = False
If CveIE > 0 Then
LnkCancelar.Visible = False
@@ -674,6 +714,17 @@ Partial Class Bancos_IE
LnkAjustarMovimiento.Visible = True
End If
+ If Not VerificaComplementos(True) Then
+
+ LnkCancelarComplemento.Visible = False
+ LnkCancelarComplementoImporte.Visible = False
+
+
+ UppEliminarIE.Update()
+
+
+ End If
+
End If
End Sub
@@ -697,7 +748,7 @@ Partial Class Bancos_IE
CveIEDeposito2 = ObjIE.DtResultados(0)("CveIEDeposito2").ToString.ToEntero
If UsuarioActual.TienePermisoProceso(99) Then
- BtnActualizar.Visible = True
+ 'BtnActualizar.Visible = True
TxtFechaDocumento.Enabled = True
Calendario.Enabled = True
End If
@@ -749,6 +800,7 @@ Partial Class Bancos_IE
'ChkAplicaImpuestos.Checked = ObjIE.AplicaImpuestos
'ChkImpreso.Checked = ObjIE.FueImpreso
ChkConciliado.Checked = ObjIE.FueConciliado
+
DdlEstatusIE.SelectedValue = ObjIE.CveEstatusIE.ToString
DdlEstatusIE.Visible = False
LblEstatusIE.Visible = True
@@ -843,6 +895,8 @@ Partial Class Bancos_IE
LblRegistroFecha.Text = ObjIE.FechaIng.ToShortDateString
LblRegistroUsuario.Text = ObjIE.Usuario
+ CveEstatusIE = ObjIE.CveEstatusIE
+
Select Case ObjIE.CveEstatusIE
Case 1
If Not ObjIE.FueConciliado Then
@@ -942,6 +996,7 @@ Partial Class Bancos_IE
LnkComplementoPago.Visible = True
+
If ObjIE.CveEstatusIE = 1 AndAlso ObjIE.CveIECancelado > 0 Then
'cuando es cheque devuelto
TabCancelacion.Visible = True
@@ -1040,10 +1095,27 @@ Partial Class Bancos_IE
If UsuarioActual.TienePermisoProceso(80) Then GvRH.Columns(5).Visible = True
End If
- Else
+ Else
Alert("El Documento solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
- BtnGuardar.Enabled = False
+ BtnGuardar.Enabled = False
End If
+
+
+ If Not ChkConciliado.Checked Then
+
+ If (Not VerificaComplementos(True)) And UsuarioActual.TienePermisoProceso(99) And ObjIE.CveEstatusIE <> 2 Then
+ BtnEditar.Visible = True
+ End If
+
+ UpGuardar.Update()
+
+ End If
+
+ ' DATOS PARA LA BITACORA
+ CuentaOld = LblCuenta.Text
+ FechaOld = TxtFechaDocumento.Text
+ FolioOld = TxtFolio.Text
+
End If
'If CveIE > 0 Then
@@ -2352,7 +2424,6 @@ Partial Class Bancos_IE
Dim tCveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero
Dim tImporteMonedaExtranjera As Decimal = 0
If tCveMoneda <> 1 Then tImporteMonedaExtranjera = TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal
- If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = TxtFolio.Text.ToEntero 'cheque
Dim PagueseA = ""
If HdnCveCliente.Value.ToEntero > 0 Then
@@ -2372,18 +2443,26 @@ Partial Class Bancos_IE
End If
If MsgError = "" Then
- CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa))
-
- 'valida prepoliza
- If CvePrePoliza > 0 Then
- Dim Conc As String = If(TxtObservaciones.Text = "", TxtFolio.Text, TxtObservaciones.Text)
- Dim Ref As String = If(TxtObservaciones.Text = "", TxtFolio.Text, TxtObservaciones.Text)
- CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PagueseA, TxtImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero,
+
+ CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PagueseA, TxtImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero,
TxtTipoCambio.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, ChkAplicaImpuestos.Checked, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveEstatusIE:=DdlEstatusIE.SelectedValue.ToString.ToEntero, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1))
- If CveIE > 0 Then
+ If CveIE > 0 Then
+
+ If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = ObjIE.Folio.ToEntero 'cheque
+ CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa))
+
+ 'valida prepoliza
+ If CvePrePoliza > 0 Then
+
+ If Not ObjIE.UpdateIEPrePoliza(MinFecha, "", -1, CvePrePoliza, CveIE, -1) Then
+ MsgError = "Ocurrio un error al agregar la prepoliza al IE."
+ End If
+
+ Dim Conc As String = If(TxtObservaciones.Text = "", ObjIE.Folio, TxtObservaciones.Text)
+ Dim Ref As String = If(TxtObservaciones.Text = "", ObjIE.Folio, TxtObservaciones.Text)
If Comprobante <> "" Then
ComprobanteIE = $"{CveIE}.{Comprobante}"
@@ -2462,7 +2541,7 @@ Partial Class Bancos_IE
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
importeMovimiento = 0
Multiplicador = (Row("Multiplicador").ToString.ToEntero)
- Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", TxtFolio.Text)
+ Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio)
Select Case ConceptoContable
@@ -2562,7 +2641,7 @@ Partial Class Bancos_IE
Dim ImporteAplicar = 0.0D
Dim ImporteAplicarMN = 0.0D
Dim ImporteAplicarME = 0.0D
- Dim ReferenciaAplicar = TxtFolio.Text
+ Dim ReferenciaAplicar = ObjIE.Folio
Dim ConceptoAplicar = $"Devolución al cliente {PagueseA} {TxtImporte.Text} NC:{SerieFolioDevDin}"
ImporteAplicar = TxtImporte.Text.ToDecimal
@@ -2643,7 +2722,7 @@ Partial Class Bancos_IE
Dim ImporteAplicar = 0.0D
Dim ImporteAplicarMN = 0.0D
Dim ImporteAplicarME = 0.0D
- Dim ReferenciaAplicar = TxtFolio.Text
+ Dim ReferenciaAplicar = ObjIE.Folio
Dim ConceptoAplicar = $"Devolución de Proveedor {PagueseA} {TxtImporte.Text} NC:{SerieFolioDeCDin}"
@@ -2883,7 +2962,7 @@ Partial Class Bancos_IE
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
importeMovimiento = 0
Multiplicador = (Row("Multiplicador").ToString.ToEntero)
- Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", TxtFolio.Text)
+ Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio)
Select Case ConceptoContable
@@ -3038,11 +3117,11 @@ Partial Class Bancos_IE
If DdlTipoTransaccion.SelectedValue = "1" Then TipoChq = "CHQ"
ConceptoRenglon = String.Format("Anticipo {0}", PagueseA)
- IDPoliza = Conta.AddPoliza(2, ConceptoRenglon, Total, Total, UsuarioActual.CveUsuario, Fecha, TxtFolio.Text, TipoChq)
+ IDPoliza = Conta.AddPoliza(2, ConceptoRenglon, Total, Total, UsuarioActual.CveUsuario, Fecha, ObjIE.Folio, TipoChq)
If IDPoliza > 0 Then
FolioPoliza = Conta.Folio
- Referencia = TxtFolio.Text
+ Referencia = ObjIE.Folio
ConceptoRenglon = String.Format("Anticipo {0} {1}", PagueseA, TxtObservaciones.Text)
Total = TxtImporte.Text.ToDouble
@@ -3075,11 +3154,13 @@ Partial Class Bancos_IE
End If
Else
- MsgError = "No se insertó el encabezado"
+ MsgError = "No se pudo insertar la póliza"
End If
+
Else
- MsgError = "No se pudo insertar la póliza"
+ MsgError = "No se insertó el encabezado"
End If
+
End If
Else
@@ -3436,207 +3517,241 @@ Partial Class Bancos_IE
objIE.Dispose()
Return strBody.ToString
- End Function
-
-
-
-
+ End Function
+
+
+
+
#End Region
-
- ''[IPP] IFs REEMPLAZADOS - MIRAS DE ELIMINAR 2018/08/15
- 'If Not Opcion.Contiene("DEV", "INGPC", "DevDinV") AndAlso MsgError = "" Then
-
- 'Dim TipoMovimiento As Boolean = True
-
- 'If Opcion.Contiene("ANTC") Then
- ' TipoMovimiento = False
- ' End If
-
- ''MOVIMIENTOS EGRESOS
- 'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDouble, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
- 'Dim IVA As Double = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble
- 'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDouble - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then
- 'If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
- ' MsgError = "Detalle"
- ' End If
- ''intereses pagados
- 'If CIF > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, CIF, Ref, 46, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=CIF, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
- ' MsgError = "Detalle"
- ' End If
- 'Else
- ' MsgError = "no se pudo insertar el detalle de la póliza2"
- ' End If
- 'Else
- ' MsgError = "no se pudo insertar el detalle de la póliza"
- ' End If
-
-
- 'If Opcion.Contiene("EGSSINFACT") AndAlso CveSolicitudViatico > 0 AndAlso MsgError = "" Then
- 'If Not ObjIE.UpdateSolicitudesViaticosIE(CveSolicitudViatico, CveIE) Then
- ' MsgError = "Ocurrió un Error al vincular el egreso con la solicitud de viatico."
- ' End If
- 'End If
-
- ''MOVIMIENTOS INGRESOS - DEVOLUCIONES
- 'ElseIf Opcion.Contiene("DEV") AndAlso MsgError = "" Then
- 'Dim CveIEOtro As Integer = If(CveProveedor > 0 Or CvePersonal > 0, DdlIEDevolucion.SelectedValue.ToEntero, CveIE)
-
- 'If CveCliente > 0 AndAlso Not DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDouble = 0 Then
- ''RMF- CASO DONDE HAY UNA DEVOLUCION Y TENGO QUE AFECTAR LAS FACTURAS QUE SE HABIAN MARCADO COMO PAGADAS TENGO QUE REGRESARLAS A PENDIENTES
- 'Dim Mov As New ClsMovimientos
- 'If Mov.GetMovimientosIE(2, DdlIEDevolucion.SelectedValue.ToEntero, -1, Now, Now, 1, 0, UsuarioActual.CveEmpresa) Then
- 'Dim DtIE As DataTable = Mov.DtResultados
- 'For Each dr As DataRow In DtIE.Rows
-
- 'If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, If(dr("TipoMovto").ToString.ToEntero = 1, False, True), If(dr("CveConceptoContable").ToString.ToEntero.Contiene(66), -TxtImporte.Text.ToDouble, dr("Importe").ToString.ToDouble), "", dr("CveConceptoContable").ToString.ToEntero, "", Now, IDCtaBeneficiario, -1, CveIE, CveCliente:=dr("CveCliente").ToString.ToEntero, CveVenta:=dr("CveVenta").ToString.ToEntero, ImporteMX:=If(dr("CveConceptoContable").ToString.ToEntero.Contiene(66), -TxtImporte.Text.ToDouble, -dr("Importe").ToString.ToDouble), ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) Then
- ' MsgError = "no se pudo insertar el detalle de la póliza 2"
- ' End If
- 'Next
- ' ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta)
-
- ' End If
- ' Mov.Dispose()
-
- ' 'Devolucion de INGxC Formato Charlie
- ' ElseIf CveCliente > 0 AndAlso DivIvaIxC.Visible Then
-
- 'Dim Mov As New ClsMovimientos
- ' 'INGxC
- ' ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(TxtImporte.Text.ToDouble - TxtIvaIxC.Text.ToDouble), Ref, 66, Conc, Now, IDCtaContable, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-(TxtImporte.Text.ToDouble - TxtIvaIxC.Text.ToDouble), ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta)
-
- ' If TxtIvaIxC.Text.ToDouble > 0 Then
- ' 'Iva
- ' ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -TxtIvaIxC.Text.ToDouble, Ref, 61, Conc, Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtIvaIxC.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar)
- ' End If
-
- ' 'Bancos
- ' ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -TxtImporte.Text.ToDouble, Ref, 30, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario)
- ' Mov.Dispose()
-
- ' Else
- 'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDouble, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta) Then
- 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE:=If(CveIEOtro < 0, CveIE, CveIEOtro), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) Then
- ' MsgError = "no se pudo insertar el detalle de la póliza 2"
- ' End If
- 'Else
- ' MsgError = "no se pudo insertar el detalle de la póliza"
- ' End If
-
- 'End If
-
- ''Nuevo INGxC Formato Charlie
- 'ElseIf Opcion.Contiene("INGPC") AndAlso MsgError = "" Then
-
- 'Dim ConceptoContable As Integer
- 'Dim TipoMovimiento As Boolean
- 'Dim importeMovimiento As Decimal
- 'Dim FechaMovimiento As Date = Now
- 'Dim Concepto As String = ""
- 'Dim Referencia As String = TxtPagueseA.Text
-
- 'Dim importeMX As Decimal
- 'Dim Multiplicador As Integer
-
- 'If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
- 'For Each Row As DataRow In ObjMov.DtResultados.Rows
-
- ' ConceptoContable = Row("CveConcepto").ToString.ToEntero
- ' TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
- ' importeMovimiento = 0
- ' Multiplicador = (Row("Multiplicador").ToString.ToEntero)
- ' Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, TxtPagueseA.Text, "", TxtFolio.Text)
-
- ' Select Case ConceptoContable
-
- 'Case 10
- 'If RBL.SelectedValue = "P" AndAlso CveProveedor > 0 Then
- ' importeMovimiento = TxtImporte.Text.ToDecimal
- ' importeMX = importeMovimiento
- ' End If
-
- 'Case 28
- 'If RBL.SelectedValue = "FE" AndAlso CvePersonal > 0 Then
- ' importeMovimiento = TxtImporte.Text.ToDecimal
- ' importeMX = importeMovimiento
- ' End If
-
- 'Case 37
- 'If RBL.SelectedValue = "DD" AndAlso CveProveedor > 0 Then
- ' importeMovimiento = TxtImporte.Text.ToDecimal
- ' importeMX = importeMovimiento
- ' End If
-
- 'Case 41
- 'If RBL.SelectedValue = "AC" AndAlso CveProveedor > 0 Then
- ' importeMovimiento = TxtImporte.Text.ToDecimal
- ' importeMX = importeMovimiento
- ' End If
-
- 'Case 50
- 'If RBL.SelectedValue = "DP" AndAlso CveProveedor > 0 Then
- ' importeMovimiento = TxtImporte.Text.ToDecimal
- ' importeMX = importeMovimiento
- ' End If
-
- 'Case 66
- 'If RBL.SelectedValue = "C" AndAlso CveCliente > 0 Then
- ' importeMovimiento = TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal
- ' importeMX = importeMovimiento
-
- ' 'Agregamos el IVA
- ' If DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDecimal <> 0 Then
- 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtIvaIxC.Text.ToDecimal, Concepto, 61, Concepto, FechaMovimiento, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) Then
- ' MsgError = "Ocurrió un Error al registrar el asiento del ingreso."
- ' End If
- 'End If
- 'If tCveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then
- ''Agregamos complementaria
- 'Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal
-
- 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 226, Concepto, FechaMovimiento, IDCtaBeneficiarioComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC, CveCuenta:=0) Then
- ' MsgError = "Ocurrió un Error al registrar el asiento del ingreso."
- ' End If
-
- 'End If
-
- 'End If
-
- 'Case 30
- ' importeMovimiento = TxtImporte.Text.ToDecimal
- ' importeMX = importeMovimiento
-
- ' If tCveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then
- ''Agregamos complementaria
- 'Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal
-
- 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) Then
- ' MsgError = "Ocurrió un Error al registrar el asiento del ingreso."
- ' End If
-
- 'End If
-
- 'End Select
-
- 'If importeMovimiento <> 0 Then
- 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal, CveCuenta:=If(ConceptoContable = 30, CveCuentaConta, CveCuentaBeneficiario)) Then
- ' MsgError = "Ocurrió un Error al registrar el asiento del ingreso."
- ' End If
- 'End If
-
- 'Next
-
- 'End If
- 'End If
-
- Protected Sub BtnActualizar_Click(sender As Object, e As EventArgs) Handles BtnActualizar.Click
+
+ ''[IPP] IFs REEMPLAZADOS - MIRAS DE ELIMINAR 2018/08/15
+ 'If Not Opcion.Contiene("DEV", "INGPC", "DevDinV") AndAlso MsgError = "" Then
+
+ 'Dim TipoMovimiento As Boolean = True
+
+ 'If Opcion.Contiene("ANTC") Then
+ ' TipoMovimiento = False
+ ' End If
+
+ ''MOVIMIENTOS EGRESOS
+ 'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDouble, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
+ 'Dim IVA As Double = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble
+ 'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDouble - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then
+ 'If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
+ ' MsgError = "Detalle"
+ ' End If
+ ''intereses pagados
+ 'If CIF > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, CIF, Ref, 46, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=CIF, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
+ ' MsgError = "Detalle"
+ ' End If
+ 'Else
+ ' MsgError = "no se pudo insertar el detalle de la póliza2"
+ ' End If
+ 'Else
+ ' MsgError = "no se pudo insertar el detalle de la póliza"
+ ' End If
+
+
+ 'If Opcion.Contiene("EGSSINFACT") AndAlso CveSolicitudViatico > 0 AndAlso MsgError = "" Then
+ 'If Not ObjIE.UpdateSolicitudesViaticosIE(CveSolicitudViatico, CveIE) Then
+ ' MsgError = "Ocurrió un Error al vincular el egreso con la solicitud de viatico."
+ ' End If
+ 'End If
+
+ ''MOVIMIENTOS INGRESOS - DEVOLUCIONES
+ 'ElseIf Opcion.Contiene("DEV") AndAlso MsgError = "" Then
+ 'Dim CveIEOtro As Integer = If(CveProveedor > 0 Or CvePersonal > 0, DdlIEDevolucion.SelectedValue.ToEntero, CveIE)
+
+ 'If CveCliente > 0 AndAlso Not DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDouble = 0 Then
+ ''RMF- CASO DONDE HAY UNA DEVOLUCION Y TENGO QUE AFECTAR LAS FACTURAS QUE SE HABIAN MARCADO COMO PAGADAS TENGO QUE REGRESARLAS A PENDIENTES
+ 'Dim Mov As New ClsMovimientos
+ 'If Mov.GetMovimientosIE(2, DdlIEDevolucion.SelectedValue.ToEntero, -1, Now, Now, 1, 0, UsuarioActual.CveEmpresa) Then
+ 'Dim DtIE As DataTable = Mov.DtResultados
+ 'For Each dr As DataRow In DtIE.Rows
+
+ 'If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, If(dr("TipoMovto").ToString.ToEntero = 1, False, True), If(dr("CveConceptoContable").ToString.ToEntero.Contiene(66), -TxtImporte.Text.ToDouble, dr("Importe").ToString.ToDouble), "", dr("CveConceptoContable").ToString.ToEntero, "", Now, IDCtaBeneficiario, -1, CveIE, CveCliente:=dr("CveCliente").ToString.ToEntero, CveVenta:=dr("CveVenta").ToString.ToEntero, ImporteMX:=If(dr("CveConceptoContable").ToString.ToEntero.Contiene(66), -TxtImporte.Text.ToDouble, -dr("Importe").ToString.ToDouble), ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) Then
+ ' MsgError = "no se pudo insertar el detalle de la póliza 2"
+ ' End If
+ 'Next
+ ' ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta)
+
+ ' End If
+ ' Mov.Dispose()
+
+ ' 'Devolucion de INGxC Formato Charlie
+ ' ElseIf CveCliente > 0 AndAlso DivIvaIxC.Visible Then
+
+ 'Dim Mov As New ClsMovimientos
+ ' 'INGxC
+ ' ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(TxtImporte.Text.ToDouble - TxtIvaIxC.Text.ToDouble), Ref, 66, Conc, Now, IDCtaContable, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-(TxtImporte.Text.ToDouble - TxtIvaIxC.Text.ToDouble), ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta)
+
+ ' If TxtIvaIxC.Text.ToDouble > 0 Then
+ ' 'Iva
+ ' ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -TxtIvaIxC.Text.ToDouble, Ref, 61, Conc, Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtIvaIxC.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar)
+ ' End If
+
+ ' 'Bancos
+ ' ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -TxtImporte.Text.ToDouble, Ref, 30, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario)
+ ' Mov.Dispose()
+
+ ' Else
+ 'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDouble, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta) Then
+ 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE:=If(CveIEOtro < 0, CveIE, CveIEOtro), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDouble, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) Then
+ ' MsgError = "no se pudo insertar el detalle de la póliza 2"
+ ' End If
+ 'Else
+ ' MsgError = "no se pudo insertar el detalle de la póliza"
+ ' End If
+
+ 'End If
+
+ ''Nuevo INGxC Formato Charlie
+ 'ElseIf Opcion.Contiene("INGPC") AndAlso MsgError = "" Then
+
+ 'Dim ConceptoContable As Integer
+ 'Dim TipoMovimiento As Boolean
+ 'Dim importeMovimiento As Decimal
+ 'Dim FechaMovimiento As Date = Now
+ 'Dim Concepto As String = ""
+ 'Dim Referencia As String = TxtPagueseA.Text
+
+ 'Dim importeMX As Decimal
+ 'Dim Multiplicador As Integer
+
+ 'If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
+ 'For Each Row As DataRow In ObjMov.DtResultados.Rows
+
+ ' ConceptoContable = Row("CveConcepto").ToString.ToEntero
+ ' TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
+ ' importeMovimiento = 0
+ ' Multiplicador = (Row("Multiplicador").ToString.ToEntero)
+ ' Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, TxtPagueseA.Text, "", TxtFolio.Text)
+
+ ' Select Case ConceptoContable
+
+ 'Case 10
+ 'If RBL.SelectedValue = "P" AndAlso CveProveedor > 0 Then
+ ' importeMovimiento = TxtImporte.Text.ToDecimal
+ ' importeMX = importeMovimiento
+ ' End If
+
+ 'Case 28
+ 'If RBL.SelectedValue = "FE" AndAlso CvePersonal > 0 Then
+ ' importeMovimiento = TxtImporte.Text.ToDecimal
+ ' importeMX = importeMovimiento
+ ' End If
+
+ 'Case 37
+ 'If RBL.SelectedValue = "DD" AndAlso CveProveedor > 0 Then
+ ' importeMovimiento = TxtImporte.Text.ToDecimal
+ ' importeMX = importeMovimiento
+ ' End If
+
+ 'Case 41
+ 'If RBL.SelectedValue = "AC" AndAlso CveProveedor > 0 Then
+ ' importeMovimiento = TxtImporte.Text.ToDecimal
+ ' importeMX = importeMovimiento
+ ' End If
+
+ 'Case 50
+ 'If RBL.SelectedValue = "DP" AndAlso CveProveedor > 0 Then
+ ' importeMovimiento = TxtImporte.Text.ToDecimal
+ ' importeMX = importeMovimiento
+ ' End If
+
+ 'Case 66
+ 'If RBL.SelectedValue = "C" AndAlso CveCliente > 0 Then
+ ' importeMovimiento = TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal
+ ' importeMX = importeMovimiento
+
+ ' 'Agregamos el IVA
+ ' If DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDecimal <> 0 Then
+ 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtIvaIxC.Text.ToDecimal, Concepto, 61, Concepto, FechaMovimiento, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) Then
+ ' MsgError = "Ocurrió un Error al registrar el asiento del ingreso."
+ ' End If
+ 'End If
+ 'If tCveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then
+ ''Agregamos complementaria
+ 'Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal
+
+ 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 226, Concepto, FechaMovimiento, IDCtaBeneficiarioComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC, CveCuenta:=0) Then
+ ' MsgError = "Ocurrió un Error al registrar el asiento del ingreso."
+ ' End If
+
+ 'End If
+
+ 'End If
+
+ 'Case 30
+ ' importeMovimiento = TxtImporte.Text.ToDecimal
+ ' importeMX = importeMovimiento
+
+ ' If tCveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then
+ ''Agregamos complementaria
+ 'Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal
+
+ 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) Then
+ ' MsgError = "Ocurrió un Error al registrar el asiento del ingreso."
+ ' End If
+
+ 'End If
+
+ 'End Select
+
+ 'If importeMovimiento <> 0 Then
+ 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal, CveCuenta:=If(ConceptoContable = 30, CveCuentaConta, CveCuentaBeneficiario)) Then
+ ' MsgError = "Ocurrió un Error al registrar el asiento del ingreso."
+ ' End If
+ 'End If
+
+ 'Next
+
+ 'End If
+ 'End If
+
+ Protected Sub BtnActualizar_Click(sender As Object, e As EventArgs) Handles BtnActualizar.Click
+
Dim IE As New ClsBancos
- Dim FechaAplicado As DateTime? = Nothing
-
- If IE.UpdateBancos_IE(TxtFechaDocumento.Text.ToDate, FechaAplicado, CveIE, TxtFolio.Text) Then
- Alert("La Actualización del documento se realizó correctamente", TipoMensaje.MsgInformacion)
- End If
-
- IE.Dispose()
+ IE.IniciaTransacSQL()
+ Dim ObjGral As New ClsGenerales
+ ObjGral.IniciaTransacSQL()
+ Dim FechaAplicado As DateTime? = Nothing
+ Dim OcurrioError As Boolean = False
+
+ Dim CveCuentaDepositoUpdate As Integer = If(DdlCuentaDeposito.SelectedValue.ToEntero.ToEntero = 0, -1, DdlCuentaDeposito.SelectedValue.ToEntero.ToEntero)
+
+ If IE.UpdateBancos_IE(TxtFechaDocumento.Text.ToDate, FechaAplicado, CveIE, TxtFolio.Text, CveCuentaDeposito:=CveCuentaDepositoUpdate, CveCuenta:=DdlCuenta.SelectedValue.ToEntero,
+ Observaciones:=TxtObservaciones.Text) Then
+ 'Agrega a la Bitacora
+ If CuentaOld <> DdlCuenta.SelectedItem.Text Then
+ If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, CveIE, DdlCuenta.SelectedItem.Text, CuentaOld, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "Cuenta", "Banco", TxtFolio.Text + " / " + Cuenta) Then
+ OcurrioError = True
+ End If
+ End If
+ If FechaOld <> TxtFechaDocumento.Text.Trim Then
+ If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, CveIE, TxtFechaDocumento.Text.Trim, FechaOld, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "Fecha", "Banco", TxtFolio.Text + " / " + Cuenta) Then
+ OcurrioError = True
+ End If
+ End If
+ If FolioOld <> TxtFolio.Text.Trim Then
+ If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, CveIE, TxtFolio.Text.Trim, FolioOld, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "Número", "Banco", TxtFolio.Text + " / " + Cuenta) Then
+ OcurrioError = True
+ End If
+ End If
+ Else
+ OcurrioError = True
+ End If
+
+ If OcurrioError Then
+ IE.RollBack()
+ ObjGral.RollBack()
+ Else
+ IE.Commit()
+ ObjGral.Commit()
+ Alert("La Actualización del documento se realizó correctamente", TipoMensaje.MsgInformacion, $"document.location.href=""IE.aspx?CveIE={CveIE}""")
+ End If
+ IE.Dispose()
+ ObjGral.Dispose()
End Sub
Protected Sub ImgUpdateCuentaDeposito_Click(sender As Object, e As ImageClickEventArgs)
@@ -4514,7 +4629,9 @@ Partial Class Bancos_IE
UpCuentaDeposito.Update()
UpDatos.Update()
End Sub
- Private Sub RecargaCuentasDepositos()
+ Private Sub RecargaCuentasDepositos()
+
+
If CveProveedor > 0 Then
Dim dr As DataRow = GlobalDTTipoTransacciones.FiltroPrimero(String.Format("CveTipoTransaccion = {0}", DdlTipoTransaccion.SelectedValue)) 'Egs o Ing
@@ -4525,6 +4642,12 @@ Partial Class Bancos_IE
CargaCuentasDepositos()
End If
+
+
+ If CveCliente > 0 Then
+ CargaCuentasDepositoClientes()
+ End If
+
End Sub
'Recaga CuentasBancarias de Proveedor
@@ -4705,29 +4828,31 @@ Partial Class Bancos_IE
End If
ObjOI.Dispose()
Return ""
- End Function
+ End Function
#End Region
-
+
#Region " COMPLEMENTOS PAGO "
- Private Sub CargaComplementosPago()
-
+ Private Sub CargaComplementosPago()
+
+
+
+
Dim ObjBancos As New ClsBancos
If UsuarioActual.CveRol = 1 Then
GvComplementoPagos.Columns(7).Visible = True
- End If
-
+ End If
+
+ DVGenerarComplementoModal.Visible = False
If ObjBancos.GetVincularPago(CveProveedor, CveCompra, 2, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, CveIE) Then
- GvComplementoPagos.DataSource = ObjBancos.DtResultados
- If ObjBancos.DtResultados.Rows.Count = 0 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And UsuarioActual.CveRol = 1 Then
- DVGenerarComplementoModal.Visible = True
- Else
- DVGenerarComplementoModal.Visible = False
+ GvComplementoPagos.DataSource = ObjBancos.DtResultados
+
+ If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 0 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And UsuarioActual.CveRol = 1 And CveEstatusIE <> 2 Then
+ DVGenerarComplementoModal.Visible = True
End If
- Else
- DVGenerarComplementoModal.Visible = False
+ Else
GvComplementoPagos.DataSource = Nothing
End If
@@ -4747,8 +4872,8 @@ Partial Class Bancos_IE
Protected Sub GvComplementoPagos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvComplementoPagos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- e.Row.Cells(3).Text = String.Format("
", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
- e.Row.Cells(4).Text = String.Format("
", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
+ e.Row.Cells(3).Text = String.Format("
", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
+ e.Row.Cells(4).Text = String.Format("
", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
If e.Row.DataKey("Estatus").Contiene("1", "3") Then
e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True
@@ -4776,8 +4901,8 @@ Partial Class Bancos_IE
If ObjBanco.GeneraTimbrePago(CveIE, -1, UsuarioActual, -1, FolioFiscalPadre, EsRegeneracion:=True) Then
ObjBanco.Commit()
Str.AppendFormat("Folio:
{0} ", ObjBanco.ComplementoSerieFolio)
- Str.AppendFormat("
XML ", Encripta(String.Format("OP=Pag&EXT=xml&CveIE={0}&SerieFolio={1}", gvr.DataKey("CveIE").ToEntero, ObjBanco.ComplementoSerieFolio.Replace("&", "%26%"))))
- Str.AppendFormat("
PDF ", Encripta(String.Format("OP=Pag&EXT=pdf&CveIE={0}&SerieFolio={1}", gvr.DataKey("CveIE").ToEntero, ObjBanco.ComplementoSerieFolio.Replace("&", "%26%"))))
+ Str.AppendFormat("
XML ", Encripta(String.Format("OP=Pag&EXT=xml&CveIE={0}&SerieFolio={1}", gvr.DataKey("CveIE").ToEntero, ObjBanco.ComplementoSerieFolio.Replace("&", "%26%"))))
+ Str.AppendFormat("
PDF ", Encripta(String.Format("OP=Pag&EXT=pdf&CveIE={0}&SerieFolio={1}", gvr.DataKey("CveIE").ToEntero, ObjBanco.ComplementoSerieFolio.Replace("&", "%26%"))))
'Str.Append($"
{gvr.DataKey("Folio")} {gvr.DataKey("NombreCliente")}
")
PDFReciboDePagos(-1, gvr.DataKey("CveIE").ToEntero, ObjBanco.CveComplementoPago, False)
Alert(Str.ToString, TipoMensaje.MsgInformacion)
@@ -4799,14 +4924,25 @@ Partial Class Bancos_IE
- Private Function VerificaComplementos() As Boolean
+ Private Function VerificaComplementos(Validos As Boolean) As Boolean
Dim ObjBancos As New ClsBancos
Dim Retorno As Boolean = False
- If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) And ObjBancos.DtResultados.Rows.Count > 0 Then
+ Dim Filtro As String = ""
+
+
+ If Validos Then
+ Filtro = " Estatus IN(1,3) "
+ Else
+ Filtro = ""
+ End If
+
+ If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) And ObjBancos.DtResultados.FiltraParametros(Filtro).Rows.Count > 0 Then
Retorno = True
Else
Retorno = False
End If
+
+
ObjBancos.Dispose()
Return Retorno
End Function
@@ -4817,207 +4953,11 @@ Partial Class Bancos_IE
Exit Sub
End If
Confirmacion("¿Seguro que desea Cancelar el documento por Sustitución?", "", String.Format("document.location.href=""/Ventas/ClientesAbonar.aspx?CveIESustitucion={0}&CveCliente={1}&CveMoneda={2}""", CveIE, CveCliente, CveMoneda), "")
- End Sub
-
- Protected Sub LnkCancelarComplementoImporte_Click(sender As Object, e As EventArgs)
-
- If ChkConciliado.Checked Then
- Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgError)
- Exit Sub
- End If
-
- Dim FechaCorteIE As Date = Now
- Dim CveMoneda, CveMonedaFiltro, IDPoliza, IdPolizaNueva, FolioPolizaNueva As Integer
- Dim FolioIECancelado = ""
- Dim ErrorCancelar As Boolean
- Dim ObjBancos As New ClsBancos
- Dim MensajeError As String = ""
-
- ObjBancos.IniciaTransacSQL()
- Dim ObjAC As ClsContPAQi = Nothing
- If UsuarioActual.Empresa.UsaAC Then
- ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
- ObjAC.IniciaTransacSQL()
- End If
-
- If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
- ComplementoSerieFolio = ObjBancos.DtResultados.FiltroPrimeroValor("FolioFiscal")
- End If
-
- ' Dim FechaCancelacion As DateTime = now ' = ("2019/05/31 23:50").ToDateTime
-
- If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, EsCancelacion:=True, CFDIRelacionado:=ComplementoSerieFolio) Then
- If ObjBancos.GetBancosIE(CveIE, UsuarioActual.CveEmpresa) Then
- If ObjBancos.DtResultados.Rows.Count > 0 Then
- 'FechaCorteIE = ObjBancos.FechaDocumento
- CveMoneda = ObjBancos.CveMoneda
- CveMonedaFiltro = CveMoneda
- IDPoliza = ObjBancos.IDPoliza
- FolioIECancelado = ObjBancos.Folio
- End If
- End If
- Else
- ErrorCancelar = True
- MensajeError = "GENERAR TIMBRE PAGO"
- End If
-
- 'CANCELA IE CONTABILIZADO
- If Not ErrorCancelar Then
-
- If (IDPoliza > 0 AndAlso UsuarioActual.Empresa.UsaAC) Then
-
- If ObjAC Is Nothing Then
- ErrorCancelar = True
- End If
-
- If Not ErrorCancelar Then
- Dim dt As DataTable
- If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then
- dt = ObjAC.DtResultados
-
- ' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS)
- If dt.Rows(0)("FechaPol").ToString.ToDate.Month < TxtFechaDocumento.Text.ToDate.Month Or dt.Rows(0)("FechaPol").ToString.ToDate.Year < TxtFechaDocumento.Text.ToDate.Year Then
- IdPolizaNueva = ObjAC.AddPoliza(1, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaDocumento.Text.ToDate)
-
- If IdPolizaNueva > 0 Then
- FolioPolizaNueva = ObjAC.Folio
-
- 'CREA POLIZA NEGATIVA
- For Each dr As DataRow In dt.Rows
- If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaDocumento.Text.ToDate, "") Then
- MensajeError = "Error CREA POLIZA NEGATIVA "
- ErrorCancelar = True : Exit For
- End If
- Next
-
- 'AJUSTA POLIZA
- If Not ErrorCancelar Then
- If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then
- MensajeError = "Error AJUSTA POLIZA "
- ErrorCancelar = True
- End If
- End If
-
- 'CANCELA IE
- If Not ErrorCancelar Then
- If Not ObjBancos.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, TxtFechaDocumento.Text.ToDate) Then
- MensajeError = "CANCELA IE "
- ErrorCancelar = True
- End If
- End If
-
- Else
- MensajeError = "Error IdPoliza 0 "
- ErrorCancelar = True
- End If
-
- Else
-
- 'LIMPIA POLIZA PONIENDO IMPORTE EN CEROS
- For Each dr As DataRow In dt.Rows
- If Not ObjAC.UpdateMovimiento(dr("Id").ToString.ToEntero, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "1", 0, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegNeg").ToString.ToEntero, dr("Fecha").ToString.ToDate) Then
- MensajeError = "Error LIMPIA POLIZA PONIENDO IMPORTE EN CEROS "
- ErrorCancelar = True : Exit For
- End If
- Next
-
- 'AJUSTA POLIZA
- If Not ErrorCancelar Then
- If Not ObjAC.AjustaPoliza(IDPoliza) Then
- MensajeError = "Error AJUSTA POLIZA "
- ErrorCancelar = True
- End If
- End If
-
- 'CANCELA IE
- If Not ErrorCancelar Then
- If Not ObjBancos.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, TxtFechaDocumento.Text.ToDate) Then
- MensajeError = "Error CANCELA IE "
- ErrorCancelar = True
- End If
- End If
-
- End If
-
- End If
- End If
- Else
-
- If FechaCorteIE.LastDayOfMonth > TxtFechaDocumento.Text.ToDate.LastDayOfMonth Then
- 'CANCELA IE MES ANTERIOR
- If Not ObjBancos.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FechaCorteIE) Then
- ErrorCancelar = True
- MensajeError = "Cancelar IE MES ANTERIOR "
- End If
- Else
- 'CANCELA IE MES ACTUAL
- If Not ObjBancos.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, TxtFechaDocumento.Text.ToDate) Then
- ErrorCancelar = True
- MensajeError = "Cancelar IE MES ACTUAL "
- End If
- End If
-
- End If
-
- If Not ErrorCancelar Then
- If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
-
- Dim CveComplementoPago As Integer = -1
-
- If ObjBancos.DtResultados.Rows.Count > 0 Then
- 'OBTENEMOS EL UUID DEL COMPLEMENTO A CANCELAR POR SUSTITUCION
- CFDIRelacionadoSustitucion = ObjBancos.DtResultados.Rows(0)("FolioFiscal").ToString
- CveComplementoPago = ObjBancos.DtResultados(0)("CveComplementoPago").ToString().ToEntero
- End If
-
- 'ACTUALIZA FOLIOS CANCELADOS
- If ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then
- If Not ObjBancos.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then
- ErrorCancelar = True
- MensajeError = "ACTUALIZA FOLIOS CANCELADOS"
- Else
- Dim FolioCancelado = $"{FolioIECancelado}_C_{ObjBancos.DtResultados(0)("Cantidad").ToString().ToEntero + 1}"
-
- If Not ObjBancos.UpdateFolioCancelado(CveIE.ToEntero, Folio:=FolioCancelado) Then
- ErrorCancelar = True
- MensajeError = "UPDATE FOLIOS CANCELADOS"
- End If
- End If
- End If
-
- 'ACTUALIZA ESTATUS DE COMPLEMENTO DE PAGO A CANCELADO = 2
- If Not ErrorCancelar And CveComplementoPago > 0 Then
- If Not ObjBancos.UpdateComplementoPagoCancelado(CveComplementoPago, 2, UsuarioActual.Empresa.CvePAC, UsuarioActual.CveEmpresa, DateTime.Now) Then
- ErrorCancelar = True
- MensajeError = "ACTUALIZA ESTATUS DE COMPLEMENTO DE PAGO A CANCELADO = 2"
- End If
- End If
- End If
- End If
- End If
-
-
- If Not ErrorCancelar Then
- If ObjAC IsNot Nothing Then ObjAC.Commit()
- ObjBancos.Commit()
-
- Dim Msg As New StringBuilder
- Msg.Append("El movimiento bancario quedó cancelado exitosamente.")
-
- If IdPolizaNueva > 0 Then Msg.AppendFormat("
Ver Póliza de cancelación", IdPolizaNueva)
- Alert(Msg.ToString, TipoMensaje.MsgInformacion)
- Else
- If ObjAC IsNot Nothing Then ObjAC.RollBack()
- ObjBancos.RollBack()
- Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
- GuardaLog(MensajeError)
- End If
-
- If ObjAC IsNot Nothing Then ObjAC.Dispose()
- ObjBancos.Dispose()
- End Sub
+ End Sub
+
+
#End Region
-
+
#Region " ACTUALIZAR TIPO CAMBIO PREPOLIZA "
Private Sub InicializaActualizarTC()
If CveIE > 0 And DdlMoneda.SelectedValue.ToEntero = 2 And CvePrePoliza > 0 Then
@@ -5572,6 +5512,10 @@ Partial Class Bancos_IE
Protected Sub LnkCancelarComplemetno_Click(sender As Object, e As EventArgs)
+ If ChkConciliado.Checked Then
+ Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow)
@@ -5618,46 +5562,125 @@ Partial Class Bancos_IE
End Sub
- Protected Sub BtnModalCancelarComplemento_Click(sender As Object, e As EventArgs)
+ Protected Sub BtnModalCancelarComplemento_Click(sender As Object, e As EventArgs)
+
+
+ If ChkConciliado.Checked Then
+ Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ TxtFechaCancelacion.Text = TxtFechaCancelarComplemento.Text
+ CancelarIE(True)
+
+ End Sub
+
+ Protected Sub LnkCancelarComplementoImporte_Click(sender As Object, e As EventArgs)
+
+ If ChkConciliado.Checked Then
+ Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+
+ Dim ObjBancos As New ClsBancos
+ Dim Respuesta As Boolean = False
+ Dim DTComplementos As New DataTable
- If RdlCancelarComplemento.SelectedValue.ToEntero = 1 Then
-
- Dim ObjCancelacion As New Timbrado
- Dim ObjBanco As New ClsBancos
-
- If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
-
- If ObjBanco.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
- CargaComplementosPago()
-
- RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
- Alert("El complemento se cancelo correctamente.")
- End If
-
- Else
- Alert("Se presento un error al cancelar el complemento.")
- End If
-
- ObjBanco.Dispose()
-
- Else
-
- TxtFechaCancelacion.Text = TxtFechaCancelarComplemento.Text
- CancelarIE(True)
+ If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
+ DTComplementos = ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ")
End If
- End Sub
-
- Protected Sub RdlCancelarComplemento_SelectedIndexChanged(sender As Object, e As EventArgs)
-
-
- If RdlCancelarComplemento.SelectedValue.ToEntero = 1 Then
- DivFechaCancelación.Visible = False
- Else
- DivFechaCancelación.Visible = True
- End If
-
- UpModalCancelarComplemetno.Update()
-
- End Sub
+ ObjBancos.Dispose()
+
+ If DTComplementos.Rows.Count = 1 Then
+
+ CveComplementoPagoCancelar = DTComplementos.Rows(0)("CveComplementoPago").ToString.ToEntero
+ FolioFiscalCancelar = DTComplementos.Rows(0)("FolioFiscal").ToString
+ RFCReceptorCancelar = DTComplementos.Rows(0)("RFCReceptor").ToString
+ CvePACCancelacion = DTComplementos.Rows(0)("CvePAC").ToString.ToEntero
+
+ RegistraScript("$('#ModalCancelarComplemetno').modal('show');")
+ DivFechaCancelación.Visible = True
+ UpModalCancelarComplemetno.Update()
+
+ Else
+ If DTComplementos.Rows.Count = 0 Then
+ Alert("No hay complementos vigentes")
+ Else
+ Alert($"Existe mas de un complemento vigente, complementos vigentes: { DTComplementos.Rows.Count }")
+ End If
+ End If
+
+
+ End Sub
+
+
+ Protected Sub BtnEditar_Click(sender As Object, e As EventArgs)
+
+
+ BtnActualizar.Visible = True
+ BtnEditar.Visible = False
+ UpGuardar.Update()
+
+ ControlesEdicion(True)
+
+ End Sub
+
+ Private Sub ControlesEdicion(mostrar As Boolean)
+
+
+ If mostrar Then
+
+ DdlTipoTransaccion.Enabled = True
+ LblCuenta.Visible = False
+ DdlCuenta.Enabled = True
+ DdlCuenta.Visible = True
+ TxtFolio.Enabled = True
+ TxtObservaciones.Enabled = True
+ UpDatos.Update()
+
+ CargaCuentasDepositoClientes()
+
+
+
+
+
+
+
+ End If
+
+ End Sub
+
+ Private Sub CargaCuentasDepositoClientes()
+
+ If DdlTipoTransaccion.SelectedValue = "9" And CveCliente > 0 Then
+
+ trCuentaDeposito.Visible = True
+ DdlCuentaDeposito.Enabled = True
+
+
+ Dim Dep As New ClsGenerales
+ If Dep.GetCuentasDepositos(CveCliente:=CveCliente) Then
+
+ DdlCuentaDeposito.DataSource = Dep.DtResultados
+ If Dep.DtResultados.Rows.Count > 0 Then
+
+ trCuentaDeposito.Visible = True
+ DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1"))
+
+ End If
+
+ End If
+
+ Dep.Dispose()
+ DdlCuentaDeposito.DataBind()
+ UpCuentaDeposito.Update()
+
+
+
+ End If
+
+ End Sub
+
End Class
\ No newline at end of file
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index 86c684edd..85648f022 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -2,7 +2,7 @@
-
+
@@ -88,14 +88,14 @@
Fletes
-
-
-
- Complementos Pago
-
-
+
+
+
+ Complementos Pago
+
+
+
-
Actualizar Tipo Cambio
@@ -292,7 +292,7 @@
@@ -611,7 +611,8 @@
% IVA |
Total |
-
¿No Deducible? |
+ ¿No Deducible? |
+