use of com.autentia.tnt.businessobject.Bill in project TNTConcept by autentia.
the class BillManager method convertFromOfferToBill.
public Bill convertFromOfferToBill(final Offer offer) {
final Bill bill = new Bill();
// simple values
bill.setContact(offer.getContact());
bill.setName(offer.getDescription());
bill.setState(BillState.EMITTED);
bill.setBillType(BillType.ISSUED);
// concepts
final Set<BillBreakDown> billBreakDowns = new LinkedHashSet<BillBreakDown>();
billBreakDowns.addAll(convertFromOfferCostsToBillBreakDowns(bill, offer.getCosts()));
billBreakDowns.addAll(convertFromOfferRolesToBillBreakDowns(bill, offer.getRoles()));
bill.setBreakDown(billBreakDowns);
return bill;
}
use of com.autentia.tnt.businessobject.Bill in project TNTConcept by autentia.
the class BillBeanTest method initTest.
@Before
public void initTest() throws Exception {
billBean = new BillBean();
billBean.create();
Bill bill = new Bill();
billBean.setBill(bill);
billBean.setSelectedOrganization(org);
reset(projectManager);
}
use of com.autentia.tnt.businessobject.Bill in project TNTConcept by autentia.
the class OfferBean method convertFromOfferToBill.
public String convertFromOfferToBill() {
final Bill bill = billManager.convertFromOfferToBill(offer);
final BillBean billBean = (BillBean) FacesUtils.getBean("billBean");
billBean.setBill(bill);
return "editBill";
}
use of com.autentia.tnt.businessobject.Bill in project TNTConcept by autentia.
the class FromOfferToBillTest method testConversionWithOfferCosts.
/**
* Comprobacion de que se haga la conversion guardando con costes materiales
*/
@Test
public void testConversionWithOfferCosts() {
final BillManager billManager = (BillManager) SpringUtilsForTesting.getSpringBean("managerBill");
final BillDAO billDAO = (BillDAO) SpringUtilsForTesting.getSpringBean("daoBill");
insertInitialData();
insertOfferCosts();
Bill bill = billManager.convertFromOfferToBill(offer);
// esto deberia hacerlo el usuario a traves de la página
bill = insertDataByUserInWeb(bill);
billDAO.insert(bill);
if (bill.getTotal().floatValue() != 5800) {
fail("el total de la factura deberia ser de '5800', pero ha recuperado '" + bill.getTotal() + "'");
}
}
use of com.autentia.tnt.businessobject.Bill in project TNTConcept by autentia.
the class FromOfferToBillTest method testConversionWithRolesCosts.
/**
* Comprobacion de que se haga la conversion guardando con costes derivados del uso de personal
*/
@Test
public void testConversionWithRolesCosts() {
final BillManager billManager = (BillManager) SpringUtilsForTesting.getSpringBean("managerBill");
final BillDAO billDAO = (BillDAO) SpringUtilsForTesting.getSpringBean("daoBill");
insertInitialData();
insertOfferRoles();
Bill bill = billManager.convertFromOfferToBill(offer);
// esto deberia hacerlo el usuario a traves de la página
bill = insertDataByUserInWeb(bill);
billDAO.insert(bill);
if (bill.getTotal().floatValue() != 1218) {
fail("el total de la factura deberia ser de '1218', pero ha recuperado '" + bill.getTotal() + "'");
}
}
Aggregations