Esempio n. 1
0
    } else {
        _e(' (%s days)', $days);
    }
    //}
    ?>
                <?php 
    if ($show_record_button) {
        ?>
                </a>
                <?php 
    }
    ?>
            </td>
            <td class="row_action">
                <?php 
    echo isset($recurring['url']) && $recurring['url'] ? $recurring['url'] : module_finance::link_open_recurring($recurring['finance_recurring_id'], true, $recurring);
    ?>
            </td>
            <td>
                <?php 
    if ($recurring['type'] == 'i') {
        $balance += $recurring['amount'];
        ?>
<span class="success_text">+<?php 
        echo dollar($recurring['amount'], true, $recurring['currency_id']);
        ?>
</span><?php 
    }
    ?>
            </td>
            <td>
Esempio n. 2
0
" target="_blank"><?php 
    echo module_calendar::link_calendar('finance_transactions', array('credit' => 1));
    ?>
</a> <br/>
    Debit Transactions: <a href="<?php 
    echo module_calendar::link_calendar('finance_transactions', array('debit' => 1));
    ?>
" target="_blank"><?php 
    echo module_calendar::link_calendar('finance_transactions', array('debit' => 1));
    ?>
</a>
</p>
<hr>

<p><?php 
    _e('Here are the URL\'s for <strong>Recurring Finance Transactions</strong> (ie: anything upcoming in the <a href="%s">recurring transactions listing</a> page).', module_finance::link_open_recurring(false));
    ?>
</p>
<p>
    Credit Transactions: <a href="<?php 
    echo module_calendar::link_calendar('finance_recurring', array('credit' => 1));
    ?>
" target="_blank"><?php 
    echo module_calendar::link_calendar('finance_recurring', array('credit' => 1));
    ?>
</a> <br/>
    Debit Transactions: <a href="<?php 
    echo module_calendar::link_calendar('finance_recurring', array('debit' => 1));
    ?>
" target="_blank"><?php 
    echo module_calendar::link_calendar('finance_recurring', array('debit' => 1));
Esempio n. 3
0
        ?>
');" <?php 
    }
    ?>
><?php 
    _e('Record this transaction');
    ?>
</a>
                    <?php 
    _e('(this will schedule the next reminder)');
    ?>
                </td>
            </tr>
            <?php 
}
?>

        </tbody>
    </table>
<?php 
$fieldset_data = array('heading' => array('title' => _l('Recurring Transaction'), 'type' => 'h2', 'main' => true), 'elements_before' => ob_get_clean());
echo module_form::generate_fieldset($fieldset_data);
unset($fieldset_data);
$form_actions = array('class' => 'action_bar action_bar_left', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save')), array('type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete'), 'onclick' => "return confirm('" . _l('Really delete this record?') . "');"), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . module_finance::link_open_recurring(false) . "';")));
echo module_form::generate_form_actions($form_actions);
?>



</form>
    }
    if (strlen($recurring['name'])) {
        $recurring['name'] = '(' . $recurring['name'] . ")";
    }
    // start looping up to our cutout.
    $time = strtotime($timezone_hours . ' hours', strtotime($recurring['next_due_date']));
    while ($time < $limit_timestamp) {
        echo 'BEGIN:VEVENT
UID:' . md5(mt_rand(1, 100)) . '@ultimateclientmanager.com
';
        // work out the UTC time for this event, based on the timezome we have set in the configuration options
        echo 'DTSTAMP:' . date('Ymd') . 'T090000Z
DTSTART;VALUE=DATE:' . date('Ymd', $time) . '
DTEND;VALUE=DATE:' . date('Ymd', strtotime('+1 day', $time)) . '
SUMMARY:' . ($recurring['type'] == 'i' ? '+' . dollar($recurring['amount']) : '') . ($recurring['type'] == 'e' ? '-' . dollar($recurring['amount']) : '') . " " . $recurring['name'] . '
DESCRIPTION:' . preg_replace('#[\\r\\n]+#', "<br>", $recurring['description']) . ' <br><a href="' . module_finance::link_open_recurring($recurring['finance_recurring_id']) . '">' . _('Open Link') . '</a>
END:VEVENT
';
        // increase the time to the next recurring event.
        if ($recurring['next_due_date'] == '0000-00-00' || !$recurring['days'] && !$recurring['months'] && !$recurring['years']) {
            // it's a once off..
            break;
            // ignore anym ore in this loop.
        } else {
            // work out when the next one will be.
            $next_time = $time;
            $next_time = strtotime('+' . abs((int) $recurring['days']) . ' days', $next_time);
            $next_time = strtotime('+' . abs((int) $recurring['months']) . ' months', $next_time);
            $next_time = strtotime('+' . abs((int) $recurring['years']) . ' years', $next_time);
            $time = $next_time;
        }
Esempio n. 5
0
    $fieldset_data['elements'][] = array('title' => 'Linked Transactions', 'fields' => array(function () use(&$linked_finances) {
        foreach ($linked_finances as $linked_finance) {
            echo module_finance::link_open($linked_finance['finance_id'], true);
            echo ' ';
            echo dollar($linked_finance['amount']);
            echo ' ';
            echo print_date($linked_finance['transaction_date']);
            echo '<br>';
        }
    }));
}
if ($finance_recurring_id > 0) {
    $fieldset_data['elements'][] = array('title' => 'Recurring', 'fields' => array(function () use(&$finance_recurring, $finance_recurring_id) {
        ?>
 <a href="<?php 
        echo module_finance::link_open_recurring($finance_recurring_id);
        ?>
"><?php 
        if (!$finance_recurring['days'] && !$finance_recurring['months'] && !$finance_recurring['years']) {
            echo _l('Once off');
        } else {
            echo _l('Every %s days, %s months and %s years between %s and %s', $finance_recurring['days'], $finance_recurring['months'], $finance_recurring['years'], $finance_recurring['start_date'] && $finance_recurring['start_date'] != '0000-00-00' ? print_date($finance_recurring['start_date']) : 'now', $finance_recurring['end_date'] && $finance_recurring['end_date'] != '0000-00-00' ? print_date($finance_recurring['end_date']) : 'forever');
        }
        ?>
</a>
                    <?php 
        // see if we can find previous transactions from this recurring schedule.
        // copied from recurring_edit
        if (isset($finance_recurring['last_transaction_finance_id']) && $finance_recurring['last_transaction_finance_id']) {
            ?>
 <a href="<?php