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


PHP Invoice::load方法代码示例

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


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

示例1: actionInvoice

 public function actionInvoice()
 {
     $model = new Invoice();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         /** @var \robokassa\Merchant $merchant */
         $merchant = Yii::$app->get('robokassa');
         return $merchant->payment($model->sum, $model->id, \skeeks\cms\shop\Module::t('app', 'Refill'), null, Yii::$app->user->identity->email);
     } else {
         return $this->render('invoice', ['model' => $model]);
     }
 }
开发者ID:BMOTech,项目名称:cms-shop,代码行数:11,代码来源:RobocassaController.php

示例2: Invoice

SchemaDB\Database::getDefault()->drop('confirm');
//
class Invoice extends SchemaDB\Storable
{
    //
    public $code = '';
    //
    public $product = '<<Product>>';
}
//
class Product extends SchemaDB\Storable
{
    //
    public $id = self::PRIMARY_KEY;
    //
    public $name = '';
    //
    public $price = 0.0;
}
//
$Invoice0 = new Invoice(array('code' => 'FAT1', 'product' => array('name' => 'Product No 1', 'price' => 1.3)));
//
$Invoice0->store();
//
Invoice::dump();
//
Product::dump();
//
$Invoice1 = Invoice::load('FAT1');
//
SchemaDB\Debug::varDump($Invoice1);
开发者ID:javanile,项目名称:schemadb,代码行数:31,代码来源:load.php

示例3: Action

 public function Action()
 {
     if (empty($_POST['edit'])) {
         return null;
     }
     $db = JFactory::getDBO();
     switch ($_POST['type']) {
         case 'metauser':
             $object = new metaUserDB();
             break;
         case 'processor':
             $object = new processor();
             break;
         case 'invoice':
             $object = new Invoice();
             break;
     }
     $object->load($_POST['id']);
     if ($object->id != $_POST['id']) {
         return "<h3>Error - could not find item.</h3>";
     }
     $vars = get_object_vars($object);
     $encoded = $object->declareParamFields();
     foreach ($vars as $k => $v) {
         if (in_array($k, $encoded)) {
             if (get_magic_quotes_gpc()) {
                 $object->{$k} = jsoonHandler::decode(stripslashes($_POST[$k]));
             } else {
                 $object->{$k} = jsoonHandler::decode($_POST[$k]);
             }
         } elseif (strpos($k, '_') !== 0) {
             $object->{$k} = $_POST[$k];
         }
     }
     $object->check();
     if ($object->store()) {
         return "<h3>Success! Item updated.</h3>";
     } else {
         return "<h3>Error - could not store item.</h3>";
     }
 }
开发者ID:Ibrahim1,项目名称:aec,代码行数:41,代码来源:tool_rawedit.php

示例4: Action

 public function Action()
 {
     $db = JFactory::getDBO();
     $entries = 0;
     $planlist = array();
     $pplist = array();
     $processors = array('authorize_arb', 'google_checkout', 'hsbc', 'iats', 'paypal_wpp', 'sparkassen_internetkasse', 'usaepay');
     $query = 'SELECT `id`' . ' FROM #__acctexp_invoices' . ' WHERE `method` IN (' . implode(',', $processors) . ')';
     $db->setQuery($query);
     $invoices = xJ::getDBArray($db);
     foreach ($invoices as $id) {
         $invoice = new Invoice();
         $invoice->load($id);
         // Skip non-rebilled
         if (count($invoice->transactions) < 2) {
             continue;
         }
         foreach ($invoice->transactions as $tid => $transaction) {
             if (!$tid) {
                 // Skip first entry
                 continue;
             }
             if (!empty($_POST['safe'])) {
                 $query = 'SELECT `id`' . ' FROM #__acctexp_log_history' . ' WHERE transaction_date = \'' . $transaction->timestamp . '\'' . ' AND proc_name = \'' . $transaction->processor . '\'' . ' AND invoice_number = \'' . $invoice->invoice_number . '\'';
                 $db->setQuery($query);
                 $hasentry = $db->loadResult();
                 if ($hasentry) {
                     continue;
                 }
             }
             $entries++;
             if (!empty($_POST['create'])) {
                 $entry = new logHistory();
                 $user = new cmsUser();
                 $user->load($invoice->userid);
                 if (!isset($planlist[$invoice->usage])) {
                     $plan = new SubscriptionPlan();
                     $plan->load($invoice->usage);
                     $planlist[$invoice->usage] = $plan;
                 }
                 if (!isset($pplist[$invoice->method])) {
                     $pp = new SubscriptionPlan();
                     $pp->load($invoice->method);
                     $pplist[$invoice->method] = $pp;
                 }
                 if ($pplist[$invoice->method]->id) {
                     $entry->proc_id = $pplist[$invoice->method]->id;
                     $entry->proc_name = $pplist[$invoice->method]->processor_name;
                 }
                 $entry->user_id = $user->id;
                 $entry->user_name = $user->username;
                 if ($planlist[$invoice->usage]->id) {
                     $entry->plan_id = $planlist[$invoice->usage]->id;
                     $entry->plan_name = $planlist[$invoice->usage]->name;
                 }
                 $entry->transaction_date = $transaction->timestamp;
                 $entry->amount = $transaction->amount;
                 $entry->invoice_number = $invoice->invoice_number;
                 $entry->response = 'Created by the Rebuild Rebills Tool';
                 $entry->cleanup();
                 $entry->check();
                 $entry->store();
             }
         }
     }
     if (empty($entries)) {
         if ($_POST['create']) {
             return "No Invoices found to create History Entries from.";
         } else {
             return "No Invoices with data found.";
         }
     } else {
         if ($_POST['create']) {
             return $entries . " History Entries created.";
         } else {
             return "No History Entries created, found " . $entries . " that can be converted (select 'Create' from the settings above and carry out the query again)";
         }
     }
 }
