Examples of Bill


Examples of gov.nysenate.openleg.model.Bill

*/
public class BillTests
{
    public static void isBillInitiallyNull(Storage storage, String billKey)
    {
        Bill bill = TestHelper.getBill(storage, billKey);
        assertThat(bill, nullValue());
    }
View Full Code Here

Examples of org.internna.ossmoney.model.Bill

      createBill(period, description, amount, due, payee, locale.split("_"), subcategory);
      return dashboard.index(modelMap);
    }

    protected void createBill(RECURRING_INTERVAL period, String description, Double amount, Date due, Long payee, String[] locale, Long subcategory) {
      Bill bill = new Bill();
      bill.setPeriod(period);
      bill.setAmount(amount);
      bill.setLastTrigger(due);
      bill.setDescription(description);
      bill.setPayee(Payee.findPayee(payee));
      bill.setOwner(UserDetails.findCurrentUser());
      bill.setCurrency(new Locale(locale[0], locale[1], ""));
      bill.setCategory(Subcategory.findSubcategory(subcategory));
      bill.persist();
    }
View Full Code Here

Examples of org.internna.ossmoney.model.Bill

    }

    @RequestMapping("/pay/{id}")
    public String pay(@PathVariable Long id, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      Bill bill = Bill.findBill(id);
      if (bill.belongsTo(user)) {
        modelMap.addAttribute("bill", bill);
        modelMap.addAttribute("origin", user.getBankAccounts(bill.getCurrency()));
        modelMap.addAttribute("currency", Currency.getInstance(bill.getCurrency()).getCurrencyCode());
      }
      return "bills/pay";
    }
View Full Code Here

Examples of org.internna.ossmoney.model.Bill

    }

    @RequestMapping(value = "/pay", method = RequestMethod.POST)
    public String pay(Long id, Long origin, Double amount, Date operationDate, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      Bill bill = Bill.findBill(id);
      if (bill.belongsTo(user)) {
        accountService.payBill(user, bill, origin, amount, operationDate);
      }
      return dashboard.index(modelMap);
    }
View Full Code Here

Examples of org.internna.ossmoney.model.Bill

    }

    @Test
    public void testPayBill() {
      UserDetails user = UserDetails.findCurrentUser();
      Bill bill = new Bill();
      bill.setOwner(user);
      bill.setAmount(100D);
      bill.setCurrency(Locale.US);
      bill.setLastTrigger(new Date());
      bill.setPayee(Payee.findMySelf(user));
      bill.setPeriod(RECURRING_INTERVAL.MONTHLY);
      bill.setCategory(Subcategory.findSubcategory(1L));
      bill.setDescription("a bill");
      bill.persist();
      Account account = Account.findAccount(3L);
      int transactions = account.getTransactions().size();
      accountService.payBill(user, bill, 3L, 101D, new Date());
      assertNotNull("Bill updated", bill.getLastPayment());
      assertTrue("Transaction created", (transactions + 1) == account.getTransactions().size());
    }
View Full Code Here

Examples of org.plugtree.training.billing.model.Bill

        List<Procedure> procedures = new ArrayList<Procedure>();
        procedures.add(this.createProcedure(admission, "8080", 1));
        procedures.add(this.createProcedure(admission, "8080", 1));

        Bill bill = this.createBill(admission, discharge, "", procedures);

        StatefulKnowledgeSession ksession = this.createKSession();

        List<String> errors = new ArrayList<String>();
        ksession.setGlobal("errors", errors);

        ksession.insert(bill);

        for (Procedure procedure : bill.getProcedures()) {
            ksession.insert(procedure);
        }

        ksession.fireAllRules();
View Full Code Here

Examples of org.plugtree.training.billing.model.Bill

    private Bill createBill(BaseDateTime admissionDate, BaseDateTime dischargeDate, String dischargeReason, List<Procedure> procedures) {
        return this.createBill(new Date(admissionDate.getMillis()), new Date(dischargeDate.getMillis()), dischargeReason, procedures);
    }

    private Bill createBill(Date admissionDate, Date dischargeDate, String dischargeReason, List<Procedure> procedures) {
        Bill p = new Bill();
        p.setAdmissionDate(admissionDate);
        p.setDischargeDate(dischargeDate);
        p.setDischargeReason(dischargeReason);
        p.setProcedures(procedures);

        return p;
    }
View Full Code Here

Examples of pojo.Bill

  }

  //get bill info by idBill
  public Bill getBillInfo(int idBill) {
    logger.debug("getBillInfo by idBill start");
    Bill bill = null;
    Session session = HibernateUtil.getSessionFactory().openSession();
    try {
      bill = (Bill) session.get(Bill.class, idBill);
      logger.debug("getBillInfo by idBill success");
    } catch (HibernateException ex) {
View Full Code Here

Examples of pojo.Bill

  //delete Bill
  public boolean delBill(int idBill) {
    logger.debug("delBill start");
    Session session = HibernateUtil.getSessionFactory().openSession();
    Bill bill = (Bill) session.get(Bill.class, idBill);
    if (bill == null) {
      return false;
    }
    Transaction transaction = null;
    try {
View Full Code Here

Examples of pojo.Bill

  //update Bill
  public boolean updateBill(Integer idBill, Integer idstatus) {
    logger.debug("updateBill start");
    Session session = HibernateUtil.getSessionFactory().openSession();
    Bill bill = (Bill) session.get(Bill.class, idBill);
    session.save(bill);
    session.close();
    if (bill == null) {
      return false;
    }
    session = HibernateUtil.getSessionFactory().openSession();
    bill.getDeliverstatus().setIdstatus(idstatus);
    Transaction transaction = null;
    try {
      transaction = session.beginTransaction();
      session.saveOrUpdate(bill);
      transaction.commit();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.