use of com.autentia.tnt.businessobject.BillBreakDown in project TNTConcept by autentia.
the class BillManagerTest method getAllBitacoreBreakDownsHaveCorrectIvaForLastDayOf18IvaTest.
@Test
public void getAllBitacoreBreakDownsHaveCorrectIvaForLastDayOf18IvaTest() {
final Project project = insertProjectIntoContext(lastDateFor18Iva);
ProjectCost projectCost = createProjectCost(project);
final GregorianCalendar calendarEnd = new GregorianCalendar(2012, 11, 1);
final List<BillBreakDown> billBreakDownList = billManager.getAllBitacoreBreakDowns(lastDateFor18Iva, calendarEnd.getTime(), project);
assertEquals(IVA18, billBreakDownList.get(0).getIva());
assertEquals(IVA18, billBreakDownList.get(1).getIva());
deleteProjectCostFromContext(projectCost);
deleteProjectFromContext(project);
}
use of com.autentia.tnt.businessobject.BillBreakDown in project TNTConcept by autentia.
the class OfferBeanTest method createRolesInFirstDayOf21Test.
@Test
public void createRolesInFirstDayOf21Test() {
BillBean billBean = new BillBean();
billBean.create();
final GregorianCalendar calendar = new GregorianCalendar(2012, 8, 1);
billBean.setCreationDate(calendar.getTime());
billBean.createBreakDown();
for (BillBreakDown billBreakDown : billBean.getBill().getBreakDown()) {
assertEquals(IVA21, billBreakDown.getIva());
}
}
use of com.autentia.tnt.businessobject.BillBreakDown in project TNTConcept by autentia.
the class BillManager method convertFromOfferCostsToBillBreakDowns.
private Set<BillBreakDown> convertFromOfferCostsToBillBreakDowns(final Bill bill, final Set<OfferCost> offerCosts) {
final Set<BillBreakDown> billBreakDowns = new LinkedHashSet<BillBreakDown>();
if (offerCosts != null) {
for (OfferCost cost : offerCosts) {
if (cost.isBillable()) {
BillBreakDown billBreakDown = new BillBreakDown();
billBreakDown.setConcept(cost.getName());
billBreakDown.setUnits(cost.getUnits());
billBreakDown.setAmount(cost.getCost());
billBreakDown.setIva(cost.getIva());
billBreakDown.setBill(bill);
billBreakDowns.add(billBreakDown);
}
}
}
return billBreakDowns;
}
Aggregations