コード例 #1
0
 /**
  * A custom method within the Plugin to generate the content
  * 
  */
 function generateRecurrentInvoiceContent()
 {
     $output = '';
     $do_rec_inv = new RecurrentInvoice();
     $do_rec_inv->getRecurrentInvoiceDetail($_SESSION['do_invoice']->idinvoice);
     if ($do_rec_inv->getNumRows()) {
         $do_rec_inv->fetch();
         if ($do_rec_inv->recurrence > 1) {
             $output .= $rec_inv_text = _('This invoice repeats every') . $do_rec_inv->recurrence . " " . $do_rec_inv->recurrencetype . "s.";
         } else {
             $output .= $rec_inv_text = _('This invoice repeats') . " <i>" . _('every') . " " . $do_rec_inv->recurrencetype . "</i>.";
         }
         $output .= '<br />';
         $next_rec_inv_date = date("l F d, Y", strtotime($do_rec_inv->nextdate));
         $output .= _('The next invoice will be generated on ') . '<i>' . $next_rec_inv_date . '.</i>';
     } else {
         $this->setIsActive(false);
     }
     return $output;
 }
コード例 #2
0
 * Recurrent Invoices which are paid monthly online are porcessed via this script
 * Will check the user stripe details and will process the invoice payment if its the due date.
 * @see class/RecurrentInvoice.class.php
 * @see class/Stripe.class.php
 */
include_once 'config.php';
include_once 'class/Stripe.class.php';
include_once 'class/stripe-lib/Stripe.php';
set_time_limit(3600);
//echo '<pre>';print_r($_SESSION);echo '</pre>';
$do_recurrent = new RecurrentInvoice();
$do_invoice = new Invoice();
$do_inv_line = new InvoiceLine();
$do_contact = new Contact();
$do_recurrent->getRecInvoiceForStripeProcess();
if ($do_recurrent->getNumRows()) {
    while ($do_recurrent->next()) {
        $do_user_detail = new User();
        $do_invoice = new Invoice();
        $do_invoice->getId($do_recurrent->idinvoice);
        $do_invoice->sessionPersistent("do_invoice", "index.php", OFUZ_TTL);
        $do_user_detail->getId($_SESSION['do_invoice']->iduser);
        $user_settings = $do_user_detail->getChildUserSettings();
        if ($user_settings->getNumRows()) {
            // Get the setting data for the user who has created the invoice
            while ($user_settings->next()) {
                $payment_mode = false;
                $payment_selection = '';
                if ($user_settings->setting_name == 'invoice_logo' && $user_settings->setting_value != '') {
                    $_SESSION['do_invoice']->inv_logo = $user_settings->setting_value;
                }