mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-13 00:48:49 +00:00
primera version final del presupuesto
This commit is contained in:
@ -1,19 +1,15 @@
|
||||
package com.imprimelibros.erp.presupuesto;
|
||||
|
||||
import com.imprimelibros.erp.common.Utils;
|
||||
import com.imprimelibros.erp.datatables.*;
|
||||
import com.imprimelibros.erp.presupuesto.dto.Presupuesto;
|
||||
|
||||
import jakarta.persistence.criteria.Expression;
|
||||
import jakarta.persistence.criteria.JoinType;
|
||||
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import jakarta.persistence.criteria.Predicate;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.NumberFormat;
|
||||
import java.time.*;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
@ -71,7 +67,7 @@ public class PresupuestoDatatableService {
|
||||
cb.coalesce(root.get("paginasNegro"), cb.literal(0))))
|
||||
|
||||
.add("estado", p -> msg(p.getEstado().getMessageKey(), locale))
|
||||
.add("totalConIva", p -> formatCurrency(p.getTotalConIva(), locale))
|
||||
.add("totalConIva", p -> Utils.formatCurrency(p.getTotalConIva(), locale))
|
||||
.addIf(publico, "pais", Presupuesto::getPais)
|
||||
.addIf(publico, "region", Presupuesto::getRegion)
|
||||
.addIf(publico, "ciudad", Presupuesto::getCiudad)
|
||||
@ -105,12 +101,6 @@ public class PresupuestoDatatableService {
|
||||
return df.format(instant);
|
||||
}
|
||||
|
||||
private String formatCurrency(BigDecimal value, Locale locale) {
|
||||
if (value == null)
|
||||
return "";
|
||||
return NumberFormat.getCurrencyInstance(locale).format(value);
|
||||
}
|
||||
|
||||
private String generarBotones(Presupuesto p) {
|
||||
boolean borrador = p.getEstado() == Presupuesto.Estado.borrador;
|
||||
String id = String.valueOf(p.getId());
|
||||
|
||||
Reference in New Issue
Block a user