Examples of TrPosition


Examples of org.jabusuite.transaction.position.TrPosition

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent e) {
                if (e.getActionCommand().equals(JbsDialogWindowOKCancel.ACTION_OK)) {
                    TrPosition parentPosition = null;
                    if ((parentNode != null) && (parentNode instanceof TrPositionTreeNode)) {
                        parentPosition = ((TrPositionTreeNode) parentNode).getPosition();
                    }

                    Article selectedArticle = (Article) fmArticleList.getSelectedJbsObject();
View Full Code Here

Examples of org.jabusuite.transaction.position.TrPosition

                        logger.debug("Position edited: " + getSelectedPosition().getPosNumber());
                        tblPositions.nodeChanged(tblPositions.getSelectedNode());

                        Iterator<TrPosition> it = getTransaction().getPositions().iterator();
                        while (it.hasNext()) {
                            TrPosition position = it.next();
                            if (position instanceof NormalPosition) {
                                logger.debug(((NormalPosition)position).getPosNumber()+": "+((NormalPosition)position).getSalesPrice()+" "+((NormalPosition)position).getSalesPriceSum());
                            }
                        }
View Full Code Here

Examples of org.jabusuite.transaction.position.TrPosition

                public void actionPerformed(ActionEvent arg0) {
                    if (arg0.getActionCommand() == JbsOptionPane.YES_OPTION) {
                        if (logger.isDebugEnabled()) {
                            logger.debug("Deleting position " + node.getPosition().getId());
                        }
                        TrPosition position = node.getPosition();
                        DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) node.getParent();
                        node.removeFromParent();
                        if (position.getParentPosition() != null) {
                            position.getParentPosition().removePosition(position);
                            //position.getParentPosition().getSubPositions().remove(position);
                        } else {
                            getTransaction().removePosition(position);
                            //getTransaction().getPositions().remove(position);
                        }
View Full Code Here

Examples of org.jabusuite.transaction.position.TrPosition

    protected void addLines(List<TrPosition> positions, ArrayList<HashMap> posLines) {
        HashMap posLine;
        Iterator<TrPosition> it = positions.iterator();
        int counter = 0;
        while (it.hasNext()) {
            TrPosition position = it.next();
            posLine = new HashMap();
            posLine.put("position.type", this.getPositionType(position));
            String hs = "";
            if (position instanceof NormalPosition) {
                hs = ClientGlobals.getPriceFormat().format(((NormalPosition) position).getQuantity());
            }
            posLine.put("position.quantity", hs);
           
            hs="";
            if ((position instanceof NormalPosition) && (((NormalPosition)position).getQtyUnit()!=null)) {
                hs = ((NormalPosition)position).getQtyUnit().getShortName(ClientGlobals.getMainDbLanguage());
            }
            posLine.put("position.qtyUnit", hs);
               
            posLine.put("position.posNumber", position.getPosNumber());
            hs="";
            if ((position instanceof ArticlePosition) && (((ArticlePosition)position).getArticle()!=null)) {
                hs=((ArticlePosition)position).getArticle().getUserNo();
            }
            posLine.put("position.artNo", hs);
            posLine.put("position.shortText", position.getShortText(ClientGlobals.getMainDbLanguage()));
            posLine.put("position.longText", this.cleanupHTML(position.getLongText(ClientGlobals.getMainDbLanguage())));

            hs = "";
            if (position instanceof NormalPosition) {
                hs = ClientGlobals.getPriceFormat().format(((NormalPosition) position).getPieceSalesPrice());
            } else if (position instanceof DiscountPosition) {
                hs = ClientGlobals.getPriceFormat().format(((DiscountPosition) position).getPercentValue()) + " %";
            }
            if (this.isAllNegative())
                hs="-"+hs;
            posLine.put("position.pieceSalesPrice", hs);
            hs = "";
            if (position instanceof NormalPosition) {
                hs = ClientGlobals.getPriceFormat().format(((NormalPosition) position).getSalesPrice());
            } else if (position instanceof DiscountPosition) {
                hs = ClientGlobals.getPriceFormat().format(((DiscountPosition) position).getValue());
            }
            if (this.isAllNegative())
                hs="-"+hs;
            posLine.put("position.salesPrice", hs);
            posLines.add(posLine);

            if (position.getSubPositions() != null) {
                this.addLines(position.getSubPositions(), posLines);
            }
           
            hs="";
            if ((position instanceof NormalPosition) && (((NormalPosition)position).getQtyUnit()!=null)) {
                hs=((NormalPosition)position).getQtyUnit().getShortName(ClientGlobals.getMainDbLanguage());
            }
            posLine.put("position.qtyUnit", hs);
           
            //Add an additional line for the group-sum:
            if (position instanceof GroupPosition) {
                posLine = new HashMap();
                posLine.put("position.type", POS_GROUPSUM);
                posLine.put("position.quantity", "");
                posLine.put("position.posNumber", "");
                posLine.put("position.shortText", "Summe " + position.getShortText(ClientGlobals.getMainDbLanguage()));
                posLine.put("position.pieceSalesPrice", "");
                hs = ClientGlobals.getPriceFormat().format(((GroupPosition) position).getSalesPriceSum());
                if (this.isAllNegative())
                    hs="-"+hs;
                posLine.put("position.salesPrice", hs);
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.