当前位置: 首页>>代码示例>>PHP>>正文


PHP Invoice::loadInvoiceNumber方法代码示例

本文整理汇总了PHP中Invoice::loadInvoiceNumber方法的典型用法代码示例。如果您正苦于以下问题:PHP Invoice::loadInvoiceNumber方法的具体用法?PHP Invoice::loadInvoiceNumber怎么用?PHP Invoice::loadInvoiceNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Invoice的用法示例。


在下文中一共展示了Invoice::loadInvoiceNumber方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Action

 public function Action()
 {
     $return = '';
     if (!empty($_POST['invoices'])) {
         $notfound = array();
         $updated = array();
         $db = JFactory::getDBO();
         $list = explode("\n", $_POST['invoices']);
         foreach ($list as $li) {
             $invoice = new Invoice();
             $invoice->loadInvoiceNumber(trim($li));
             if (empty($invoice->id)) {
                 $notfound[] = trim($li);
                 continue;
             }
             if (!is_numeric($invoice->usage)) {
                 $notfound[] = trim($li);
                 continue;
             }
             $metaUser = new metaUser($invoice->userid);
             $cfid = $metaUser->focusSubscription->id;
             if ($cfid != $invoice->subscr_id) {
                 if (!$metaUser->moveFocus($invoice->subscr_id)) {
                     $notfound[] = trim($li);
                     continue;
                 }
             }
             if ($metaUser->focusSubscription->status == 'Active') {
                 $metaUser->focusSubscription->expiration = date('Y-m-d H:i:s', (int) gmdate('U') - 60);
                 $metaUser->focusSubscription->plan = $invoice->usage;
                 $metaUser->focusSubscription->type = $invoice->method;
                 $metaUser->focusSubscription->recurring = 1;
                 $metaUser->focusSubscription->check();
                 $metaUser->focusSubscription->store();
                 $updated[] = $invoice->invoice_number;
             } else {
                 $metaUser->focusSubscription->status = 'Active';
                 $metaUser->focusSubscription->expiration = date('Y-m-d H:i:s', (int) gmdate('U') - 60);
                 $metaUser->focusSubscription->plan = $invoice->usage;
                 $metaUser->focusSubscription->type = $invoice->method;
                 $metaUser->focusSubscription->recurring = 1;
                 $metaUser->focusSubscription->check();
                 $metaUser->focusSubscription->store();
                 $updated[] = $invoice->invoice_number;
             }
         }
         $return = '<p>Provided ' . count($list) . ' Invoice Numbers.</p>';
         if (count($updated)) {
             $return .= '<p>Updated ' . count($updated) . ' Invoices:</p>';
             $return .= '<p>' . implode(', ', $updated) . '</p>';
         }
         if (count($notfound)) {
             $return .= '<p>Failed to process the following ' . count($notfound) . ' Invoices:</p>';
             $return .= '<p>' . implode(', ', $notfound) . '</p>';
         }
     } elseif (isset($_POST['invoices'])) {
         $return = '<p>Please enter invoice numbers.</p>';
     }
     return $return;
 }
开发者ID:Ibrahim1,项目名称:aec,代码行数:60,代码来源:tool_invoicereactivate.php

示例2: printout

 public function printout($invoice_number, $standalone = true)
 {
     $invoice = new Invoice();
     $invoice->loadInvoiceNumber($invoice_number);
     $iFactory = new InvoiceFactory($invoice->userid, null, null, null, null, null, false, true);
     $iFactory->invoiceprint($invoice->invoice_number, $standalone);
 }
开发者ID:Ibrahim1,项目名称:aec,代码行数:7,代码来源:admin.acctexp.php

示例3: die

defined('_JEXEC') or die('Direct Access to this location is not allowed.');
if ($userid == 0) {
    return aecRedirect(AECToolbox::deadsureURL('index.php'));
}
if ($metaUser->hasSubscription) {
    // Make sure this really is pending
    if (strcmp($metaUser->objSubscription->status, 'Pending') !== 0) {
        return getView('access_denied');
    }
}
$invoices = aecInvoiceHelper::InvoiceCountbyUserID($userid);
$reason = "";
if ($invoices) {
    $invoice = aecInvoiceHelper::lastUnclearedInvoiceIDbyUserID($userid);
    $objInvoice = new Invoice();
    $objInvoice->loadInvoiceNumber($invoice);
    $params = $objInvoice->params;
    if (isset($params['pending_reason'])) {
        $lang = JFactory::getLanguage();
        if ($lang->hasKey('PENDING_REASON_' . strtoupper($params['pending_reason']))) {
            $reason = JText::_('PENDING_REASON_' . strtoupper($params['pending_reason']));
        } else {
            $reason = $params['pending_reason'];
        }
    } elseif (strcmp($objInvoice->method, 'transfer') === 0) {
        $reason = 'transfer';
    } else {
        $reason = 0;
    }
} else {
    $invoice = 'none';
开发者ID:Ibrahim1,项目名称:aec,代码行数:31,代码来源:html.php

示例4: InvoiceRemoveCoupon

function InvoiceRemoveCoupon($option)
{
    $invoice = aecGetParam('invoice', 0, true, array('word', 'string', 'clear_nonalnum'));
    $coupon_code = aecGetParam('coupon_code', 0, true, array('word', 'string', 'clear_nonalnum'));
    $objinvoice = new Invoice();
    $objinvoice->loadInvoiceNumber($invoice);
    $objinvoice->removeCoupon($coupon_code);
    $objinvoice->computeAmount();
    repeatInvoice($option, $invoice, null, $objinvoice->userid);
}
开发者ID:Ibrahim1,项目名称:aec,代码行数:10,代码来源:acctexp.php

示例5: parseNotification

 public function parseNotification($post)
 {
     if (empty($this->settings)) {
         $this->getSettings();
     }
     $return = $this->processor->parseNotification($post);
     // Check whether this is an ad-hoc notification
     if (!empty($return['_aec_createuser']) && empty($return['invoice'])) {
         // Identify usage
         $usage = 1;
         // Create new user account and fetch id
         $userid = aecRegistration::saveUserRegistration($return['_aec_createuser'], true, true, false);
         // Create Invoice
         $invoice = new Invoice();
         $invoice->create($userid, $usage, $this->processor_name);
         $invoice->computeAmount();
         // Set new return variable - we now know what invoice this is
         $return['invoice'] = $invoice->invoice_number;
     }
     // Always amend secondary ident codes
     if (!empty($return['secondary_ident']) && !empty($return['invoice'])) {
         $invoice = new Invoice();
         $invoice->loadInvoiceNumber($return['invoice']);
         $invoice->secondary_ident = $return['secondary_ident'];
         $invoice->storeload();
     }
     if (!empty($return['_aec_createuser'])) {
         unset($return['_aec_createuser']);
     }
     return $return;
 }
开发者ID:Ibrahim1,项目名称:aec,代码行数:31,代码来源:acctexp.paymentprocessor.class.php


注:本文中的Invoice::loadInvoiceNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。