Package com.finiac.model

Examples of com.finiac.model.Bill


  {
  //  final DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
        final Calendar c = Calendar.getInstance();
        long billId;
        int month;
        Bill bill1 = new Bill();
        Sales sales= new Sales();
        String dateInFormat;
        month=c.get(Calendar.MONTH)+1;
        if(month<10)
          dateInFormat="0"+month+"/";
        else
          dateInFormat=month+"/";
        if(c.get(Calendar.DAY_OF_MONTH)<10) // value of month starts fro        
          dateInFormat+="0"+c.get(Calendar.DAY_OF_MONTH)+"/";
        else
          dateInFormat+=c.get(Calendar.DAY_OF_MONTH)+"/";
       
      dateInFormat+= c.get(Calendar.YEAR);
      if(request.getSession().getAttribute("billId")!=null)
      {
        float amount=0;
        billId=Long.parseLong(request.getSession().getAttribute("billId").toString());
        System.out.println("control in " +billId);
        List<Sales> salesList= salesDAO.selectByBillId(billId);
        for(int i=0;i<salesList.size();i++)
      {
        sales = salesList.get(i);
        amount+=sales.getTotal();
     
        bill1=billDAO.selectBill(billId);
        bill1.setAmount(amount);
        billDAO.updateBill(bill1);
      }
    Bill bill= new Bill(0, dateInFormat);
    billId= billDAO.createBill(bill);
    request.getSession().setAttribute("billId", billId);
    return new ModelAndView("redirect:listBill.htm");
  }
View Full Code Here


        stockAlertLimit = stockAlertSettingsDAO.getSettings();
      }
        if(product.getQtyAvail()< Float.parseFloat(stockAlertLimit.getValue()))
          stockAlertString="stockAlert="+temp;   
      billId= Long.parseLong(request.getSession().getAttribute("billId").toString());
      Bill bill = new Bill();
      bill= billDAO.selectBill(billId);
      Sales sales= new Sales(product, qtySold, total,bill ,1); //Sales(Product productId, float qtySold, float total, long billId , int isActive)
      salesDAO.newSalesEntry(sales)
      return new ModelAndView("redirect:listBill.htm?"+stockAlertString);
    }
View Full Code Here

    if(request.getSession().getAttribute("billId")!=null// to update total field of bill table of request is comming
      {    System.out.println("control in ");                       // from add new list;
        float amt=0;
        long billId;
        Sales sales= new Sales();
        Bill bill1= new Bill();
        billId=Long.parseLong(request.getSession().getAttribute("billId").toString());
        System.out.println("control in " +billId);
        List<Sales> salesList= salesDAO.selectByBillId(billId);
        for(int i=0;i<salesList.size();i++)
      {
        sales = salesList.get(i);
        amt+=sales.getTotal();
     
        bill1=billDAO.selectBill(billId);
        bill1.setAmount(amt);
        billDAO.updateBill(bill1);
      }
    ModelMap modelMap = new ModelMap();
    modelMap.addAttribute("items", partialPaymentDAO.listAll());
    modelMap.addAttribute("partialPay", new PartialPayment());
View Full Code Here

  {
    long billNo =Long.parseLong(request.getParameter("billNo"));
    long admissionNo=Long.parseLong(request.getParameter("admissionNo"));
    float amount = Long.parseLong(request.getParameter("amount"));
    float balanceAmt;
    Bill bill= new Bill();
    Student student= new Student();
    bill=billDAO.selectBill(billNo);
    student=studentDAO.selectByAdmissionNo(admissionNo);
    balanceAmt=bill.getAmount()-amount;
    PartialPayment pay = new PartialPayment(student, bill, balanceAmt);
    partialPaymentDAO.addDetails(pay);
    return new ModelAndView("redirect:listPartialPay.htm");
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public long createBill(Bill bill)
  {
    hibernateTemplate.save(bill);
    Bill lastBill = new Bill();
    List<Bill> billList = hibernateTemplate.find("from Bill where id = (select max(id) from Bill)");
    for(int i=0;i<billList.size();i++)
    {
      lastBill = billList.get(i);
    }
    return lastBill.getId();
   
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public long lastBillId()
  {
    Bill lastBill = new Bill();
    List<Bill> billList = hibernateTemplate.find("from Bill where id = (select max(id) from Bill)");
    for(int i=0;i<billList.size();i++)
    {
      lastBill = billList.get(i);
    }
    return lastBill.getId();
   
  }
View Full Code Here


  @SuppressWarnings("unchecked")
  @Override
  public Bill selectBill(long id) {
    Bill bill = new Bill();
    List<Bill> billList = hibernateTemplate.find("from Bill where id ="+id);
    for(int i=0;i<billList.size();i++)
    {
      bill = billList.get(i);
    }
View Full Code Here

TOP

Related Classes of com.finiac.model.Bill

Copyright © 2018 www.massapicom. 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.