コード例 #1
0
// @todo Remove this shitty hack!
$cols = array('star', 'id', 'date', 'status', 'kind', 'contact', 'note', 'bill_amount', 'open_amount');
echo '<table>';
// List each Invoice Item
foreach ($data['list'] as $item) {
    echo '<tr class="rero ' . strtolower($item['status']) . ' ' . strtolower($item['kind']) . '">';
    // Star
    echo '<td>' . star($item['star']) . '</td>';
    // ID
    echo '<td><a href="' . Radix::link('/workorder/view?w=' . $item['id']) . '">#' . $item['id'] . '</td>';
    // Printable Link
    if (in_array('print', $cols)) {
        echo '<td><a href="' . Radix::link('/workorder/pdf?w=' . $item['id']) . '">' . img('/tango/22x22/devices/printer.png', 'Get PDF') . '</a></td>';
    }
    if (in_array('date', $cols) && isset($item['date'])) {
        echo '<td class="c">' . ImperiumView::niceDate($item['date']) . '</td>';
    }
    echo '<td>' . $item['kind'] . '/' . $item['status'] . '</td>';
    if (isset($item['contact_name'])) {
        if (in_array('contact', $cols)) {
            echo '<td><a href="' . Radix::link('/contact/view?c=' . $item['contact_id']) . '">' . $item['contact_name'] . '</td>';
        }
    }
    if (in_array('note', $cols)) {
        echo '<td>';
        $x = min(max(strpos($item['note'], "\n"), 32), 64);
        echo trim(substr($item['note'], 0, $x));
        echo '</td>';
    }
    if (in_array('open_amount', $cols)) {
        echo '<td class="bill" title="Open Amount">' . number_format($item['open_amount'], 2) . '</td>';
コード例 #2
0
ファイル: invoice-list.php プロジェクト: rahmanazhar/imperium
}
// List Items
foreach ($data['list'] as $x) {
    //Radix::dump($x);
    // $item = new Invoice($x);
    $item = $x;
    echo '<tr class="rero ' . strtolower($item['status']) . '">';
    // Star
    echo '<td>' . star($item['star']) . '</td>';
    // ID
    echo '<td><a href="' . Radix::link('/invoice/view?i=' . $item['id']) . '">#' . $item['id'] . '</a></td>';
    // Printable Link
    // echo '<td><a href="' . Radix::link('/invoice/pdf?i=' . $item['id']) . '">' . img('/tango/22x22/devices/printer.png','Get PDF') . '</a></td>';
    echo '<td>' . $item['status'] . '</td>';
    echo '<td class="c">';
    echo ImperiumView::niceDate($item['date']);
    // echo '<td class="r">';
    $h = $t = null;
    if (!in_array($item['status'], $date_skip_list)) {
        if ($item['due_diff'] <= 0) {
            $t = sprintf('Invoice is Due in %d days', abs($item['due_diff']));
            $h = sprintf('%d Out', abs($item['due_diff']));
        } else {
            $t = sprintf('Invoice is Past Due in %d days', abs($item['due_diff']));
            $h = sprintf('%d Due', abs($item['due_diff']));
        }
        echo sprintf(' <span class="s" title="%s">%s</span>', $t, $h);
    }
    echo '</td>';
    echo '<td>' . $item['kind'] . '</td>';
    // echo '<td>' . substr($item->note,0,strrpos($item->note,' ',min(72,strlen($item->note)))) . '</td>';
コード例 #3
0
ファイル: view.php プロジェクト: rahmanazhar/imperium
    echo '<tr><td class="b" colspan="3">Tax Total:</td><td class="l">' . number_format($item_tax_total, 2) . '</td></tr>';
    echo '<tr><td class="b" colspan="3">Bill Total:</td><td class="l">&curren;' . number_format($item_total + $item_tax_total, 2) . '</td></tr>';
    echo '<tr><td class="b" colspan="3">Paid Total:</td><td class="l">&curren;' . number_format($this->Invoice['paid_amount'], 2) . '</td></tr>';
    echo '<tr><td class="b" colspan="3">Balance:</td><td class="l" style="color: #f00;">&curren;' . number_format($item_total + $item_tax_total - $this->Invoice['paid_amount'], 2) . '</td></tr>';
    echo '</table>';
    echo '</div>';
}
// Transactions
if (count($this->InvoiceTransactionList) > 0) {
    $sum = 0;
    echo '<h2 style="clear:both;"><i class="fa fa-money"></i> Transactions</h2>';
    echo '<table>';
    echo '<tr><th>Date</th><th>Account / Note</th><th>Debit</th><th>Credit</th></tr>';
    foreach ($this->InvoiceTransactionList as $le) {
        $sum += $le->amount;
        $link = Radix::link('/account/transaction?id=' . $le->account_journal_id, ImperiumView::niceDate($le->date));
        echo '<tr>';
        echo '<td class="c">' . $link . '</td>';
        $link = Radix::link('/account/journal?id=' . $le->account_id, $le->account_name);
        echo '<td>' . $link;
        if (strlen($le->note)) {
            echo '/' . $le->note;
        }
        echo '</td>';
        // todo: debit/credit columns
        if ($le->amount < 0) {
            echo "<td class='r'>&curren;" . number_format(abs($le->amount), 2) . "</td><td>&nbsp;</td>";
        } else {
            echo "<td>&nbsp;</td><td class='r'>&curren;" . number_format($le->amount, 2) . "</td>";
        }
        echo '</tr>';
コード例 #4
0
ファイル: file-list.php プロジェクト: rahmanazhar/imperium
use Radix;
if (empty($data)) {
    return 0;
}
if (count($data) == 0) {
    return 0;
}
echo '<h2>Files';
// echo ' <span class="s">[';
// echo ' <a onclick="$(\'#note-list\').toggle(); return false;">View</a> ';
// echo ' <a onclick="$(\'#note-edit\').load(\'' . $this->page . '\').focus(); return false;" href="' . $this->page . '">';
// echo img('/silk/1.3/note_add.png','Add Note');
// echo '</a> ';
// echo ']</span>';
echo '</h2>';
echo '<div id="file-edit"></div>';
echo '<div id="file-list">';
echo '<table>';
echo '<tr><th>Icon</th><th>Name</th><th>Type</th><th>Size</th><th>&nbsp;</th></tr>';
foreach ($data as $f) {
    $mime = Base_File::mimeInfo($f['kind']);
    echo '<tr class="rero">';
    echo '<td>' . img($mime['icon'], $mime['note']) . '</td>';
    echo '<td><a href="' . Radix::link('/file/view?id=' . $f['id']) . '">' . html($f['name']) . '</a></td>';
    echo '<td class="r">' . html($mime['name']) . '</td>';
    echo '<td class="r">' . html(ImperiumView::niceSize($f['size'])) . '</td>';
    // echo '<td>' . $this->link('/file/render/' . $f->id,   img('/tango/24x24/actions/edit-find.png','Render') ) . '</td>';
    echo '<td><a href="' . Radix::link('/file/download?id=' . $f['id']) . '">' . img('/tango/24x24/actions/document-save.png', 'Download') . '</td>';
    echo '</tr>';
}
echo '</table>';
コード例 #5
0
ファイル: transaction.php プロジェクト: rahmanazhar/imperium
<?php

/**
	Account Journal Entry View

	Draws the form necessary to input a multi-account journal entry
*/
namespace Edoceo\Imperium;

use Edoceo\Radix;
use Edoceo\Radix\HTML\Form;
// @todo Set this in the controller
$this->FileYes = ini_get('file_uploads');
$this->FileMax = ImperiumView::niceSize(ini_get('upload_max_filesize'));
$css = null;
$cr_total = 0;
$dr_total = 0;
$account_list_json = array();
foreach ($this->AccountList as $i => $a) {
    $account_list_json[] = array('id' => $a['id'], 'value' => $a['full_name']);
}
$account_list_json = json_encode($account_list_json);
// @note duplicated on invoice/view.phtml
if (count($this->jump_list)) {
    echo '<div class="jump_list">';
    $list = array();
    foreach ($this->jump_list as $x) {
        if ($x['id'] == $this->AccountJournalEntry['id']) {
            $list[] = '<span class="hi">#' . $x['id'] . '</span>';
        } elseif ($x['id'] < $this->AccountJournalEntry['id']) {
            $list[] = '<a href="' . $this->link('/account/transaction?id=' . $x['id']) . '">&laquo; #' . $x['id'] . '</a>';