Package com.centraview.account.accountfacade

Examples of com.centraview.account.accountfacade.AccountFacadeLocal


        */
       public ArrayList getInvoices(HashMap params,int indId)
       {
         InvoiceVO invoiceVO = null;
         ArrayList invoices = new ArrayList();
         AccountFacadeLocal invoiceL = null;

         try
         {
           String syncDatePrKeyField[] = {""};
           Timestamp lastSyncDate = (Timestamp)params.get("lastSyncDate");
           String operation = (String)params.get("Operation");
           InitialContext ic = CVUtility.getInitialContext();
           AccountFacadeLocalHome home = (AccountFacadeLocalHome)ic.lookup("local/AccountFacade");
           invoiceL = home.create();
           invoiceL.setDataSource(this.dataSource);

           Collection col = getList("InvoiceHistory",lastSyncDate,operation,syncDatePrKeyField);
           Object ids[] = col.toArray();
           HashMap hm = new HashMap();
           int size = ids.length;

           for(int i=0;i<size;i++)
           {
             hm = (HashMap)ids[i];
             invoiceVO = invoiceL.getInvoiceVO(((Long)hm.get(syncDatePrKeyField[0])).intValue(),indId);
             invoices.add(invoiceVO);
           }
         }catch(Exception e)
         {
           logger.debug("Error in getting InvoiceVos : "+e);
View Full Code Here


        * @return boolean status of operation
        */
       public boolean addInvoices(ArrayList IVOs, int indId)
       {
         InvoiceVO ivo = null;
         AccountFacadeLocal invoiceL = null;
         ContactHelperLocal chl = null;

         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           AccountFacadeLocalHome home = (AccountFacadeLocalHome)ic.lookup("local/AccountFacade");
           invoiceL = home.create();
           invoiceL.setDataSource(this.dataSource);

           ContactHelperLocalHome chlh = (ContactHelperLocalHome) ic.lookup("local/ContactHelper");
           chl = chlh.create();

           OrderForm of = new OrderForm();
           int primAddId = 0;

           for ( int i=0;i<IVOs.size();i++)
           {
             ivo = (InvoiceVO) IVOs.get(i);
             if (ivo.getDescription()== null)
               ivo.setDescription("");
             of.setItemLines(ivo.getItemLines());
             of.setCustomerIdValue(ivo.getCustomerId());
             primAddId = ((AddressVO)chl.getPrimaryAddressForContact(indId,ivo.getCustomerId(),1)).getAddressID();

             of.setBillToAddIdValue(primAddId);
             of.setShipToAddIdValue(1);
             of.setOrderDate(ivo.getInvoiceDate());
             of.setInvoiceIsGenerated(true);

             of = invoiceL.createOrder(of,indId);
             ivo.setOrderId(of.getOrderIdValue());
             ivo.setBillToId(primAddId);
             invoiceL.createInvoice(ivo,indId);
             logger.info("Added " +/* ivo.getInvoiceId()*/ 1+ " invoice record");
           }
         }catch(Exception e)
         {
           logger.debug("Error in adding Invoices : "+e);
View Full Code Here

         String extId = "";
         int intId = 0;

         Iterator it = arl.iterator();

         AccountFacadeLocal helperL = null;
         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           AccountFacadeLocalHome home = (AccountFacadeLocalHome ) ic.lookup("local/AccountFacade");
           helperL = home.create();

           while(it.hasNext())
           {
             ivo = (InvoiceVO)it.next();
             extId = ivo.getExternalId();
             intId = this.getCVidForExtid(modulename,extId);
             helperL.deleteInvoice(indId, intId);
             logger.info("Invoice " + intId +" object deleted");
           }

         }catch(Exception e)
         {
View Full Code Here

         String extId = "";
         int intId = 0;

         Iterator it = arl.iterator();

         AccountFacadeLocal helperL = null;
         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           AccountFacadeLocalHome home = (AccountFacadeLocalHome ) ic.lookup("local/AccountFacade");
           helperL = home.create();

           while(it.hasNext())
           {
             ivo = (ItemVO)it.next();
             extId = ivo.getExternalID();
             intId = this.getCVidForExtid(modulename,extId);
             helperL.deleteInvoice(indId, intId);
             logger.info("Item " + intId +" object deleted");
           }

         }catch(Exception e)
         {
View Full Code Here

        */
       public ArrayList getPurchaseOrders(HashMap params, int indId)
       {
         PurchaseOrderVO porderVO= null;
         ArrayList porders = new ArrayList();
         AccountFacadeLocal porderL = null;

         try
         {
           String syncDatePrKeyField[] = {""};
           Timestamp lastSyncDate = (Timestamp)params.get("lastSyncDate");
           String operation = (String)params.get("Operation");
           InitialContext ic = CVUtility.getInitialContext();
           AccountFacadeLocalHome home = (AccountFacadeLocalHome)ic.lookup("local/AccountFacade");
           porderL = home.create();
           porderL.setDataSource(this.dataSource);

           Collection col = getList("PurchaseOrder",lastSyncDate,operation,syncDatePrKeyField);
           Object ids[] = col.toArray();
           HashMap hm = new HashMap();
           int size = ids.length;

           for(int i=0;i<size;i++)
           {
             hm = (HashMap)ids[i];
             porderVO= porderL.getPurchaseOrderVO(((Long)hm.get(syncDatePrKeyField[0])).intValue(),indId);
             porders.add(porderVO);
           }
         }catch(Exception e)
         {
           logger.debug("Error in getting porderVOs : "+e);
View Full Code Here

        * @return boolean status of operation
        */
       public boolean addPurchaseOrders(ArrayList PVOs,int indId)
       {
         PurchaseOrderVO pvo = null;
         AccountFacadeLocal porderL = null;
         ContactHelperLocal chl = null;

         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           AccountFacadeLocalHome home = (AccountFacadeLocalHome)ic.lookup("local/AccountFacade");
           porderL = home.create();
           porderL.setDataSource(this.dataSource);
           ContactHelperLocalHome chlh = (ContactHelperLocalHome) ic.lookup("local/ContactHelper");
           chl = chlh.create();

           int size = PVOs.size();
           int primAddId = 0;

           for ( int i=0;i<size;i++)
           {
             pvo = (PurchaseOrderVO) PVOs.get(i);
             primAddId = ((AddressVO)chl.getPrimaryAddressForContact(indId,pvo.getVendorId() ,1)).getAddressID();
             pvo.setBillToId(primAddId);
             pvo.setShipToId(primAddId);
             pvo = porderL.createPurchaseOrder(pvo,indId);
             logger.info("Added " + pvo.getPurchaseOrderId() + " purchaseorder record");
           }
         }catch(Exception e)
         {
           logger.debug("Error in adding PurchaseOrders : "+e);
View Full Code Here

         String extId = "";
         int intId = 0;

         Iterator it = arl.iterator();

         AccountFacadeLocal helperL = null;
         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           AccountFacadeLocalHome home = (AccountFacadeLocalHome ) ic.lookup("local/AccountFacade");
           helperL = home.create();

           while(it.hasNext())
           {
             ivo = (PurchaseOrderVO)it.next();
             extId = ivo.getExternalID();
             intId = this.getCVidForExtid(modulename,extId);
             helperL.deleteInvoice(indId, intId);
             logger.info("PurchaseOrder " + intId +" object deleted");
           }

         }catch(Exception e)
         {
View Full Code Here

        */
       public ArrayList getExpenses(HashMap params, int indId)
       {
         ExpenseVO EVO = null;
         ArrayList expenses = new ArrayList();
         AccountFacadeLocal expenseL = null;

         try{
           String syncDatePrKeyField[] = {""};
           System.out.println("Getting last sync date");
           Timestamp lastSyncDate = (Timestamp)params.get("lastSyncDate");
           System.out.println("Getting operation");
           String operation = (String)params.get("Operation");
           InitialContext ic = CVUtility.getInitialContext();
           AccountFacadeLocalHome home = (AccountFacadeLocalHome)ic.lookup("local/AccountFacade");
           expenseL = home.create();
           expenseL.setDataSource(this.dataSource);
           System.out.println("Data source setted up");

           Collection col = getList("Expense",lastSyncDate,operation,syncDatePrKeyField);
           System.out.println("Got collection of ids " + col);
           Object ids[] = col.toArray();
           HashMap hm = new HashMap();
           int size = ids.length;
           System.out.println("All transformations done");

           for(int i=0;i<size;i++)
           {
             System.out.println("Taking " + i + " id");
             hm = (HashMap)ids[i];
             System.out.println("HashMap is " + hm);
             EVO = expenseL.getExpenseVO(((Long)hm.get(syncDatePrKeyField[0])).intValue(),indId);
             System.out.println("Successfully got EVO!!");
             expenses.add(EVO);
           }
         }catch(Exception e)
         {
View Full Code Here

        * @return boolean status of operation
        */
       public boolean addExpenses(ArrayList EVOs,int indId)
       {
         ExpenseVO evo = null;
         AccountFacadeLocal expenseL = null;

         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           AccountFacadeLocalHome home = (AccountFacadeLocalHome)ic.lookup("local/AccountFacade");
           expenseL = home.create();
           expenseL.setDataSource(this.dataSource);

           int size = EVOs.size();

           for ( int i=0;i<size;i++)
           {
             evo = (ExpenseVO) EVOs.get(i);
             if (evo.getExpenseDescription() == null){
               evo.setExpenseDescription("");
             }
             evo = expenseL.createExpense(evo,indId);
             logger.info("Added " + evo.getExpenseID() + " expense record");
           }
         }catch(Exception e)
         {
           logger.debug("Error in adding Expenses : "+e);
View Full Code Here

         String extId = "";
         int intId = 0;

         Iterator it = arl.iterator();

         AccountFacadeLocal helperL = null;
         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           AccountFacadeLocalHome home = (AccountFacadeLocalHome ) ic.lookup("local/AccountFacade");
           helperL = home.create();

           while(it.hasNext())
           {
             ivo = (ExpenseVO)it.next();
             extId = ivo.getExternalID();
             intId = this.getCVidForExtid(modulename,extId);
             helperL.deleteInvoice(indId, intId);
             logger.info("Expense " + intId +" object deleted");
           }

         }catch(Exception e)
         {
View Full Code Here

TOP

Related Classes of com.centraview.account.accountfacade.AccountFacadeLocal

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.