Package com.centraview.account.common

Examples of com.centraview.account.common.ItemLines


      dl.setSqlQuery("select * from `invoiceitems` where status != 'Deleted' and InvoiceID = "+this.invoiceVO.getInvoiceId()+";");
      Collection col = dl.executeQuery();

      if (col != null)
      {
        ItemLines itemLines= new ItemLines();
        Iterator it = col.iterator();
        int count = 1;
        while (it.hasNext())
        {
          HashMap hm =(HashMap)it.next();
          int lineID = ((Number)hm.get("InvoiceLineID")).intValue();
          int itemID = ((Number)hm.get("ItemID")).intValue();
          int quantity = ((Number)hm.get("Quantity")).intValue();
          float price = ((Number)hm.get("Price")).floatValue();
          String sku = (String) hm.get("SKU");
          String description = (String) hm.get("Description");
          float taxTotal = ((Number)hm.get("taxAmount")).floatValue();
          String status = (String) hm.get("status");
          float priceExtended = quantity * price;

          IntMember LineId = new IntMember("LineId",lineID,'D',"",'T',false,20);
          IntMember ItemId = new IntMember("ItemId",itemID,'D',"",'T',false,20);
          IntMember Quantity = new IntMember("Quantity",quantity,'D',"",'T',false,20);
          FloatMember  PriceEach = new FloatMember("Price",new Float(price),'D',"",'T',false,20);
          StringMember SKU = new StringMember("SKU",sku,'D',"",'T',false);
          StringMember Description = new StringMember("Description",description,'D',"",'T',false);
          FloatMember  PriceExtended = new FloatMember("PriceExtended",new Float(priceExtended),'D',"",'T',false,20);
          FloatMember  TaxAmount = new FloatMember("TaxAmount",new Float(taxTotal),'D',"",'T',false,20);

          ItemElement ie = new ItemElement(11);
          ie.put ("LineId",LineId);
          ie.put ("ItemId",ItemId);
          ie.put ("Quantity",Quantity);
          ie.put ("Price",PriceEach);
          ie.put ("SKU",SKU);
          ie.put ("Description",Description);
          ie.put ("PriceExtended",PriceExtended);
          ie.put ("TaxAmount",TaxAmount);
          ie.setLineStatus(status);
          itemLines.put(""+count,ie);
          count ++;
        }
        this.invoiceVO.setItemLines(itemLines);
      }// end of if
    }
View Full Code Here


    if (isDirty)
    {
      CVDal dl = new CVDal(this.dataSource);
      try
      {
        ItemLines itemLines =  invoiceVO.getItemLines();
        itemLines.calculate();

        dl.setSql("invoice.updateinvoice");
        dl.setInt(1,this.invoiceVO.getBillToId());//bill address
        dl.setInt(2,this.invoiceVO.getShipToId()); //ship address
        dl.setInt(3,this.invoiceVO.getStatusId());// status
        dl.setString(4,this.invoiceVO.getPo()); // ponumber
        dl.setInt(5,this.invoiceVO.getTermId()); //terms
        dl.setInt(6,this.invoiceVO.getAccountManagerId()); //accountmgr
        dl.setInt(7,this.invoiceVO.getProjectId()); //projectid


        dl.setFloat(8,itemLines.getSubtotal()); // sub total
        dl.setFloat(9,itemLines.getTax()); //tax
        dl.setFloat(10,itemLines.getTotal()); // total


        dl.setString(11,this.invoiceVO.getDescription()); //notes
        dl.setString(12,this.invoiceVO.getExternalId())// externalId
        dl.setInt(13,this.invoiceVO.getModifiedBy()); //modified By
        dl.setInt(14,this.invoiceVO.getInvoiceId()); //Invoice id
        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();
          ItemElement ele  = ( ItemElement)itemLines.get( str );
          String status    = ele.getLineStatus();

          if(status == null)
            status = "";
View Full Code Here

    int purchaseorderID = 0;
    this.dataSource = ds;
    CVDal dl = new CVDal(ds);
    try
    {
      ItemLines itemLines =  purchaseorderVO.getItemLines();
      itemLines.calculate();
      dl.setSql("purchaseorder.addpurchaseorder");
      dl.setInt(1,purchaseorderVO.getBillToId());//billaddress
      dl.setInt(2,purchaseorderVO.getShipToId());//shipaddress
      dl.setInt(3,purchaseorderVO.getStatusId()); // statusid
      dl.setInt(4,purchaseorderVO.getTermId());// termid
      dl.setInt(5,purchaseorderVO.getAccountManagerId()); //accmanager
      dl.setInt(6,userID);
      dl.setDate(7,purchaseorderVO.getPurchaseOrderDate()); // purchaseorderDate DateObject
      dl.setFloat(8,itemLines.getSubtotal()); // sub total
      dl.setFloat(9,itemLines.getTax()); //tax
      dl.setFloat(10,itemLines.getTotal()); // total
      dl.setFloat(11,purchaseorderVO.getVendorId()); // vendor id
      dl.setString(12,purchaseorderVO.getNotes()); //description
      if (purchaseorderVO.getExternalID() != null)
        dl.setString(13,purchaseorderVO.getExternalID());
      else
        dl.setString(13,"0");
      dl.setInt(14,userID); //Owner
      dl.executeUpdate();

      purchaseorderID  = dl.getAutoGeneratedKey();

      this.purchaseorderVO =purchaseorderVO;
      purchaseorderVO.setPurchaseOrderId(purchaseorderID);
      dl.clearParameters();


      Set listkey = itemLines.keySet();
      Iterator it =  listkey.iterator();
      while (it.hasNext())
      {
        Object str = ( Object )it.next();
        ItemElement ele  = ( ItemElement)itemLines.get( str );
        this.addPurchaseOrderItem(ele,purchaseorderID);
      }// end of while

      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
View Full Code Here

      dl.setSqlQuery("select * from `purchaseorderitem` where status != 'Deleted' and purchaseorderid = "+this.purchaseorderVO.getPurchaseOrderId()+";");
      Collection col = dl.executeQuery();

      if (col != null)
      {
        ItemLines itemLines= new ItemLines();
        Iterator it = col.iterator();
        int count = 1;
        while (it.hasNext())
        {
          HashMap hm =(HashMap)it.next();
          int lineID = ((Number)hm.get("purchaseorderlineid")).intValue();
          int itemID = ((Number)hm.get("itemid")).intValue();
          int quantity = ((Number)hm.get("quantity")).intValue();
          float price = ((Number)hm.get("price")).floatValue();
          String sku = (String) hm.get("sku");
          String description = (String) hm.get("description");
          String status = (String) hm.get("status");
          float priceExtended = quantity * price;

          IntMember LineId = new IntMember("LineId",lineID,'D',"",'T',false,20);
          IntMember ItemId = new IntMember("ItemId",itemID,'D',"",'T',false,20);
          IntMember Quantity = new IntMember("Quantity",quantity,'D',"",'T',false,20);
          FloatMember  PriceEach = new FloatMember("Price",new Float(price),'D',"",'T',false,20);
          StringMember SKU = new StringMember("SKU",sku,'D',"",'T',false);
          StringMember Description = new StringMember("Description",description,'D',"",'T',false);
          FloatMember  PriceExtended = new FloatMember("PriceExtended",new Float(priceExtended),'D',"",'T',false,20);

          ItemElement ie = new ItemElement(11);
          ie.put ("LineId",LineId);
          ie.put ("ItemId",ItemId);
          ie.put ("Quantity",Quantity);
          ie.put ("Price",PriceEach);
          ie.put ("SKU",SKU);
          ie.put ("Description",Description);
          ie.put ("PriceExtended",PriceExtended);
          ie.setLineStatus(status);
          itemLines.put(""+count,ie);
          count ++;
        }
        this.purchaseorderVO.setItemLines(itemLines);
      }// end of if
    }
View Full Code Here

    if (isDirty)
    {
      CVDal dl = new CVDal(this.dataSource);
      try
      {
        ItemLines itemLines =  purchaseorderVO.getItemLines();
        itemLines.calculate();

        dl.setSql("purchaseorder.updatepurchaseorder");
        dl.setInt(1,this.purchaseorderVO.getBillToId());//bill address
        dl.setInt(2,this.purchaseorderVO.getShipToId()); //ship address
        dl.setInt(3,this.purchaseorderVO.getStatusId());// status
        dl.setInt(4,this.purchaseorderVO.getTermId()); //terms
        dl.setInt(5,this.purchaseorderVO.getAccountManagerId()); //accountmgr
        dl.setFloat(6,itemLines.getSubtotal()); // sub total
        dl.setFloat(7,itemLines.getTax()); //tax
        dl.setFloat(8,itemLines.getTotal()); // total
        dl.setString(9,this.purchaseorderVO.getNotes()); //notes
        dl.setInt(10,purchaseorderVO.getModifiedBy()); //modified By
        dl.setInt(11,this.purchaseorderVO.getPurchaseOrderId()); //purchase order id
        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();
          ItemElement ele  = ( ItemElement)itemLines.get( str );
          String status    = ele.getLineStatus();

          if(status == null)
            status = "";
          status = status.trim();
View Full Code Here

  /**  Elements for Items ends here**/

  public ExpenseVO()
  {
   itemLines = new ItemLines();
  }
View Full Code Here

    int expenseID = 0;
    this.dataSource = ds;
    CVDal cvdal = new CVDal(ds);
    try
    {
      ItemLines itemLines =  expenseVO.getItemLines();

      itemLines.calculate();
      cvdal.setSql("account.expense.addexpense");
      cvdal.setInt(1,expenseVO.getGlAccountIDValue());
      cvdal.setFloat(2,expenseVO.getAmount());
      cvdal.setString(3,expenseVO.getTitle());
      cvdal.setString(4,expenseVO.getExpenseDescription());
      cvdal.setInt(5,expenseVO.getEntityIDValue());
      cvdal.setInt(6,expenseVO.getStatusIDValue());
      cvdal.setInt(7,userID);
      cvdal.setInt(8,expenseVO.getProjectIDValue());
      cvdal.setInt(9,expenseVO.getOpportunityIDValue());
      cvdal.setInt(10,expenseVO.getSupportTicketIDValue());
      cvdal.setString(11,expenseVO.getNotes());
      cvdal.setString(12,expenseVO.getExternalID());

      cvdal.executeUpdate();
      this.expenseVO = expenseVO;
      expenseID  = cvdal.getAutoGeneratedKey();
      this.expenseVO.setExpenseID(expenseID);

      cvdal.clearParameters();

      Set listkey = itemLines.keySet();
      Iterator it =  listkey.iterator();
      while (it.hasNext())
      {
        Object str = ( Object )it.next();
        ItemElement ele  = ( ItemElement)itemLines.get( str );
        this.addExpenseItem(ele,expenseID);
      }// end of while

      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
View Full Code Here

  {
    int orderID = 0;
    this.dataSource = ds;
    CVDal dl = new CVDal(ds);
    try {
      ItemLines itemLines = orderForm.getItemLines();
      itemLines.calculate();

      dl.setSql("order.addorder");
      // insert into cvorder
      // (entityid,billaddress,shipaddress,status,terms,accountmgr,project,ponumber,creator,orderdate,created,subtotal,tax,total,description,invoiceIsGenerated)
      // values (?,?,?,?,?,?,?,?,?,?,concat(CURRENT_DATE,
      // CURRENT_TIME),?,?,?,?,?)

      dl.setInt(1, orderForm.getCustomerIdValue()); // entityid
      dl.setInt(2, orderForm.getBillToAddIdValue());// billaddress
      dl.setInt(3, orderForm.getShipToAddIdValue());// shipaddress
      dl.setInt(4, orderForm.getStatusIdValue()); // statusid
      dl.setInt(5, orderForm.getTermsIdValue());// termid
      dl.setInt(6, orderForm.getAcctMgrIdValue()); // accmanager
      dl.setInt(7, orderForm.getProjectIdValue()); // project id
      dl.setString(8, orderForm.getPo());// ponumber
      dl.setInt(9, userID);
      dl.setRealDate(10, orderForm.getOrderDate()); // orderDate DateObject

      dl.setFloat(11, itemLines.getSubtotal()); // sub total
      dl.setFloat(12, itemLines.getTax()); // tax
      dl.setFloat(13, itemLines.getTotal()); // total

      dl.setString(14, orderForm.getNotes()); // notes
      if (orderForm.getInvoiceIsGenerated())
        dl.setString(15, "YES");
      else
        dl.setString(15, "NO");
      dl.setInt(16, userID);
      dl.executeUpdate();
      orderID = dl.getAutoGeneratedKey();
      dl.clearParameters();
      this.orderForm = orderForm;
      this.orderForm.setOrderIdValue(orderID);
      Set listkey = itemLines.keySet();
      Iterator it = listkey.iterator();
      while (it.hasNext()) {
        Object str = it.next();
        ItemElement ele = (ItemElement) itemLines.get(str);
        this.addOrderItem(ele, orderID);
      }// end of while

      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome) ic.lookup("local/Authorization");
View Full Code Here

      dl.setSqlQuery("select * from `expenseitem` where LineStatus != 'Deleted' and ExpenseID = "+this.expenseVO.getExpenseID()+";");
      Collection col = dl.executeQuery();

      if (col != null)
      {
        ItemLines itemLines= new ItemLines();
        Iterator it = col.iterator();
        int count = 1;
        while (it.hasNext())
        {
          HashMap hm =(HashMap)it.next();
          int lineID = ((Number)hm.get("LineID")).intValue();
          int itemID = ((Number)hm.get("ExpenseItemID")).intValue();
          int quantity = ((Number)hm.get("Quantity")).intValue();
          float price = ((Number)hm.get("Price")).floatValue();
          String sku = (String) hm.get("SKU");
          String description = (String) hm.get("Description");
          String status = (String) hm.get("LineStatus");
          float priceExtended = quantity * price;

          IntMember LineId = new IntMember("LineId",lineID,'D',"",'T',false,20);
          IntMember ItemId = new IntMember("ItemId",itemID,'D',"",'T',false,20);
          IntMember Quantity = new IntMember("Quantity",quantity,'D',"",'T',false,20);
          FloatMember  PriceEach = new FloatMember("Price",new Float(price),'D',"",'T',false,20);
          StringMember SKU = new StringMember("SKU",sku,'D',"",'T',false);
          StringMember Description = new StringMember("Description",description,'D',"",'T',false);
          FloatMember  PriceExtended = new FloatMember("PriceExtended",new Float(priceExtended),'D',"",'T',false,20);

          ItemElement ie = new ItemElement(11);
          ie.put ("LineId",LineId);
          ie.put ("ItemId",ItemId);
          ie.put ("Quantity",Quantity);
          ie.put ("Price",PriceEach);
          ie.put ("SKU",SKU);
          ie.put ("Description",Description);
          ie.put ("PriceExtended",PriceExtended);
          ie.setLineStatus(status);
          itemLines.put(""+count,ie);
          count ++;
        }
        this.expenseVO.setItemLines(itemLines);
      }// end of if
    }
View Full Code Here

    if (isDirty)
    {
      CVDal dl = new CVDal(dataSource);
      try
      {
        ItemLines itemLines =  expenseVO.getItemLines();
        itemLines.calculate();

        dl.setSql("account.expense.updateexpense");
        //ALLSQL.put("account.expense.updateexpense","update expense set glaccountsid = ?,amount = ?,title = ?,description = ?,entityid = ?,status = ?,created = CONCAT(CURRENT_DATE),owner = ?,project = ?,opportunity = ?,ticket = ? where expenseid = ?");
        dl.setInt(1,expenseVO.getGlAccountIDValue());
        dl.setFloat(2,expenseVO.getAmount());
        dl.setString(3,expenseVO.getTitle());
        dl.setString(4,expenseVO.getExpenseDescription());
        dl.setInt(5,expenseVO.getEntityIDValue());
        dl.setInt(6,expenseVO.getStatusIDValue());
        dl.setInt(7,expenseVO.getEmployeeIDValue());
        dl.setInt(8,expenseVO.getProjectIDValue());
        dl.setInt(9,expenseVO.getOpportunityIDValue());
        dl.setInt(10,expenseVO.getSupportTicketIDValue());
        dl.setString(11,expenseVO.getNotes());
        dl.setInt(12,this.expenseVO.getExpenseID());

        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();
          ItemElement ele  = ( ItemElement)itemLines.get( str );
          String status    = ele.getLineStatus();

          if(status == null)
            status = "";
          status = status.trim();
View Full Code Here

TOP

Related Classes of com.centraview.account.common.ItemLines

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.