Package org.jabusuite.transaction

Examples of org.jabusuite.transaction.Invoice


        logger.debug("Creating dunnings");

        ArrayList<Dunning> createdDunnings = new ArrayList<Dunning>();
        Iterator<Invoice> it = invoices.iterator();
        while (it.hasNext()) {
            Invoice invoice = it.next();

            //Try to get the dunning-group from the customer of the invoice:
            DunningGroup dunningGroup = null;
            if ((invoice.getAddress() != null) && (invoice.getAddress() instanceof Customer)) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Looking for dunning group of customer " + invoice.getAddress().getId());
                }
                dunningGroup = ((Customer) invoice.getAddress()).getDunningGroup();
            }

            //If no customer-dunning-group was found use the default dunning-group
            if (dunningGroup == null) {
                if (logger.isDebugEnabled()) {
View Full Code Here


        }
        return false;
    }
   
    protected void updateInvoice(CreditNote creditNote, JbsUser user) throws EJbsObject {
        Invoice invoice = creditNote.getInvoice();
        if (invoice!=null) {
            if (!this.invoiceHasCreditNote(invoice, creditNote))
                invoice.addCreditNote(creditNote);
            invoice.calcCreditNoteSum();
            invoiceManager.updateDataset(invoice, user);
        }
    }
View Full Code Here

        logger.debug("Looking for invoice " + id);
        return this.findDataset(id, false);
    }

    public Invoice findDataset(long id, boolean withAdditionalData) {
        Invoice invoice = (Invoice) super.findDataset(manager, Invoice.class, id, withAdditionalData);
        if ((withAdditionalData) && (invoice != null)) {
            //retrieve the amount of payments just to make sure that they are fetched now:
            int paymentCount = invoice.getPayments().size();
            logger.debug("Positions: " + paymentCount);
        }
        return invoice;
    }
View Full Code Here

        if (logger.isDebugEnabled()) {
            logger.debug("Saving invoice " + invoice.getId());
            logger.debug("Looking for existing invoice " + invoice.getId());
        }
       
        Invoice existingInvoice = manager.find(Invoice.class, invoice.getId());

        if (logger.isDebugEnabled()) {
            logger.debug("Position-Count: " + existingInvoice.getPayments().size());
            logger.debug("Deleting positions that no longer exist.");
        }

        this.deleteOldPayments(manager, invoice, existingInvoice.getPayments());
       
        invoice.calcPaymentSum();
        invoice.calcLastPaymentDate();
        super.updateDataset(manager, invoice, changeUser);
    }
View Full Code Here

            Component component = null;

            TblInvoicesForDunning tblInvoices = (TblInvoicesForDunning) table;
            final boolean selectable = tblInvoices.isSelectable();
            final TblMInvoicesForDunning tableModel = (TblMInvoicesForDunning)tblInvoices.getModel();
            final Invoice invoice = (Invoice) tblInvoices.getJbsBaseObjects().get(row);

            switch (column) {
                case 0:
                    if (selectable) {
                        final CheckBox checkBox = new CheckBox("");
View Full Code Here

            InvoicesRemote invoices = (InvoicesRemote) ClientTools.getRemoteBean(InvoicesRemote.class);
            List invoiceList = invoices.getInvoicesForDunning(1, 7, ClientGlobals.getUser(), ClientGlobals.getCompany(), 0, 0);

            Iterator it = invoiceList.iterator();
            while (it.hasNext()) {
                Invoice invoice = (Invoice) it.next();
                logger.debug(invoice.getUserNumber());
            }

        } catch (NamingException e) {
            logger.error("Error getting invoices for dunning.", e);
        }
View Full Code Here

     * Creates the panel in insert-mode and creates a new instance of <code>Offer</code> to work with.
     *
     */
    public PnInvoiceEdit() {
        super();
        this.setInvoice(new Invoice());
    }
View Full Code Here

        this.setInvoice(new Invoice());
    }

    @Override
    public void setJbsBaseObject(JbsBaseObject jbsBaseObject) {
        Invoice invoice = (Invoice) jbsBaseObject;
        //We have to get the positions from the database also
        if ((invoice != null) && (this.getDlgState() == DlgState.dsEdit)) {
            logger.debug("Retrieving positions for invoice " + invoice.getId());
            try {
                InvoicesRemote invoices = (InvoicesRemote) ClientTools.getRemoteBean(InvoicesRemote.class);
                Invoice existingInvoice = invoices.findDataset(invoice.getId(), true);
                invoice = existingInvoice;
            } catch (NamingException e) {
                logger.error("Error retrieving offer.", e);
            }
        }
View Full Code Here

    /* (non-Javadoc)
     * @see org.jabusuite.webclient.dataediting.FmEditJbsBaseObject#createJbsBaseObject()
     */
    @Override
    public void createJbsBaseObject() {
        this.setJbsBaseObject(new Invoice());
    }
View Full Code Here

            return 4;
        }

        public Object getValueAt(int column, int row) {
            if (row < getJbsObjects().size()) {
                Invoice invoice = (Invoice)getJbsBaseObjects().get(row);
                switch (column) {
                    case 0:
                        String userNo = invoice.getUserNumber();
                        if (userNo == null) {
                            userNo = "";
                        }
                        return userNo;
                    case 1:
                        String name1 = invoice.getName1();
                        if (name1 == null) {
                            name1 = "";
                        }
                        return name1;
                    case 2:
                        return ClientGlobals.getPriceFormat().format(invoice.getSalesPriceSum());
                    case 3:
                        return ClientGlobals.getPriceFormat().format(invoice.getAmountToPay());
                    default:
                        return "";
                }
            } else {
                return null;
View Full Code Here

TOP

Related Classes of org.jabusuite.transaction.Invoice

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.