Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. package br.com.projetusinformatica.calima.mcg.report.demonstracaoresultado
  2.  
  3. import br.com.projetusinformatica.calima.ger.report.ReportMask
  4.  
  5. /**
  6. * @author Pedro Jannotti
  7. * @since 28/02/14
  8. */
  9. class DemonstracaoResultadoRelDec {
  10.  
  11. String descricao
  12. BigDecimal valor
  13. BigDecimal total
  14. BigDecimal valorPeriodoAnterior
  15. BigDecimal totalPeriodoAnterior
  16. boolean imprimirParentesis = true
  17. boolean imprimirTracoValor = false
  18.  
  19. List<DemonstracaoResultadoSubRelDec> detalhes = []
  20.  
  21. String getValorFmt() {
  22. if (!valor) {
  23. return ''
  24. }
  25.  
  26. def valorFmt = ReportMask.inputMaskDecimal(valor)
  27. if (imprimirParentesis && valor.compareTo(BigDecimal.ZERO) < 0) {
  28. valorFmt = '(' + ReportMask.inputMaskDecimal(valor.abs()) + ')'
  29. }
  30.  
  31. return valorFmt
  32. }
  33.  
  34. String getTotalFmt() {
  35. if (!total) {
  36. return ''
  37. }
  38.  
  39. def totalFmt = ReportMask.inputMaskDecimal(total)
  40. if (imprimirParentesis && total.compareTo(BigDecimal.ZERO) < 0) {
  41. totalFmt = '(' + ReportMask.inputMaskDecimal(total.abs()) + ')'
  42. }
  43.  
  44. return totalFmt
  45. }
  46.  
  47. String getValorAnteriorFmt() {
  48. if (!valorPeriodoAnterior) {
  49. return ''
  50. }
  51.  
  52. def valorFmt = ReportMask.inputMaskDecimal(valorPeriodoAnterior)
  53. if (imprimirParentesis && valorPeriodoAnterior.compareTo(BigDecimal.ZERO) < 0) {
  54. valorFmt = '(' + ReportMask.inputMaskDecimal(valorPeriodoAnterior.abs()) + ')'
  55. }
  56.  
  57. return valorFmt
  58. }
  59.  
  60. String getTotalAnteriorFmt() {
  61. if (!totalPeriodoAnterior) {
  62. return ''
  63. }
  64.  
  65. def totalFmt = ReportMask.inputMaskDecimal(totalPeriodoAnterior)
  66. if (imprimirParentesis && totalPeriodoAnterior.compareTo(BigDecimal.ZERO) < 0) {
  67. totalFmt = '(' + ReportMask.inputMaskDecimal(totalPeriodoAnterior.abs()) + ')'
  68. }
  69.  
  70. return totalFmt
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement