Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package br.com.projetusinformatica.calima.mcg.report.demonstracaoresultado
- import br.com.projetusinformatica.calima.ger.report.ReportMask
- /**
- * @author Pedro Jannotti
- * @since 28/02/14
- */
- class DemonstracaoResultadoRelDec {
- String descricao
- BigDecimal valor
- BigDecimal total
- BigDecimal valorPeriodoAnterior
- BigDecimal totalPeriodoAnterior
- boolean imprimirParentesis = true
- boolean imprimirTracoValor = false
- List<DemonstracaoResultadoSubRelDec> detalhes = []
- String getValorFmt() {
- if (!valor) {
- return ''
- }
- def valorFmt = ReportMask.inputMaskDecimal(valor)
- if (imprimirParentesis && valor.compareTo(BigDecimal.ZERO) < 0) {
- valorFmt = '(' + ReportMask.inputMaskDecimal(valor.abs()) + ')'
- }
- return valorFmt
- }
- String getTotalFmt() {
- if (!total) {
- return ''
- }
- def totalFmt = ReportMask.inputMaskDecimal(total)
- if (imprimirParentesis && total.compareTo(BigDecimal.ZERO) < 0) {
- totalFmt = '(' + ReportMask.inputMaskDecimal(total.abs()) + ')'
- }
- return totalFmt
- }
- String getValorAnteriorFmt() {
- if (!valorPeriodoAnterior) {
- return ''
- }
- def valorFmt = ReportMask.inputMaskDecimal(valorPeriodoAnterior)
- if (imprimirParentesis && valorPeriodoAnterior.compareTo(BigDecimal.ZERO) < 0) {
- valorFmt = '(' + ReportMask.inputMaskDecimal(valorPeriodoAnterior.abs()) + ')'
- }
- return valorFmt
- }
- String getTotalAnteriorFmt() {
- if (!totalPeriodoAnterior) {
- return ''
- }
- def totalFmt = ReportMask.inputMaskDecimal(totalPeriodoAnterior)
- if (imprimirParentesis && totalPeriodoAnterior.compareTo(BigDecimal.ZERO) < 0) {
- totalFmt = '(' + ReportMask.inputMaskDecimal(totalPeriodoAnterior.abs()) + ')'
- }
- return totalFmt
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement