Examples of CreditNote


Examples of org.fenixedu.academic.domain.accounting.CreditNote

    }

    public ActionForward changeCreditNoteState(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        final CreditNote creditNote = getCreditNoteFromViewState();
        final CreditNoteState creditNoteState = CreditNoteState.valueOf(((CreditNotesActionForm) form).getCreditNoteState());

        try {
            ChangeCreditNoteState.run(getUserView(request).getPerson(), creditNote, creditNoteState);
View Full Code Here

Examples of org.fenixedu.academic.domain.accounting.CreditNote

        return mapping.findForward("show");

    }

    private CreditNote getCreditNoteFromViewState() {
        final CreditNote creditNote = (CreditNote) RenderUtils.getViewState("creditNote").getMetaObject().getObject();
        return creditNote;
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.accounting.CreditNote

    }

    public ActionForward printCreditNote(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws IOException {

        final CreditNote creditNote = getCreditNoteFromViewState();

        try {

            final CreditNoteDocument original = new CreditNoteDocument(creditNote, getMessageResourceProvider(request), true);
            final CreditNoteDocument duplicate = new CreditNoteDocument(creditNote, getMessageResourceProvider(request), false);

            final byte[] data = ReportsUtils.exportMultipleToPdfAsByteArray(original, duplicate);

            CreditNoteGeneratedDocument.store(creditNote, original.getReportFileName() + ".pdf", data);
            response.setContentLength(data.length);
            response.setContentType("application/pdf");
            response.addHeader("Content-Disposition", String.format("attachment; filename=%s.pdf", original.getReportFileName()));

            response.getOutputStream().write(data);

            return null;

        } catch (DomainException e) {
            addActionMessage(request, e.getKey(), e.getArgs());

            request.setAttribute("creditNoteId", creditNote.getExternalId());

            return showCreditNote(mapping, form, request, response);
        }

    }
View Full Code Here

Examples of org.jabusuite.transaction.CreditNote

    InvoicesLocal invoiceManager;
   
    protected boolean invoiceHasCreditNote(Invoice invoice, CreditNote creditNote) {
        Iterator<CreditNote> it = invoice.getCreditNotes().iterator();
        while (it.hasNext()) {
            CreditNote exCreditNote = it.next();
            if (exCreditNote.getId()==creditNote.getId()) {
                exCreditNote=creditNote;
                return true;
            }
        }
        return false;
View Full Code Here

Examples of org.jabusuite.transaction.CreditNote

        invoiceLines.add(invoiceLine);
       
        if (this.getDunning().getInvoice().getCreditNotes()!=null) {
            Iterator<CreditNote> itCreditNotes = this.getDunning().getInvoice().getCreditNotes().iterator();
            while (itCreditNotes.hasNext()) {
                CreditNote creditNote = itCreditNotes.next();
                if (!creditNote.isDeleted()) {
                    HashMap cnLine = new HashMap();
                    cnLine.put("invoice.userNumber", creditNote.getUserNumber());
                    cnLine.put("invoice.transactionDate", ClientGlobals.getDateFormat().format(creditNote.getTransactionDate().getTime()));
                    cnLine.put("invoice.transactionName", JbsL10N.getString(creditNote.getClass().getSimpleName()+".name"));
                    cnLine.put("invoice.lastPaymentDate", "");
                    cnLine.put("invoice.salesPriceSumGross", "-"+ClientGlobals.getPriceFormat().format(creditNote.getSalesPriceSumGross()));
                    cnLine.put("invoice.payed", "");
                    cnLine.put("invoice.amountToPay", "");
                    invoiceLines.add(cnLine);
                }
            }
View Full Code Here

Examples of org.jabusuite.transaction.CreditNote

       
    }
   
    protected void createCreditNote() {
        try {
            final CreditNote creditNote = new CreditNote();
            String userNumber = getNextUserNumber(CreditNote.class);
            creditNote.setDataFromTransaction(getInvoice(), userNumber);
            JbsOptionPane dialog = JbsOptionPane.showMessageDialog(this, JbsL10N.getString("Invoice.msgToCreditNote"), JbsL10N.getString("Offer.messageBoxTitle"), JbsOptionPane.INFORMATION_MESSAGE);
            dialog.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent arg0) {
                    FmCreditNoteEdit fmCreditNoteEdit = new FmCreditNoteEdit();
View Full Code Here

Examples of org.jabusuite.transaction.CreditNote

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

Examples of org.jabusuite.transaction.CreditNote

   
    private Logger logger = Logger.getLogger(PnCreditNoteEdit.class);
   
    public PnCreditNoteEdit() {
        super();
        this.setCreditNote(new CreditNote());
    }
View Full Code Here

Examples of org.jabusuite.transaction.CreditNote

        this.setCreditNote(new CreditNote());
    }

    @Override
    public void setJbsBaseObject(JbsBaseObject jbsBaseObject) {
        CreditNote creditNote = (CreditNote) jbsBaseObject;
        //We have to get the positions from the database also
        if ((creditNote != null) && (this.getDlgState() == DlgState.dsEdit)) {
            logger.debug("Retrieving positions for credit-note " + creditNote.getId());
            try {
                CreditNotesRemote creditNotes = (CreditNotesRemote) ClientTools.getRemoteBean(CreditNotesRemote.class);
                CreditNote exDelivNote = creditNotes.findDataset(creditNote.getId(), true);
                creditNote = exDelivNote;
            } catch (NamingException e) {
                logger.error("Error retrieving credit-note.", e);
            }
        }
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.