Examples of HrExpenseLines


Examples of com.centraview.hr.expenses.HrExpenseLines

    this.userID = userID;
    CVDal cvdal = new CVDal(ds);

    try
    {
      HrExpenseLines hrexpenseLines =  expenseFormVO.getHrExpenseLines();

      if (hrexpenseLines != null)
      {
        hrexpenseLines.calculate();
      }

      cvdal.setSql("hr.expense.addexpenseform");
      cvdal.setDate(1,expenseFormVO.getFrom()); //FromDate
      cvdal.setDate(2,expenseFormVO.getTo());   //ToDate
      cvdal.setString(3,expenseFormVO.getNotes());//Note
      cvdal.setInt(4,expenseFormVO.getReportingId()); //ReportingTo
      cvdal.setInt(5,expenseFormVO.getEmployeeId()); //Employee Id
      cvdal.setInt(6,userID); //Owner
      cvdal.setInt(7,userID);//Creator
      cvdal.setInt(8,expenseFormVO.getModifiedBy());//ModifiedBy
      cvdal.setString(9,expenseFormVO.getDescription());//Description

      cvdal.executeUpdate();

      this.expenseFormVO = expenseFormVO;
      expenseFormID  = cvdal.getAutoGeneratedKey();

      this.expenseFormVO.setExpenseFormID(expenseFormID);

      cvdal.clearParameters();

      if (hrexpenseLines != null)
      {
        Set listkey = hrexpenseLines.keySet();
        Iterator it =  listkey.iterator();
        while (it.hasNext())
        {
          Integer str = ( Integer )it.next();
          HrExpenseLineElement ele  = (HrExpenseLineElement)hrexpenseLines.get( str );
          this.addExpenseItem(ele,expenseFormID,userID);
        }
      }   // end if (hrexpenseLines != null)

      InitialContext ic = CVUtility.getInitialContext();
View Full Code Here

Examples of com.centraview.hr.expenses.HrExpenseLines

      Collection col = dl.executeQuery();


      if (col != null)
      {
        HrExpenseLines hrexpenseLines= new HrExpenseLines();
        Iterator it = col.iterator();
        int count = 1;
        while (it.hasNext())
        {
          HashMap hm =(HashMap)it.next();

          Iterator stemp = hm.keySet().iterator();

          Long tmp;

          //LineID
          tmp = (Long)(hm.get("LineID"));
          IntMember     LineId = new IntMember("LineID",tmp.intValue(),'D',"",'T',false,20);

          //ExpenseItemID
          tmp = (Long)(hm.get("ExpenseItemID"));
          IntMember     ItemId = new IntMember("ExpenseItemID",tmp.intValue(),'D',"",'T',false,20);
          //Quantity
          tmp = (Long)(hm.get("Quantity"));
          FloatMember   Quantity = new FloatMember("Quantity",new Float(tmp.floatValue()),'D',"",'T',false,20);
          //Price
          Double doubleTmp = new Double(hm.get("Price").toString());
          FloatMember   PriceEach = new FloatMember("Price",new Float(doubleTmp.floatValue()),'D',"",'T',false,20);

          //priceextended
          doubleTmp = (Double)(hm.get("priceextended"));
          FloatMember   PriceExtended = new FloatMember("PriceExtended",new Float(doubleTmp.floatValue()),'D',"",'T',false,20);

          //project
          Long project =  (Long)(hm.get("Project"));
          IntMember ProjectId = new IntMember("Project",project.intValue(),'D',"",'T',false,20);

          //ticket
          Long ticket =  (Long)(hm.get("Ticket"));
          IntMember TicketId = new IntMember("Ticket",project.intValue(),'D',"",'T',false,20);

          //opportunity
          Long Opportunity =  (Long)(hm.get("Opportunity"));
          IntMember OpportunityId = new IntMember("Opportunity",project.intValue(),'D',"",'T',false,20);

          //sku
          StringMember   SKU = new StringMember("SKU",(String)(hm.get("SKU")),'D',"",'T',false);

          //expenseitem.Description
          StringMember   Description = new StringMember("Description",(String)(hm.get("Description")),'D',"",'T',false);

          IntMember typeID = null;
          IntMember ReferenceID = null;

          if((project.intValue()) != 0)
          {
             typeID = new IntMember("TypeId", 2 ,'D',"",'T',false,20);
             ReferenceID = new IntMember("ReferenceID",project.intValue(),'D',"",'T',false,20);
          }
          else if ((ticket.intValue()) !=0)
          {
             typeID = new IntMember("TypeId", 1 ,'D',"",'T',false,20);
             ReferenceID = new IntMember("ReferenceID",ticket.intValue(),'D',"",'T',false,20);
          }
          else if ((Opportunity.intValue()) != 0)
          {
             typeID = new IntMember("TypeId", 3 ,'D',"",'T',false,20);
             ReferenceID = new IntMember("ReferenceID",Opportunity.intValue(),'D',"",'T',false,20);
          }
          else
          {
             typeID = new IntMember("TypeId", 4 ,'D',"",'T',false,20);
             ReferenceID = new IntMember("ReferenceID",0,'D',"",'T',false,20);
          }


          //ExpenseFormID
          Integer expenseformid =  (Integer)(hm.get("ExpenseFormID"));
          IntMember ExpenseFormID = new IntMember("ExpenseFormID",expenseformid.intValue(),'D',"",'T',false,20);

          //ExpenseID
          Long expenseid =  (Long)(hm.get("ExpenseID"));
          IntMember ExpenseID = new IntMember("ExpenseID",expenseid.intValue(),'D',"",'T',false,20);

          //referenceId
          //Long referenceid =  (Long)(hm.get("ReferenceId"));
          //IntMember ReferenceID = new IntMember("ReferenceID",referenceid.intValue(),'D',"",'T',false,20);



          //expense.Description reference
          StringMember   reference = new StringMember("reference",(String)(hm.get("reference")),'D',"",'T',false);

          //Amount
          Double amount = new Double(hm.get("Amount").toString());
          FloatMember Amount = new FloatMember("Amount",new Float(amount.floatValue()),'D',"",'T',false,20);


          HrExpenseLineElement ie = new HrExpenseLineElement(11);
          ie.put ("LineId",LineId);
          ie.put ("ExpenseFormID",ExpenseFormID);
          ie.put ("ExpenseID",ExpenseID);
          ie.put ("ExpenseItemID",ItemId);
          ie.put ("SKU",SKU);
          ie.put ("Description",Description);
          ie.put ("Reference",reference);
          ie.put ("Quantity",Quantity);
          ie.put ("PriceEach",PriceEach);
          ie.put ("ReferenceType",typeID);
          ie.put ("ReferenceId",ReferenceID);
          ie.put ("PriceExtended",PriceExtended);
          ie.put ("Amount",Amount);
          ie.setLineStatus((String)(hm.get("linestatus")));


          //ie.put ("UnitTax",UnitTax);
          //ie.put ("UnitTaxrate",TaxRate);
          //ie.put ("OrderQuantity",OrderQuantity);
          //ie.put ("PendingQuantity",PendingQuantity);

          //cw hrexpenseLines.put(""+count,ie);
          hrexpenseLines.put(new Integer(count),ie);
          count ++;
        }
        this.expenseFormVO.setHrExpenseLines(hrexpenseLines);
      }// end of if
    }
