Exemple #1
0
def view_journal_entry(entrycode):
    data = AccountingAPI.GetCategories()
    jrns = AccountingAPI.GetJournals()
    data1, data2, data3 = AccountingAPI.GrabJournalEntry(entrycode)
    FCurr = AccountingAPI.GetFuntionalCurrency()
    if request.method == 'POST':
        return redirect(url_for('accounting.journal'))
    return render_template('accounting/view-journal-entry.html', username = session['username'], role = session['role'], data = data,  jrns = jrns, data1 = data1, data2 = data2, data3 = data3, FC = FCurr)
Exemple #2
0
def journal():
    data = AccountingAPI.GetCategories()
    jrns = AccountingAPI.GetJournals()
    FCurr = AccountingAPI.GetFuntionalCurrency()
    if request.method == 'POST':
        if request.form['submit'] == 'Submit':
            try:
                AccountingAPI.AddJournalEntry(session['username'], session['password'],
                request.form.getlist('account-type'),
                request.form.getlist('account-category'),
                request.form.getlist('account-name'),
                request.form.getlist('currency'),
                request.form.getlist('debit'),
                request.form.getlist('credit'),
                request.form.getlist('comments'))
                flash('Journal successfully created...', category = 'success')
                return redirect(url_for('accounting.journal'))
            except Exception as e:
                flash(str(e), category = 'fail')
                return redirect(url_for('accounting.journal'))
    return render_template('accounting/journal.html', username = session['username'], role = session['role'], data = data,  jrns = jrns, FC = FCurr)