frmValidarIngreso.vb 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. Imports System.ComponentModel
  2. Public Class frmValidarIngreso
  3. Private _CodigoInversion As String = String.Empty
  4. Private _IngresoID As Integer = 0
  5. Private _NombreManIF As String
  6. Private _CodManIF As String
  7. Private _CodEmpr As String
  8. Private _FechaVencimiento As Date
  9. Private _Correlativo As Integer
  10. Private _CodIF As String
  11. Private _Capital As Double
  12. Private _IngresoBruto As Double
  13. Private _ISR As Double
  14. Private _IngresoNeto As Double
  15. Private _IngresoLiquidoProgramado As Double
  16. Private vBD_SAP As String
  17. Private vTransId As String
  18. Private vEstadoDelIngreso As String
  19. Private _CapitalRecibido As Double = 0
  20. Private _IngresoBrutoRecibido As Double = 0
  21. Private _ISRRecibido As Double = 0
  22. Private _IngresoNetoRecibido As Double = 0
  23. Private _IngresoLiquidoRecibido As Double = 0
  24. 'VARIACIONES EN LOS INGRESOS RECIBIDOS
  25. Private _CapitalRecibidoDif As Double = 0
  26. Private _IngresoBrutoRecibidoDif As Double = 0
  27. Private _ISRRecibidoDif As Double = 0
  28. Private _IngresoNetoRecibidoDif As Double = 0
  29. Private _IngresoLiquidoRecibidoDif As Double = 0
  30. Private _CodBanco As String = String.Empty
  31. Private _FormaDePago As String = String.Empty
  32. Private _CuentaBancaria As String = String.Empty
  33. Private CargandoBancos As Boolean
  34. Private Transaccion As String
  35. Public WriteOnly Property CodigoInversion As String
  36. Set(value As String)
  37. _CodigoInversion = value
  38. End Set
  39. End Property
  40. Public WriteOnly Property IngresoID As String
  41. Set(value As String)
  42. _IngresoID = value
  43. End Set
  44. End Property
  45. Private Sub frmIngresosDetalle_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  46. 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet1.BAN0' Puede moverla o quitarla según sea necesario.
  47. Me.BAN0TableAdapter.Fill(Me.InversionesDataSet1.BAN0)
  48. 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet1.FPAG' Puede moverla o quitarla según sea necesario.
  49. Me.FPAGTableAdapter.Fill(Me.InversionesDataSet1.FPAG)
  50. cbxFormaDePago.SelectedIndex = -1
  51. cbxBanco.SelectedIndex = -1
  52. If _CodigoInversion.ToString.Length > 0 Then
  53. CargarIngresoDetalle()
  54. Else
  55. PrepararNuevo()
  56. End If
  57. End Sub
  58. Private Sub CargarCuentasBancarias()
  59. If Not (_CodEmpr Is Nothing Or _CodBanco Is Nothing) Then
  60. CargandoBancos = True
  61. Me.cbxCuentaBanco.DataSource = BancosDAO.CuentasBancarias(_CodEmpr, _CodBanco)
  62. Me.cbxCuentaBanco.DisplayMember = "NumCuenta"
  63. Me.cbxCuentaBanco.ValueMember = "NumCuenta"
  64. Me.cbxCuentaBanco.SelectedIndex = -1
  65. CargandoBancos = False
  66. End If
  67. End Sub
  68. Private Sub PrepararNuevo()
  69. Dim oIngresoDetalleCE As New IngresoDetalleCE
  70. Me.Transaccion = "N"
  71. End Sub
  72. Private Sub CargarIngresoDetalle()
  73. Dim oIngresoDetalleCE As New IngresoDetalleCE
  74. oIngresoDetalleCE = IngresosDAO.DetalleDeIngreso(_CodigoInversion, _IngresoID)
  75. _CodIF = oIngresoDetalleCE.CodigoInstrumentoFinanciero
  76. _NombreManIF = oIngresoDetalleCE.NombreManualIF
  77. _CodManIF = oIngresoDetalleCE.CodigoManualIF
  78. _CodEmpr = oIngresoDetalleCE.CodigoEmpresa
  79. _FechaVencimiento = oIngresoDetalleCE.FechaVencimiento
  80. _Correlativo = oIngresoDetalleCE.IngresoId
  81. _Capital = oIngresoDetalleCE.MontoCapitalProyectado
  82. _IngresoBruto = oIngresoDetalleCE.MontoIngresoBrutoProyectado
  83. _ISR = oIngresoDetalleCE.MontoISRProyectado
  84. _IngresoNeto = oIngresoDetalleCE.MontoIngresoNetoProyectado
  85. vBD_SAP = oIngresoDetalleCE.SAP_BD
  86. vEstadoDelIngreso = oIngresoDetalleCE.EstadoDelIngreso
  87. _IngresoLiquidoProgramado = _IngresoNeto
  88. Me.txtNombreManIF.Text = _NombreManIF
  89. Me.txtCodManIF.Text = _CodManIF
  90. Me.txtEmpresa.Text = _CodEmpr
  91. Me.dtpFechaVencimiento.Value = _FechaVencimiento
  92. Me.txtIngresoID.Text = _Correlativo.ToString
  93. Me.txtCodInversion.Text = _CodigoInversion
  94. Me.txtCapitalProgramado.Text = _Capital.ToString(Configuraciones.CodigoTXTMontos)
  95. Me.txtIngresoBrutoProgramado.Text = _IngresoBruto.ToString(Configuraciones.CodigoTXTMontos)
  96. Me.txtISRProgramado.Text = _ISR.ToString(Configuraciones.CodigoTXTMontos)
  97. Me.txtIngresoNetoProgramado.Text = _IngresoNeto.ToString(Configuraciones.CodigoTXTMontos)
  98. Me.txtIngresoLiquidoProgramado.Text = _IngresoLiquidoProgramado.ToString(Configuraciones.CodigoTXTMontos)
  99. If vEstadoDelIngreso = "R" Then
  100. CargarIngresoRecibido()
  101. Me.cbxFormaDePago.Enabled = False
  102. Me.cbxBanco.Enabled = False
  103. Me.cbxCuentaBanco.Enabled = False
  104. Me.dtpFechaIngreso.Enabled = False
  105. Me.btnRegistrarIngreso.Enabled = False
  106. Me.txtCapitalRecibido.ReadOnly = True
  107. Me.txtIngresoBrutoRecibido.ReadOnly = True
  108. Me.txtISRRecibido.ReadOnly = True
  109. Me.txtIngresoNetoRecibido.ReadOnly = True
  110. Me.txtIngresoLiquidoRecibido.ReadOnly = True
  111. Me.txtComentarios.ReadOnly = True
  112. Me.lblCopiarCapital.Enabled = False
  113. Me.lblCopiarIngresoBruto.Enabled = False
  114. Me.lblCopiarISR.Enabled = False
  115. Me.lblCopiarIngresoNeto.Enabled = False
  116. Me.lblCopiarLiquido.Enabled = False
  117. End If
  118. If vEstadoDelIngreso = "P" Then
  119. Me.btnConciliarIngreso.Enabled = False
  120. End If
  121. End Sub
  122. Private Sub CargarIngresoRecibido()
  123. Dim oRegistroIngresoCE As RegistroIngresoCE
  124. Dim vValidado As String
  125. Dim vConciliado As String
  126. oRegistroIngresoCE = IngresosDAO.DetalleIngresoRecibido(_CodigoInversion, _Correlativo)
  127. If Not oRegistroIngresoCE Is Nothing Then
  128. Me.cbxFormaDePago.SelectedValue = oRegistroIngresoCE.FormaDePago
  129. Me.cbxBanco.SelectedValue = oRegistroIngresoCE.CodigoBanco
  130. Me.cbxCuentaBanco.SelectedValue = oRegistroIngresoCE.CuentaBancaria
  131. Me.dtpFechaIngreso.Value = oRegistroIngresoCE.FechaDelIngreso
  132. Me.txtCapitalRecibido.Text = oRegistroIngresoCE.MontoCapital.ToString(Configuraciones.CodigoTXTMontos)
  133. Me.txtIngresoBrutoRecibido.Text = oRegistroIngresoCE.MontoIngresoBruto.ToString(Configuraciones.CodigoTXTMontos)
  134. Me.txtISRRecibido.Text = oRegistroIngresoCE.MontoISR.ToString(Configuraciones.CodigoTXTMontos)
  135. Me.txtIngresoNetoRecibido.Text = oRegistroIngresoCE.MontoIngresoNeto.ToString(Configuraciones.CodigoTXTMontos)
  136. Me.txtIngresoLiquidoRecibido.Text = oRegistroIngresoCE.MontoIngresoLiquido.ToString(Configuraciones.CodigoTXTMontos)
  137. vValidado = oRegistroIngresoCE.Validado
  138. vConciliado = oRegistroIngresoCE.Conciliado
  139. If vValidado = "S" Then Me.btnValidarIngreso.Enabled = False
  140. If vConciliado = "S" Then Me.btnConciliarIngreso.Enabled = False
  141. End If
  142. End Sub
  143. Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
  144. Me.Close()
  145. End Sub
  146. Private Sub btnValidar_Click(sender As Object, e As EventArgs)
  147. End Sub
  148. 'PARTIDA DE INGRESOS EN SAP
  149. Private Sub CrearPartidaIngresos()
  150. Dim vResultado As Integer
  151. Dim oPartidaIngresos As New InvSAP.PartidaIngresoRecibido
  152. oPartidaIngresos.CodigoInversion = _CodigoInversion
  153. oPartidaIngresos.IngresoID = _IngresoID
  154. oPartidaIngresos.TransId = vTransId
  155. oPartidaIngresos.IngresoBruto = _IngresoBruto
  156. oPartidaIngresos.ISR = _ISR
  157. oPartidaIngresos.IngresoNeto = _IngresoNeto
  158. oPartidaIngresos.BDSAP = vBD_SAP
  159. vResultado = oPartidaIngresos.Crear()
  160. If vResultado = 0 Then
  161. MsgBox("Partida de Ingresos Creada")
  162. Else
  163. MsgBox("Error al generar Partida de Ingresos", MsgBoxStyle.Critical)
  164. End If
  165. End Sub
  166. 'CAPITAL
  167. Private Sub txtCapitalRecibido_Validating(sender As Object, e As CancelEventArgs) Handles txtCapitalRecibido.Validating
  168. Dim errMsg As String = String.Empty
  169. If Not ValidaMonto(txtCapitalRecibido.Text, errMsg) Then
  170. e.Cancel = True
  171. txtCapitalRecibido.SelectAll()
  172. Me.ErrorProvider1.SetError(txtCapitalRecibido, errMsg)
  173. Else
  174. If txtCapitalRecibido.Text.Length > 0 Then
  175. _CapitalRecibido = txtCapitalRecibido.Text
  176. txtCapitalRecibido.Text = _CapitalRecibido.ToString(Configuraciones.CodigoTXTMontos)
  177. ControlCapitalDif()
  178. Else
  179. _CapitalRecibido = 0
  180. End If
  181. End If
  182. End Sub
  183. Private Sub txtCapitalRecibido_Validated(sender As Object, e As EventArgs) Handles txtCapitalRecibido.Validated
  184. Me.ErrorProvider1.SetError(txtCapitalRecibido, "")
  185. End Sub
  186. Private Sub txtCapitalRecibido_MouseDown(sender As Object, e As MouseEventArgs) Handles txtCapitalRecibido.MouseDown
  187. txtCapitalRecibido.SelectAll()
  188. End Sub
  189. 'INGRESO BRUTO
  190. Private Sub txtIngresoBrutoRecibido_Validating(sender As Object, e As CancelEventArgs) Handles txtIngresoBrutoRecibido.Validating
  191. Dim errMsg As String = String.Empty
  192. If Not ValidaMonto(txtIngresoBrutoRecibido.Text, errMsg) Then
  193. e.Cancel = True
  194. txtIngresoBrutoRecibido.SelectAll()
  195. Me.ErrorProvider1.SetError(txtIngresoBrutoRecibido, errMsg)
  196. Else
  197. If txtIngresoBrutoRecibido.Text.Length > 0 Then
  198. _IngresoBrutoRecibido = txtIngresoBrutoRecibido.Text
  199. txtIngresoBrutoRecibido.Text = _IngresoBrutoRecibido.ToString(Configuraciones.CodigoTXTMontos)
  200. IngresoBrutoDif()
  201. Else
  202. _IngresoBrutoRecibido = 0
  203. End If
  204. End If
  205. End Sub
  206. Private Sub txtIngresoBrutoRecibido_Validated(sender As Object, e As EventArgs) Handles txtIngresoBrutoRecibido.Validated
  207. Me.ErrorProvider1.SetError(txtIngresoBrutoRecibido, "")
  208. End Sub
  209. Private Sub txtIngresoBrutoRecibido_MouseDown(sender As Object, e As MouseEventArgs) Handles txtIngresoBrutoRecibido.MouseDown
  210. txtIngresoBrutoRecibido.SelectAll()
  211. End Sub
  212. 'ISR
  213. Private Sub txtISRRecibido_Validating(sender As Object, e As CancelEventArgs) Handles txtISRRecibido.Validating
  214. Dim errMsg As String = String.Empty
  215. If Not ValidaMonto(txtISRRecibido.Text, errMsg) Then
  216. e.Cancel = True
  217. txtISRRecibido.SelectAll()
  218. Me.ErrorProvider1.SetError(txtISRRecibido, errMsg)
  219. Else
  220. If txtISRRecibido.Text.Length > 0 Then
  221. _ISRRecibido = txtISRRecibido.Text
  222. txtISRRecibido.Text = _ISRRecibido.ToString(Configuraciones.CodigoTXTMontos)
  223. ISRDif()
  224. Else
  225. _ISRRecibido = 0
  226. End If
  227. End If
  228. End Sub
  229. Private Sub txtISRRecibido_Validated(sender As Object, e As EventArgs) Handles txtISRRecibido.Validated
  230. Me.ErrorProvider1.SetError(txtISRRecibido, "")
  231. End Sub
  232. Private Sub txtISRRecibido_MouseDown(sender As Object, e As MouseEventArgs) Handles txtISRRecibido.MouseDown
  233. txtISRRecibido.SelectAll()
  234. End Sub
  235. 'INGRESO NETO
  236. Private Sub txtIngresoNetoRecibido_Validating(sender As Object, e As CancelEventArgs) Handles txtIngresoNetoRecibido.Validating
  237. Dim errMsg As String = String.Empty
  238. If Not ValidaMonto(txtIngresoNetoRecibido.Text, errMsg) Then
  239. e.Cancel = True
  240. txtIngresoNetoRecibido.SelectAll()
  241. Me.ErrorProvider1.SetError(txtIngresoNetoRecibido, errMsg)
  242. Else
  243. If txtIngresoNetoRecibido.Text.Length > 0 Then
  244. _IngresoNetoRecibido = txtIngresoNetoRecibido.Text
  245. txtIngresoNetoRecibido.Text = _IngresoNetoRecibido.ToString(Configuraciones.CodigoTXTMontos)
  246. IngresoNetoDif()
  247. Else
  248. _IngresoNetoRecibido = 0
  249. End If
  250. End If
  251. End Sub
  252. Private Sub txtIngresoNetoRecibido_Validated(sender As Object, e As EventArgs) Handles txtIngresoNetoRecibido.Validated
  253. Me.ErrorProvider1.SetError(txtIngresoNetoRecibido, "")
  254. End Sub
  255. Private Sub txtIngresoNetoRecibido_MouseDown(sender As Object, e As MouseEventArgs) Handles txtIngresoNetoRecibido.MouseDown
  256. txtIngresoNetoRecibido.SelectAll()
  257. End Sub
  258. 'INGRESO LIQUIDO
  259. Private Sub txtIngresoLiquidoRecibido_Validating(sender As Object, e As CancelEventArgs) Handles txtIngresoLiquidoRecibido.Validating
  260. Dim errMsg As String = String.Empty
  261. If Not ValidaMonto(txtIngresoLiquidoRecibido.Text, errMsg) Then
  262. e.Cancel = True
  263. txtIngresoLiquidoRecibido.SelectAll()
  264. Me.ErrorProvider1.SetError(txtIngresoLiquidoRecibido, errMsg)
  265. Else
  266. If txtIngresoLiquidoRecibido.Text.Length > 0 Then
  267. _IngresoLiquidoRecibido = txtIngresoLiquidoRecibido.Text
  268. txtIngresoLiquidoRecibido.Text = _IngresoLiquidoRecibido.ToString(Configuraciones.CodigoTXTMontos)
  269. IngresoLiquidoDif()
  270. Else
  271. _IngresoLiquidoRecibido = 0
  272. End If
  273. End If
  274. End Sub
  275. Private Sub txtIngresoLiquidoRecibido_Validated(sender As Object, e As EventArgs) Handles txtIngresoLiquidoRecibido.Validated
  276. Me.ErrorProvider1.SetError(txtIngresoLiquidoRecibido, "")
  277. End Sub
  278. Private Sub txtIngresoLiquidoRecibido_MouseDown(sender As Object, e As MouseEventArgs) Handles txtIngresoLiquidoRecibido.MouseDown
  279. txtIngresoLiquidoRecibido.SelectAll()
  280. End Sub
  281. Private Function ValidaMonto(ByVal pValorTXT As String, ByRef MensajeError As String) As Boolean
  282. Dim rValor As Double
  283. If pValorTXT.Length > 0 Then
  284. If Not Double.TryParse(pValorTXT, rValor) Then
  285. MensajeError = "Valor no válido."
  286. Return False
  287. Else
  288. Return True
  289. End If
  290. Else
  291. Return True
  292. End If
  293. End Function
  294. Private Sub cbxInstitucionFinanciera_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxBanco.SelectedIndexChanged
  295. _CodBanco = cbxBanco.SelectedValue
  296. CargarCuentasBancarias()
  297. End Sub
  298. Private Sub cbxCuentaBanco_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxCuentaBanco.SelectedIndexChanged
  299. If CargandoBancos = False Then _CuentaBancaria = cbxCuentaBanco.SelectedValue
  300. 'If CargandoBancos = False Then MsgBox(cbxCuentaBanco.SelectedValue.ToString)
  301. End Sub
  302. Private Sub cbxFormaDePago_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxFormaDePago.SelectedIndexChanged
  303. _FormaDePago = cbxFormaDePago.SelectedValue
  304. End Sub
  305. Private Function ValidacionesRegistrarIngreso() As Boolean
  306. Dim vDatosCorrectos As Boolean = True
  307. If _FormaDePago = String.Empty Then
  308. vDatosCorrectos = False
  309. ErrorProvider1.SetError(cbxFormaDePago, "Elegir Forma de Pago")
  310. Else
  311. ErrorProvider1.SetError(cbxFormaDePago, "")
  312. End If
  313. If _CodBanco = String.Empty Then
  314. vDatosCorrectos = False
  315. ErrorProvider1.SetError(cbxBanco, "Elegir Banco")
  316. Else
  317. ErrorProvider1.SetError(cbxBanco, "")
  318. End If
  319. If _CuentaBancaria = String.Empty Then
  320. vDatosCorrectos = False
  321. ErrorProvider1.SetError(cbxCuentaBanco, "Elegir Cuenta Bancaria")
  322. Else
  323. ErrorProvider1.SetError(cbxCuentaBanco, "")
  324. End If
  325. If _IngresoNetoRecibido = 0.000000 Then
  326. vDatosCorrectos = False
  327. ErrorProvider1.SetError(txtIngresoNetoRecibido, "Se necesita un Monto")
  328. Else
  329. ErrorProvider1.SetError(txtIngresoNetoRecibido, "")
  330. End If
  331. Return vDatosCorrectos
  332. End Function
  333. Private Sub btnRegistrarIngreso_Click(sender As Object, e As EventArgs) Handles btnRegistrarIngreso.Click
  334. If ValidacionesRegistrarIngreso() Then RegistrarIngreso()
  335. End Sub
  336. Private Sub RegistrarIngreso()
  337. Dim oRegistroIngreso As New RegistroIngresoCE
  338. Dim resultado As Integer
  339. vTransId = Utilidades.GenerarTransId
  340. oRegistroIngreso.CodigoEmpresa = _CodEmpr
  341. oRegistroIngreso.CodigoInstrumento = _CodIF
  342. oRegistroIngreso.CodigoBanco = _CodBanco
  343. oRegistroIngreso.CodigoInversion = _CodigoInversion
  344. oRegistroIngreso.IngresoID = _IngresoID
  345. oRegistroIngreso.FormaDePago = _FormaDePago
  346. oRegistroIngreso.CuentaBancaria = _CuentaBancaria
  347. oRegistroIngreso.FechaDelIngreso = dtpFechaIngreso.Value.Date
  348. oRegistroIngreso.FechaRegistro = Date.Now
  349. oRegistroIngreso.MontoCapital = _CapitalRecibido
  350. oRegistroIngreso.MontoIngresoBruto = _IngresoBrutoRecibido
  351. oRegistroIngreso.MontoISR = _ISRRecibido
  352. oRegistroIngreso.MontoIngresoNeto = _IngresoNetoRecibido
  353. oRegistroIngreso.MontoIngresoLiquido = _IngresoLiquidoRecibido
  354. oRegistroIngreso.TransId = vTransId
  355. resultado = IngresosDAO.RegistrarIngreso(oRegistroIngreso)
  356. If resultado = 1 Then
  357. MsgBox("Registrado")
  358. CrearPartidaIngresos()
  359. CargarIngresoDetalle()
  360. Else
  361. MsgBox("Algo paso mal")
  362. End If
  363. End Sub
  364. Private Sub lblCopiarCapital_Click(sender As Object, e As EventArgs) Handles lblCopiarCapital.Click
  365. Me.txtCapitalRecibido.Text = Me.txtCapitalProgramado.Text
  366. Me.txtCapitalRecibido.Focus()
  367. End Sub
  368. Private Sub lblCopiarIngresoBruto_Click(sender As Object, e As EventArgs) Handles lblCopiarIngresoBruto.Click
  369. Me.txtIngresoBrutoRecibido.Text = Me.txtIngresoBrutoProgramado.Text
  370. Me.txtIngresoBrutoRecibido.Focus()
  371. End Sub
  372. Private Sub lblCopiarISR_Click(sender As Object, e As EventArgs) Handles lblCopiarISR.Click
  373. Me.txtISRRecibido.Text = Me.txtISRProgramado.Text
  374. Me.txtISRRecibido.Focus()
  375. End Sub
  376. Private Sub lblCopiarIngresoNeto_Click(sender As Object, e As EventArgs) Handles lblCopiarIngresoNeto.Click
  377. Me.txtIngresoNetoRecibido.Text = Me.txtIngresoNetoProgramado.Text
  378. Me.txtIngresoNetoRecibido.Focus()
  379. End Sub
  380. Private Sub lblCopiarLiquido_Click(sender As Object, e As EventArgs) Handles lblCopiarLiquido.Click
  381. Me.txtIngresoLiquidoRecibido.Text = Me.txtIngresoLiquidoProgramado.Text
  382. Me.txtIngresoLiquidoRecibido.Focus()
  383. End Sub
  384. Private Sub txtIngresoNetoRecibido_TextChanged(sender As Object, e As EventArgs) Handles txtIngresoNetoRecibido.TextChanged
  385. End Sub
  386. Private Sub btnValidarIngreso_Click(sender As Object, e As EventArgs) Handles btnValidarIngreso.Click
  387. Dim vValidar As Integer
  388. vTransId = Utilidades.GenerarTransId
  389. vValidar = IngresosDAO.ValidarIngreso(_CodigoInversion, _IngresoID)
  390. If vValidar = 1 Then
  391. MsgBox("Ingreso Validado")
  392. CargarIngresoDetalle()
  393. Else
  394. MsgBox("Error al validar.", MsgBoxStyle.Critical)
  395. End If
  396. End Sub
  397. Private Sub btnConciliarIngreso_Click(sender As Object, e As EventArgs) Handles btnConciliarIngreso.Click
  398. Dim vConciliar As Integer
  399. vTransId = Utilidades.GenerarTransId
  400. vConciliar = IngresosDAO.ConciliarIngreso(_CodigoInversion, _IngresoID)
  401. If vConciliar = 1 Then
  402. MsgBox("Ingreso Conciliado")
  403. 'CrearPartidaIngresos()
  404. CargarIngresoDetalle()
  405. Else
  406. MsgBox("Error al Conciliar.", MsgBoxStyle.Critical)
  407. End If
  408. End Sub
  409. Private Sub ControlCapitalDif()
  410. If vEstadoDelIngreso = "P" Then
  411. _CapitalRecibidoDif = _Capital - _CapitalRecibido
  412. End If
  413. txtVariacionCapital.Text = _CapitalRecibidoDif.ToString(Configuraciones.CodigoTXTMontos)
  414. End Sub
  415. Private Sub IngresoBrutoDif()
  416. If vEstadoDelIngreso = "P" Then
  417. _IngresoBrutoRecibidoDif = _IngresoBruto - _IngresoBrutoRecibido
  418. End If
  419. txtVariacionIngresoBruto.Text = _IngresoBrutoRecibidoDif.ToString(Configuraciones.CodigoTXTMontos)
  420. End Sub
  421. Private Sub ISRDif()
  422. If vEstadoDelIngreso = "P" Then
  423. _ISRRecibidoDif = _ISR - _ISRRecibido
  424. End If
  425. txtVariacionISR.Text = _ISRRecibidoDif.ToString(Configuraciones.CodigoTXTMontos)
  426. End Sub
  427. Private Sub IngresoNetoDif()
  428. If vEstadoDelIngreso = "P" Then
  429. _IngresoNetoRecibidoDif = _IngresoNeto - _IngresoNetoRecibido
  430. End If
  431. txtVariacionIngresoNeto.Text = _IngresoNetoRecibidoDif.ToString(Configuraciones.CodigoTXTMontos)
  432. End Sub
  433. Private Sub IngresoLiquidoDif()
  434. If vEstadoDelIngreso = "P" Then
  435. _IngresoLiquidoRecibidoDif = _IngresoLiquidoProgramado - _IngresoLiquidoRecibido
  436. End If
  437. txtVariacionIngresoLiquido.Text = _IngresoLiquidoRecibidoDif.ToString(Configuraciones.CodigoTXTMontos)
  438. End Sub
  439. Private Sub txtCapitalRecibido_TextChanged(sender As Object, e As EventArgs) Handles txtCapitalRecibido.TextChanged
  440. End Sub
  441. End Class