View Full Code Here

Examples of com.centraview.hr.expenses.HrExpenseLines

    if (isDirty)
    {
      CVDal dl = new CVDal(this.dataSource);
      try
      {
        HrExpenseLines itemLines =  expenseFormVO.getHrExpenseLines();
        itemLines.calculate();

        //ALLSQL.put("hr.expense.updateexpenseform","update expenseform set FromDate = ?,ToDate = ?,Note = ?,Description = ?,ReportingTo = ?,Owner = ?,Creator = ? ,ModifiedBy = ?,created = CONCAT(CURRENT_DATE), Modified =CONCAT(CURRENT_DATE) where expenseformid = ?");
        dl.setSql("hr.expense.updateexpenseform");


        dl.setDate(1,expenseFormVO.getFrom());//fromdate
        dl.setDate(2,expenseFormVO.getTo());//todate
        dl.setString(3,expenseFormVO.getNotes());//note
        dl.setString(4,expenseFormVO.getDescription());//description
        dl.setInt(5,expenseFormVO.getReportingId());//reportingto
        dl.setInt(6,expenseFormVO.getEmployeeId());//EmployeeId
        dl.setInt(7,expenseFormVO.getModifiedBy());//modifiedby
        dl.setString(8,expenseFormVO.getStatus());//status
        dl.setInt(9,expenseFormVO.getExpenseFormID());//modifiedby
        dl.executeUpdate();
        dl.clearParameters();

        //Insert,Update Order Lines. as per status.

        Set listkey = itemLines.keySet();
        Iterator it =  listkey.iterator();
        while (it.hasNext())
        {
          //Object str = ( Object)it.next();
          Integer str = ( Integer)it.next();
          HrExpenseLineElement ele  = ( HrExpenseLineElement)itemLines.get( str );
          String status    = ele.getLineStatus();

          if(status == null)
            status = "";
          status = status.trim();
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.