Package Utils

Examples of Utils.Transaction


    {
        if(Validate())
        {
            try
            {
                cpcCard.addTransaction(new Transaction(Transaction.ID_NOT_SET, Double.parseDouble(cpcCard.getAmount().trim().replace(',', '.')), cpcCard.getPurpose(), DateTool.getDate(cpcCard.getDate())));
            }
            catch(ParseException e1){}
            cpcCard.ClearTransactionBlock();
         //   cpcCard.ReloadReasons();
        }
View Full Code Here


        {
            Card crdTemp=enCards.nextElement();
            Enumeration<Transaction> enTrans =crdTemp.getAllTransactions();
            while(enTrans.hasMoreElements())
            {
                Transaction tmpTrans=enTrans.nextElement();
                if((tmpTrans.getDate().before(dtBegin))||((tmpTrans.getDate().after(dtEnd))))
                    continue;
                for(int i=mitTimer.getIterationNumber(); mitTimer.hasNext(); mitTimer.next())
                {
                    i=mitTimer.getIterationNumber();
                    if(mitTimer.isInCurrentMonth(tmpTrans.getDate()))
                    {
                        for(int k=0; k<strGroups.length; k++)
                        {
                            if(strGroups[k].equals(mwcMain.getProfile().getReasons().get(tmpTrans.strReason.trim().toLowerCase())))
                                dblMonthSpent[k][i]-=tmpTrans.amount;
                        }
                    }
                }
                mitTimer.reset();
                for(int i=0; i<strGroups.length; i++)
                {
                    if(tmpTrans.amount>0)
                        continue;
                    if(strGroups[i].equals(mwcMain.getProfile().getReasons().get(tmpTrans.strReason.trim().toLowerCase())))
                        dblValues[i]+=tmpTrans.amount;
                }
                if(tmpTrans.amount<0)
                    dblTotal-=tmpTrans.amount;
            }
        }
        //circular diagram 0 tab
        jtpAnalisys.addTab("Resourse distribution", new CircularDiagram(strGroups, dblValues));
        //jtpAnalisys.setToolTipTextAt(0, "Resourse distribution");
        //fill the dates
        String[] strDates=new String[mitTimer.getIterationCount()];
        for(Date t=mitTimer.getDateOfIteration(); mitTimer.hasNext(); mitTimer.next())
            strDates[mitTimer.getIterationNumber()]=DateTool.getDateStr(mitTimer.getDateOfIteration(), "MM.yyyy");
        mitTimer.reset();
        //Calculade all data
        enCards=mwcMain.getProfile().getCards();
        int intCardPointer=mwcMain.getProfile().getCardNumber()-1;
        double dblMonthBalance;
        while(enCards.hasMoreElements())
        {
            Card crdTemp=enCards.nextElement();
            strCardNames[intCardPointer]=crdTemp.getName();
            dblMonthBalance=crdTemp.getInitialBalance();
            while(mitTimer.hasNext())
            {
               
                Enumeration<Transaction> enTranCr=crdTemp.getAllTransactions();
                while(enTranCr.hasMoreElements())
                {
                    Transaction trans=enTranCr.nextElement();
                    if(mitTimer.isInCurrentMonth(trans.getDate()))
                    {
                        dblMonthBalance+=trans.amount;
                    }
                }
                dblCardRemainings[intCardPointer][mitTimer.getIterationNumber()]=dblMonthBalance;
View Full Code Here

TOP

Related Classes of Utils.Transaction

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.