AccionesCE.vb 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  1. 
  2. Public Class AccionesCE
  3. Private _CodigoInversion As String
  4. Private _TipoOperacion As String
  5. Private _AccionPreferente As String
  6. Private _OperacionEnBolsa As String
  7. Private _FactorDeDividendo As Double
  8. Private _IngresoBruto As Double
  9. Private _IngresoBrutoPendiente As Double
  10. Private _ISR As Double
  11. Private _ISRPendiente As Double
  12. Private _IngresoNeto As Double
  13. Dim Operaciones As New Operaciones
  14. Private _IngresoNetoPendiente As Double
  15. 'Private _Dividendos As New AccionesDetalleCE
  16. Private _dtImpuestosYComisiones As DataTable
  17. Private _dtDividendos As DataTable
  18. Private _TipoInstrumento As String = "ACC"
  19. Private _CodigoInstrumentoFinanciero As String
  20. Private _DescripcionTipoInstrumento As String
  21. Private _Registro As DataTable
  22. Private _ComisionCompraCasa As Double
  23. Private _ComisionCompraBolsa As Double
  24. Private _ComisionVentaCasa As Double
  25. Private _ComisionVentaBolsa As Double
  26. Private _IOF As Boolean
  27. Private _Renta As Boolean
  28. Private _Tipo As String
  29. Private _RetornoBruto As Double
  30. Private _GananciaDeCapitalTotalVentasus As Double = 0
  31. Private _RetornoAnualizadoBrutoVentasus As Double = 0
  32. Private _MontoNetoVentasus As Double = 0
  33. Private _PrecioSucioVentasus As Double = 0
  34. Private _ComisionPorcentajeCompraCasa As Double = 0
  35. Private _ComisionPorcentajeCompraBolsa As Double = 0
  36. Private _ComisionPorcentajeVentaCasa As Double = 0
  37. Private _ComisionPorcentajeVentaBolsa As Double = 0
  38. Private _MontoNetoComprasus As Double = 0
  39. Public ReadOnly Property TipoInstrumento As String
  40. Get
  41. Return _TipoInstrumento
  42. End Get
  43. End Property
  44. Public Property DescripcionTipoInstrumento As String
  45. Get
  46. Return _DescripcionTipoInstrumento
  47. End Get
  48. Set(value As String)
  49. _DescripcionTipoInstrumento = value
  50. End Set
  51. End Property
  52. Public ReadOnly Property Registro As DataTable
  53. Get
  54. Return _Registro
  55. End Get
  56. End Property
  57. 'COMPRA
  58. Private _CodigoCasaCompra As String
  59. Private _PrecioLimpioCompra As Double
  60. Private _FechaOperacionCompra As Date
  61. Private _FechaLiquidacionCompra As Date
  62. Private _DiasDeTenenciaCompra As Integer
  63. Private _GananciaDeCapitalTotalCompra As Double
  64. Private _GananciaDeCapitalUnitarioCompra As Double
  65. Private _RetornoAnualizadoBrutoCompra As Double
  66. Private _RetornoAnualizadoNetoCompra As Double
  67. Private _CantidadCompra As Integer
  68. Private _ValorTransadoCompra As Double
  69. Private _MontoNetoCompra As Double
  70. Private _PrecioSucioCompra As Double
  71. Private _SumaImpuestosYComisionesCompra As Double
  72. 'VENTA
  73. Private _CodigoCasaVenta As String
  74. Private _PrecioLimpioVenta As Double
  75. Private _FechaOperacionVenta As Date
  76. Private _FechaLiquidacionVenta As Date
  77. Private _DiasDeTenenciaVenta As Integer
  78. Private _GananciaDeCapitalTotalVenta As Double
  79. Private _GananciaDeCapitalUnitarioVenta As Double
  80. Private _RetornoAnualizadoBrutoVenta As Double
  81. Private _RetornoAnualizadoNetoVenta As Double
  82. Private _CantidadVenta As Integer
  83. Private _ValorTransadoVenta As Double
  84. Private _MontoNetoVenta As Double
  85. Private _PrecioSucioVenta As Double
  86. Private _SumaImpuestosYComisionesVenta As Double
  87. 'GENERAL
  88. Public Property CodigoInversion
  89. Get
  90. Return _CodigoInversion
  91. End Get
  92. Set(value)
  93. _CodigoInversion = value
  94. End Set
  95. End Property
  96. Public Property AccionPreferente As String
  97. Get
  98. Return _AccionPreferente
  99. End Get
  100. Set(value As String)
  101. _AccionPreferente = value
  102. End Set
  103. End Property
  104. Public Property OperacionEnBolsa As String
  105. Get
  106. Return _OperacionEnBolsa
  107. End Get
  108. Set(value As String)
  109. _OperacionEnBolsa = value
  110. End Set
  111. End Property
  112. Public Property FactorDeDividendo As Double
  113. Get
  114. Return _FactorDeDividendo
  115. End Get
  116. Set(value As Double)
  117. _FactorDeDividendo = value
  118. End Set
  119. End Property
  120. Public Property IngresoBruto As Double
  121. Get
  122. Return _IngresoBruto
  123. End Get
  124. Set(value As Double)
  125. _IngresoBruto = value
  126. CalcularRetornoAnualBrutoVenta()
  127. End Set
  128. End Property
  129. Public Property IngresoBrutoPendiente As Double
  130. Get
  131. Return _IngresoBrutoPendiente
  132. End Get
  133. Set(value As Double)
  134. _IngresoBrutoPendiente = value
  135. CalcularRetornoAnualBrutoVenta()
  136. End Set
  137. End Property
  138. Public Property ISR As Double
  139. Get
  140. Return _ISR
  141. End Get
  142. Set(value As Double)
  143. _ISR = value
  144. End Set
  145. End Property
  146. Public Property ISRPendiente As Double
  147. Get
  148. Return _ISRPendiente
  149. End Get
  150. Set(value As Double)
  151. _ISRPendiente = value
  152. End Set
  153. End Property
  154. Public Property IngresoNeto As Double
  155. Get
  156. Return _IngresoNeto
  157. End Get
  158. Set(value As Double)
  159. _IngresoNeto = value
  160. CalcularRetornoAnualNetoVenta()
  161. End Set
  162. End Property
  163. Public Property IngresoNetoPendiente As Double
  164. Get
  165. Return _IngresoNetoPendiente
  166. End Get
  167. Set(value As Double)
  168. _IngresoNetoPendiente = value
  169. CalcularRetornoAnualNetoVenta()
  170. End Set
  171. End Property
  172. Public Property ImpuestosYComisiones As DataTable
  173. Get
  174. Return _dtImpuestosYComisiones
  175. End Get
  176. Set(value As DataTable)
  177. _dtImpuestosYComisiones = value
  178. CalcularSumaImpuestosyComisiones()
  179. End Set
  180. End Property
  181. Public Property Dividendos As DataTable
  182. Get
  183. Return _dtDividendos
  184. End Get
  185. Set(value As DataTable)
  186. _dtDividendos = value
  187. CalcularSumasDividendos()
  188. End Set
  189. End Property
  190. 'COMPRA
  191. Public Property CodigoCasaCompra As String
  192. Get
  193. Return _CodigoCasaCompra
  194. End Get
  195. Set(value As String)
  196. _CodigoCasaCompra = value
  197. End Set
  198. End Property
  199. Public Property PrecioLimpioCompra As Double
  200. Get
  201. Return _PrecioLimpioCompra
  202. End Get
  203. Set(value As Double)
  204. _PrecioLimpioCompra = value
  205. CalculaValorTrasadoCompra()
  206. End Set
  207. End Property
  208. Public Property FechaOperacionCompra As Date
  209. Get
  210. Return _FechaOperacionCompra
  211. End Get
  212. Set(value As Date)
  213. _FechaOperacionCompra = value
  214. End Set
  215. End Property
  216. Public Property FechaVencimientoCompra As Date
  217. Get
  218. Return _FechaLiquidacionCompra
  219. End Get
  220. Set(value As Date)
  221. _FechaLiquidacionCompra = value
  222. CalcularDiasDeTenenciaVenta()
  223. End Set
  224. End Property
  225. Public Property DiasDeTenenciaCompra As Integer
  226. Get
  227. Return _DiasDeTenenciaCompra
  228. End Get
  229. Set(value As Integer)
  230. _DiasDeTenenciaCompra = value
  231. End Set
  232. End Property
  233. Public Property ComisionVentaBolsa As Double
  234. Get
  235. Return _ComisionVentaBolsa
  236. End Get
  237. Set(value As Double)
  238. _ComisionVentaBolsa = value
  239. End Set
  240. End Property
  241. Public Property ComisionPorcentajeVentaBolsa As Double
  242. Get
  243. Return _ComisionPorcentajeVentaBolsa
  244. End Get
  245. Set(value As Double)
  246. _ComisionPorcentajeVentaBolsa = value
  247. End Set
  248. End Property
  249. Public Property ComisionVentaCasa As Double
  250. Get
  251. Return _ComisionVentaCasa
  252. End Get
  253. Set(value As Double)
  254. _ComisionVentaCasa = value
  255. End Set
  256. End Property
  257. Public Property ComisionPorcentajeVentaCasa As Double
  258. Get
  259. Return _ComisionPorcentajeVentaCasa
  260. End Get
  261. Set(value As Double)
  262. _ComisionPorcentajeVentaCasa = value
  263. End Set
  264. End Property
  265. Public Property ComisionCompraBolsa As Double
  266. Get
  267. Return _ComisionCompraBolsa
  268. End Get
  269. Set(value As Double)
  270. _ComisionCompraBolsa = value
  271. End Set
  272. End Property
  273. Public Property ComisionPorcentajeCompraBolsa As Double
  274. Get
  275. Return _ComisionPorcentajeCompraBolsa
  276. End Get
  277. Set(value As Double)
  278. _ComisionPorcentajeCompraBolsa = value
  279. End Set
  280. End Property
  281. Public Property ComisionCompraCasa As Double
  282. Get
  283. Return _ComisionCompraCasa
  284. End Get
  285. Set(value As Double)
  286. _ComisionCompraCasa = value
  287. End Set
  288. End Property
  289. Public Property ComisionPorcentajeCompraCasa As Double
  290. Get
  291. Return _ComisionPorcentajeCompraCasa
  292. End Get
  293. Set(value As Double)
  294. _ComisionPorcentajeCompraCasa = value
  295. End Set
  296. End Property
  297. Public Property IOF As Boolean
  298. Get
  299. Return _IOF
  300. End Get
  301. Set(value As Boolean)
  302. _IOF = value
  303. End Set
  304. End Property
  305. Public Property Renta As Boolean
  306. Get
  307. Return _Renta
  308. End Get
  309. Set(value As Boolean)
  310. _Renta = value
  311. End Set
  312. End Property
  313. Public Property GananciaDeCapitalTotalCompra As Double
  314. Get
  315. Return _GananciaDeCapitalTotalCompra
  316. End Get
  317. Set(value As Double)
  318. _GananciaDeCapitalTotalCompra = value
  319. End Set
  320. End Property
  321. Public Property GananciaDeCapitalUnitarioCompra As Double
  322. Get
  323. Return _GananciaDeCapitalUnitarioCompra
  324. End Get
  325. Set(value As Double)
  326. _GananciaDeCapitalUnitarioCompra = value
  327. End Set
  328. End Property
  329. Public Property RetornoAnualizadoBrutoCompra As Double
  330. Get
  331. Return _RetornoAnualizadoBrutoCompra
  332. End Get
  333. Set(value As Double)
  334. _RetornoAnualizadoBrutoCompra = value
  335. End Set
  336. End Property
  337. Public Property RetornoAnualizadoNetoCompra As Double
  338. Get
  339. Return _RetornoAnualizadoNetoCompra
  340. End Get
  341. Set(value As Double)
  342. _RetornoAnualizadoNetoCompra = value
  343. End Set
  344. End Property
  345. Public Property CantidadCompra As Integer
  346. Get
  347. Return _CantidadCompra
  348. End Get
  349. Set(value As Integer)
  350. _CantidadCompra = value
  351. CalculaValorTrasadoCompra()
  352. CalcularPrecioSucioCompra()
  353. End Set
  354. End Property
  355. Public Property ValorTransadoCompra As Double
  356. Get
  357. Return _ValorTransadoCompra
  358. End Get
  359. Set(value As Double)
  360. _ValorTransadoCompra = value
  361. End Set
  362. End Property
  363. Public Property MontoNetoCompra As Double
  364. Get
  365. Return _MontoNetoCompra
  366. End Get
  367. Set(value As Double)
  368. _MontoNetoCompra = value
  369. CalcularMontoNetoCompra()
  370. End Set
  371. End Property
  372. Public Property MontoNetoComprasus As Double
  373. Get
  374. Return _MontoNetoComprasus
  375. End Get
  376. Set(value As Double)
  377. _MontoNetoComprasus = value
  378. End Set
  379. End Property
  380. Public Property PrecioSucioCompra As Double
  381. Get
  382. Return _PrecioSucioCompra
  383. End Get
  384. Set(value As Double)
  385. _PrecioSucioCompra = value
  386. End Set
  387. End Property
  388. Public Property SumaImpuestosYComisionesCompra As Double
  389. Get
  390. Return _SumaImpuestosYComisionesCompra
  391. End Get
  392. Set(value As Double)
  393. _SumaImpuestosYComisionesCompra = value
  394. CalcularMontoNetoCompra()
  395. End Set
  396. End Property
  397. 'VENTA
  398. Public Property CodigoCasaVenta As String
  399. Get
  400. Return _CodigoCasaVenta
  401. End Get
  402. Set(value As String)
  403. _CodigoCasaVenta = value
  404. End Set
  405. End Property
  406. Public Property PrecioLimpioVenta As Double
  407. Get
  408. Return _PrecioLimpioVenta
  409. End Get
  410. Set(value As Double)
  411. _PrecioLimpioVenta = value
  412. CalcularValorTransadoVenta()
  413. End Set
  414. End Property
  415. Public Property FechaOperacionVenta As Date
  416. Get
  417. Return _FechaOperacionVenta
  418. End Get
  419. Set(value As Date)
  420. _FechaOperacionVenta = value
  421. End Set
  422. End Property
  423. Public Property FechaVencimientoVenta As Date
  424. Get
  425. Return _FechaLiquidacionVenta
  426. End Get
  427. Set(value As Date)
  428. _FechaLiquidacionVenta = value
  429. CalcularDiasDeTenenciaVenta()
  430. End Set
  431. End Property
  432. Public Property DiasDeTenenciaVenta As Integer
  433. Get
  434. Return _DiasDeTenenciaVenta
  435. End Get
  436. Set(value As Integer)
  437. _DiasDeTenenciaVenta = value
  438. End Set
  439. End Property
  440. Public Property GananciaDeCapitalTotalVenta As Double
  441. Get
  442. Return _GananciaDeCapitalTotalVenta
  443. End Get
  444. Set(value As Double)
  445. _GananciaDeCapitalTotalVenta = value
  446. End Set
  447. End Property
  448. Public Property GananciaDeCapitalTotalVentasus As Double
  449. Get
  450. Return _GananciaDeCapitalTotalVentasus
  451. End Get
  452. Set(value As Double)
  453. _GananciaDeCapitalTotalVentasus = value
  454. End Set
  455. End Property
  456. Public Property GananciaDeCapitalUnitarioVenta As Double
  457. Get
  458. Return _GananciaDeCapitalUnitarioVenta
  459. End Get
  460. Set(value As Double)
  461. _GananciaDeCapitalUnitarioVenta = value
  462. End Set
  463. End Property
  464. Public Property RetornoAnualizadoBrutoVenta As Double
  465. Get
  466. CalcularRetornoAnualBrutoVenta()
  467. Return _RetornoAnualizadoBrutoVenta
  468. End Get
  469. Set(value As Double)
  470. _RetornoAnualizadoBrutoVenta = value
  471. End Set
  472. End Property
  473. Public Property RetornoAnualizadoBrutoVentasus As Double
  474. Get
  475. Return _RetornoAnualizadoBrutoVentasus
  476. End Get
  477. Set(value As Double)
  478. _RetornoAnualizadoBrutoVentasus = value
  479. End Set
  480. End Property
  481. Public Property RetornoAnualizadoNetoVenta As Double
  482. Get
  483. CalcularRetornoAnualNetoVenta()
  484. Return _RetornoAnualizadoNetoVenta
  485. End Get
  486. Set(value As Double)
  487. _RetornoAnualizadoNetoVenta = value
  488. End Set
  489. End Property
  490. Public Property CantidadVenta As Integer
  491. Get
  492. Return _CantidadVenta
  493. End Get
  494. Set(value As Integer)
  495. _CantidadVenta = value
  496. CalcularValorTransadoVenta()
  497. CalcularGananciaDeCapitalUnitarioVenta()
  498. CalcularPrecioSucioVenta()
  499. End Set
  500. End Property
  501. Public Property Tipo As String
  502. Get
  503. Return _Tipo
  504. End Get
  505. Set(value As String)
  506. _Tipo = value
  507. End Set
  508. End Property
  509. Public Property RetornoBruto As Double
  510. Get
  511. Return _RetornoBruto
  512. End Get
  513. Set(value As Double)
  514. _RetornoBruto = value
  515. End Set
  516. End Property
  517. Public Property ValorTransadoVenta As Double
  518. Get
  519. Return _ValorTransadoVenta
  520. End Get
  521. Set(value As Double)
  522. _ValorTransadoVenta = value
  523. End Set
  524. End Property
  525. Public Property MontoNetoVenta As Double
  526. Get
  527. Return _MontoNetoVenta
  528. End Get
  529. Set(value As Double)
  530. _MontoNetoVenta = value
  531. End Set
  532. End Property
  533. Public Property MontoNetoVentasus As Double
  534. Get
  535. Return _MontoNetoVentasus
  536. End Get
  537. Set(value As Double)
  538. _MontoNetoVentasus = value
  539. End Set
  540. End Property
  541. Public Property PrecioSucioVenta As Double
  542. Get
  543. Return _PrecioSucioVenta
  544. End Get
  545. Set(value As Double)
  546. _PrecioSucioVenta = value
  547. End Set
  548. End Property
  549. Public Property PrecioSucioVentasus As Double
  550. Get
  551. Return _PrecioSucioVentasus
  552. End Get
  553. Set(value As Double)
  554. _PrecioSucioVentasus = value
  555. End Set
  556. End Property
  557. Public Property SumaImpuestosYComisionesVenta As Double
  558. Get
  559. Return _SumaImpuestosYComisionesVenta
  560. End Get
  561. Set(value As Double)
  562. _SumaImpuestosYComisionesVenta = value
  563. CalcularMontoNetoVenta()
  564. End Set
  565. End Property
  566. Public Sub New()
  567. 'GENERAL
  568. _IngresoBruto = 0
  569. _IngresoBrutoPendiente = 0
  570. _ISR = 0
  571. _ISRPendiente = 0
  572. _IngresoNeto = 0
  573. _IngresoNetoPendiente = 0
  574. _dtImpuestosYComisiones = New DataTable
  575. _dtDividendos = New DataTable
  576. _Registro = New DataTable
  577. 'COMPRA
  578. _PrecioLimpioCompra = 0
  579. _FechaOperacionCompra = Date.Now.Date
  580. _FechaLiquidacionCompra = Date.Now.Date
  581. _CantidadCompra = 1
  582. _DiasDeTenenciaCompra = 0
  583. _GananciaDeCapitalTotalCompra = 0
  584. _GananciaDeCapitalUnitarioCompra = 0
  585. _RetornoAnualizadoBrutoCompra = 0
  586. _RetornoAnualizadoNetoCompra = 0
  587. _ValorTransadoCompra = 0
  588. _MontoNetoCompra = 0
  589. _PrecioSucioCompra = 0
  590. 'VENTA
  591. _PrecioLimpioVenta = 0
  592. _FechaOperacionVenta = Date.Now.Date
  593. _FechaLiquidacionVenta = Date.Now.Date
  594. _CantidadVenta = 1
  595. _DiasDeTenenciaVenta = 0
  596. _GananciaDeCapitalTotalVenta = 0
  597. _GananciaDeCapitalUnitarioVenta = 0
  598. _RetornoAnualizadoBrutoVenta = 0
  599. _RetornoAnualizadoNetoVenta = 0
  600. _CantidadVenta = 0
  601. _ValorTransadoVenta = 0
  602. _MontoNetoVenta = 0
  603. _PrecioSucioVenta = 0
  604. End Sub
  605. 'CALCULOS COMPRA
  606. Private Sub CalculaValorTrasadoCompra()
  607. _ValorTransadoCompra = _CantidadCompra * _PrecioLimpioCompra
  608. CalcularMontoNetoCompra()
  609. End Sub
  610. Private Sub CalcularMontoNetoCompra()
  611. _MontoNetoCompra = _ValorTransadoCompra + _SumaImpuestosYComisionesCompra
  612. CalcularPrecioSucioCompra()
  613. CalcularGananciaDeCapitalTotalVenta()
  614. CalcularRetornoAnualBrutoVenta()
  615. CalcularRetornoAnualNetoVenta()
  616. CalcularSumasDividendos()
  617. End Sub
  618. Private Sub CalcularPrecioSucioCompra()
  619. If (String.IsNullOrEmpty(_CantidadCompra.ToString) Or _CantidadCompra.ToString = "0") Then
  620. _PrecioSucioCompra = "0.0"
  621. Else
  622. _PrecioSucioCompra = _MontoNetoCompra / _CantidadCompra
  623. End If
  624. End Sub
  625. 'CALCULOS VENTA
  626. Private Sub CalcularDiasDeTenenciaVenta()
  627. Dim valor As Integer
  628. If _FechaLiquidacionVenta > Date.Today.Date Then
  629. valor = DateDiff(DateInterval.Day, _FechaLiquidacionCompra, Date.Today.Date)
  630. Else
  631. valor = DateDiff(DateInterval.Day, _FechaLiquidacionCompra, _FechaLiquidacionVenta)
  632. End If
  633. _DiasDeTenenciaVenta = valor
  634. CalcularRetornoAnualBrutoVenta()
  635. CalcularRetornoAnualNetoVenta()
  636. CalcularSumasDividendos()
  637. End Sub
  638. Private Sub CalcularValorTransadoVenta()
  639. _ValorTransadoVenta = _PrecioLimpioVenta * _CantidadVenta
  640. CalcularMontoNetoVenta()
  641. End Sub
  642. Private Sub CalcularMontoNetoVenta()
  643. _MontoNetoVenta = _ValorTransadoVenta - _SumaImpuestosYComisionesVenta
  644. CalcularGananciaDeCapitalTotalVenta()
  645. CalcularPrecioSucioVenta()
  646. End Sub
  647. Private Sub CalcularGananciaDeCapitalTotalVenta()
  648. _GananciaDeCapitalTotalVenta = _MontoNetoVenta - _MontoNetoCompra
  649. CalcularGananciaDeCapitalUnitarioVenta()
  650. CalcularRetornoAnualBrutoVenta()
  651. CalcularRetornoAnualNetoVenta()
  652. CalcularSumasDividendos()
  653. End Sub
  654. Private Sub CalcularGananciaDeCapitalUnitarioVenta()
  655. _GananciaDeCapitalUnitarioVenta = _GananciaDeCapitalTotalVenta / _CantidadVenta
  656. _GananciaDeCapitalUnitarioVenta = Format(_GananciaDeCapitalUnitarioVenta, "0.0000")
  657. End Sub
  658. Private Sub CalcularRetornoAnualBrutoVenta()
  659. If _DiasDeTenenciaVenta = 0 Or _MontoNetoCompra = 0 Then
  660. _RetornoAnualizadoBrutoVenta = 0
  661. Else
  662. _RetornoAnualizadoBrutoVenta = ((_GananciaDeCapitalTotalVenta + Variables.IngresoBruto) / _MontoNetoCompra) * 365 / _DiasDeTenenciaVenta
  663. End If
  664. End Sub
  665. Private Sub CalcularRetornoAnualNetoVenta()
  666. If _DiasDeTenenciaVenta = 0 Or _MontoNetoCompra Then
  667. _RetornoAnualizadoNetoVenta = 0
  668. Else
  669. _RetornoAnualizadoNetoVenta = ((_GananciaDeCapitalTotalVenta + Variables.IngresoNeto) / _MontoNetoCompra) * 365 / _DiasDeTenenciaVenta
  670. End If
  671. End Sub
  672. Private Sub CalcularPrecioSucioVenta()
  673. _PrecioSucioVenta = _MontoNetoVenta / _CantidadVenta
  674. End Sub
  675. Private Sub CalcularSumaImpuestosyComisiones()
  676. If Not Double.TryParse(_dtImpuestosYComisiones.Compute("SUM(MontoImp)", "TipoOper='C'").ToString, _SumaImpuestosYComisionesCompra) Then
  677. _SumaImpuestosYComisionesCompra = 0
  678. End If
  679. If Not Double.TryParse(_dtImpuestosYComisiones.Compute("SUM(MontoImp)", "TipoOper='V'").ToString, _SumaImpuestosYComisionesVenta) Then
  680. _SumaImpuestosYComisionesVenta = 0
  681. End If
  682. CalcularMontoNetoCompra()
  683. CalcularMontoNetoVenta()
  684. End Sub
  685. Private Sub CalcularSumasDividendos()
  686. 'If Not Double.TryParse(_dtDividendos.Compute("SUM(IngresoBruto)", "").ToString, _IngresoBruto) Then
  687. ' _IngresoBruto = 0
  688. 'End If
  689. 'If Not Double.TryParse(_dtDividendos.Compute("SUM(ISR)", "").ToString, _ISR) Then
  690. ' _ISR = 0
  691. 'End If
  692. 'If Not Double.TryParse(_dtDividendos.Compute("SUM(IngresoNeto)", "").ToString, _IngresoNeto) Then
  693. ' _IngresoNeto = 0
  694. 'End If
  695. End Sub
  696. Private Sub PrepararRegistro()
  697. End Sub
  698. End Class