开发者ID:Ibrahim1,项目名称:aec,代码行数:79,代码来源:tool_rebuildrebills.php

示例5: cancelEntity

 public function cancelEntity($invoice_number, $task)
 {
     $invoiceid = aecInvoiceHelper::InvoiceIDfromNumber($invoice_number, 0, true);
     $userid = '';
     if ($invoiceid) {
         $objInvoice = new Invoice();
         $objInvoice->load($invoiceid);
         $objInvoice->delete();
         if (strcmp($task, 'editMembership') == 0) {
             $userid = '&userid=' . $objInvoice->userid;
         }
     }
     aecRedirect('index.php?option=com_acctexp&task=' . $task . $userid, JText::_('REMOVED'));
 }
开发者ID:Ibrahim1,项目名称:aec,代码行数:14,代码来源:admin.acctexp.php

示例6: array

            }
        }
    }
}
$pagesize = 15;
if (empty($page)) {
    $page = 0;
}
$invoiceList = aecInvoiceHelper::InvoiceIdList($metaUser->userid, $page * $pagesize, $pagesize);
$properties['invoice_pages'] = (int) ($invoiceno / $pagesize);
$properties['invoice_page'] = $page;
$invoices = array();
foreach ($invoiceList as $invoiceid) {
    $invoices[$invoiceid] = array();
    $invoice = new Invoice();
    $invoice->load($invoiceid);
    $rowstyle = '';
    $actionsarray = array();
    if (!in_array($invoice->method, $excludedprocs)) {
        $actionsarray[] = array('task' => 'invoicePrint', 'add' => 'invoice=' . $invoice->invoice_number . '&tmpl=component', 'text' => JText::_('HISTORY_ACTION_PRINT'), 'insert' => ' target="_blank" ', 'class' => 'btn');
        $actionsarray[] = array('task' => 'invoicePDF', 'add' => 'invoice=' . $invoice->invoice_number, 'text' => 'PDF', 'insert' => '', 'class' => 'btn');
    }
    if ($invoice->transaction_date == '0000-00-00 00:00:00' || $invoice->subscr_id) {
        if ($invoice->transaction_date == '0000-00-00 00:00:00') {
            $actionsarray[] = array('task' => 'repeatPayment', 'add' => 'invoice=' . $invoice->invoice_number . '&' . xJ::token() . '=1', 'text' => JText::_('HISTORY_ACTION_REPEAT'), 'class' => 'btn btn-success');
            if (is_null($invoice->fixed) || !$invoice->fixed) {
                $actionsarray[] = array('task' => 'cancelPayment', 'add' => 'invoice=' . $invoice->invoice_number, 'text' => JText::_('HISTORY_ACTION_CANCEL'), 'class' => 'btn btn-danger');
            }
        }
        $rowstyle = 'invoice-unpaid';
    }
开发者ID:Ibrahim1,项目名称:aec,代码行数:31,代码来源:html.php

示例7: exportMembers

 public function exportMembers()
 {
     $db = JFactory::getDBO();
     foreach ($this->filter as $k => $v) {
         if (empty($v)) {
             $this->filter[$k] = array();
         }
     }
     // Assemble Database call
     if (!in_array('notconfig', $this->filter['status'])) {
         $where = array();
         if (!empty($this->filter['planid'])) {
             $where[] = '`plan` IN (' . implode(',', $this->filter['planid']) . ')';
         }
         $query = 'SELECT a.id, a.userid' . ' FROM #__acctexp_subscr AS a' . ' INNER JOIN #__users AS b ON a.userid = b.id';
         if (!empty($where)) {
             $query .= ' WHERE ( ' . implode(' OR ', $where) . ' )';
         }
         if (!empty($this->filter['status'])) {
             $stati = array();
             foreach ($this->filter['status'] as $status) {
                 $stati[] = 'LOWER( `status` ) = \'' . strtolower($status) . '\'';
             }
             if (!empty($where)) {
                 $query .= ' AND (' . implode(' OR ', $stati) . ')';
             } else {
                 $query .= ' WHERE (' . implode(' OR ', $stati) . ')';
             }
         }
         if (!empty($this->filter['orderby'])) {
             $query .= ' ORDER BY ' . $this->filter['orderby'] . '';
         }
     } else {
         $query = 'SELECT DISTINCT b.id AS `userid`' . ' FROM #__users as b' . ' WHERE b.id NOT IN (' . ' SELECT a.userid' . ' FROM #__acctexp_subscr as a);';
     }
     $db->setQuery($query);
     $descriptions = AECToolbox::rewriteEngineExplain($this->options['rewrite_rule']);
     $descarray = explode(';', $descriptions);
     $this->exphandler->putDescription($descarray);
     // Fetch Userlist
     $userlist = $db->loadObjectList();
     // Plans Array
     $plans = array();
     // Iterate through userlist
     if (!empty($userlist)) {
         foreach ($userlist as $entry) {
             $metaUser = new metaUser($entry->userid);
             if (!empty($entry->id)) {
                 $metaUser->moveFocus($entry->id);
             }
             if ($metaUser->hasSubscription) {
                 $planid = $metaUser->focusSubscription->plan;
                 if (!isset($plans[$planid])) {
                     $plans[$planid] = new SubscriptionPlan();
                     $plans[$planid]->load($planid);
                 }
                 $invoiceid = aecInvoiceHelper::lastClearedInvoiceIDbyUserID($metaUser->userid, $planid);
                 if ($invoiceid) {
                     $invoice = new Invoice();
                     $invoice->load($invoiceid);
                     $line = AECToolbox::rewriteEngine($this->options['rewrite_rule'], $metaUser, $plans[$planid], $invoice);
                 } else {
                     $line = AECToolbox::rewriteEngine($this->options['rewrite_rule'], $metaUser, $plans[$planid]);
                 }
             } else {
                 $line = AECToolbox::rewriteEngine($this->options['rewrite_rule'], $metaUser);
             }
             $larray = explode(';', $line);
             // Remove whitespaces and newlines
             foreach ($larray as $larrid => $larrval) {
                 $larray[$descarray[$larrid]] = trim($larrval);
                 unset($larray[$larrid]);
             }
             $this->exphandler->putln($larray);
         }
     }
 }
开发者ID:Ibrahim1,项目名称:aec,代码行数:77,代码来源:admin.acctexp.class.php

示例8: cancelInvoice

function cancelInvoice($option, $invoice_number, $pending = 0, $userid, $return = null)
{
    $user = JFactory::getUser();
    if (empty($user->id)) {
        if ($userid) {
            if (AECToolbox::quickVerifyUserID($userid) === true) {
                // This user is not expired, so he could log in...
                return getView('access_denied');
            }
        } else {
            return getView('access_denied');
        }
    } else {
        $userid = $user->id;
    }
    $invoiceid = aecInvoiceHelper::InvoiceIDfromNumber($invoice_number, $userid);
    // Only allow a user to access existing and own invoices
    if ($invoiceid) {
        $objInvoice = new Invoice();
        $objInvoice->load($invoiceid);
        $objInvoice->cancel();
    } else {
        return getView('access_denied');
    }
    if ($pending) {
        getView('pending');
    } else {
        if (!empty($return)) {
            aecRedirect(base64_decode($return));
        } else {
            getView('subscriptiondetails', array('sub' => 'invoices'));
        }
    }
}
开发者ID:Ibrahim1,项目名称:aec,代码行数:34,代码来源:acctexp.php


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