本文整理汇总了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;
}
示例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);
}
示例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';
示例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);
}
示例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;
}