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


PHP invoice类代码示例

本文整理汇总了PHP中invoice的典型用法代码示例。如果您正苦于以下问题:PHP invoice类的具体用法?PHP invoice怎么用?PHP invoice使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: showAction

 /**
  * @EXT\Route(
  *      "/admin/invoice/{invoice}/show",
  *      name="admin_invoice_show"
  * )
  * @EXT\Template
  */
 public function showAction(invoice $invoice)
 {
     if ($invoice->getChart()->getOwner() !== $this->tokenStorage->getToken()->getUser() && !$this->authorization->isGranted('ROLE_ADMIN')) {
         throw new AccessDeniedException();
     }
     return array('invoice' => $invoice);
 }
开发者ID:kitan1982,项目名称:InvoiceBundle,代码行数:14,代码来源:InvoiceController.php

示例2: cacheInvoiceFees

/**
 * Calculates invoice fees and stores it in panel_users,
 * according to details in billing_service_categories.
 *
 * @param  int   The mode
 * @param  int   Userid to begin with Subject, eg tablename.
 * @param  int   Number of Users we should handle in this run
 * @param  int   Single userid we should focus on.
 * @return array Results like current invoice fees etc.
 *
 * @author Former03 GmbH :: Florian Lippert <flo@syscp.org>
 */
function cacheInvoiceFees($mode = 0, $begin = null, $count = null, $userid = null)
{
    global $db;
    $returnval = array();
    $service_categories_result = $db->query('SELECT * FROM `' . getModeDetails($mode, 'TABLE_BILLING_SERVICE_CATEGORIES', 'table') . '` ORDER BY `id` ASC');
    while ($service_categories_row = $db->fetch_array($service_categories_result)) {
        $service_categories[$service_categories_row['category_name']] = $service_categories_row;
        if ($service_categories_row['category_cachefield'] != '') {
            $zeroUpdates[$service_categories_row['category_cachefield']] = 0;
        }
    }
    if ($userid !== null && intval($userid) !== 0) {
        $userSelection = " WHERE `" . getModeDetails($mode, 'TABLE_PANEL_USERS', 'key') . "` = '" . $userid . "' ";
    } else {
        $userSelection = '';
    }
    if ($begin !== null && intval($count) !== 0) {
        $limit = ' LIMIT ' . intval($begin) . ', ' . intval($count);
    } else {
        $limit = '';
    }
    $users = $db->query("SELECT * FROM `" . getModeDetails($mode, 'TABLE_PANEL_USERS', 'table') . "` " . $userSelection . ' ' . $limit);
    while ($user = $db->fetch_array($users)) {
        if (!isset($user['customer_categories_once'])) {
            $user['customer_categories_once'] = '';
        }
        if (!isset($user['customer_categories_period'])) {
            $user['customer_categories_period'] = '';
        }
        $myInvoice = new invoice($db, $mode, explode('-', $user['customer_categories_once']), explode('-', $user['customer_categories_period']));
        if ($myInvoice->collect($user[getModeDetails($mode, 'TABLE_PANEL_USERS', 'key')]) === true) {
            $total_fee_taxed = 0;
            $myUpdates = $zeroUpdates;
            $total_fees_array = $myInvoice->getTotalFee($lng);
            foreach ($total_fees_array as $service_type => $total_fee_array) {
                if (isset($service_categories[$service_type]) && isset($service_categories[$service_type]['category_cachefield']) && $service_categories[$service_type]['category_cachefield'] != '') {
                    $myUpdates[$service_categories[$service_type]['category_cachefield']] = $total_fee_array['total_fee_taxed'];
                    $total_fee_taxed += $total_fee_array['total_fee_taxed'];
                }
            }
            $updates = '';
            foreach ($myUpdates as $myField => $myValue) {
                $updates .= ', `' . $myField . '` = \'' . $myValue . '\' ';
            }
            $db->query('UPDATE `' . getModeDetails($mode, 'TABLE_PANEL_USERS', 'table') . '` SET `invoice_fee` = \'' . $total_fee_taxed . '\' ' . $updates . ' WHERE `' . getModeDetails($mode, 'TABLE_PANEL_USERS', 'key') . '` = \'' . $user[getModeDetails($mode, 'TABLE_PANEL_USERS', 'key')] . '\' ');
            $returnval[$user[getModeDetails($mode, 'TABLE_PANEL_USERS', 'key')]] = $myUpdates;
            $returnval[$user[getModeDetails($mode, 'TABLE_PANEL_USERS', 'key')]]['total'] = $total_fee_taxed;
            $returnval[$user[getModeDetails($mode, 'TABLE_PANEL_USERS', 'key')]]['loginname'] = $user['loginname'];
        }
    }
    return $returnval;
}
开发者ID:HobbyNToys,项目名称:SysCP,代码行数:64,代码来源:function.cacheInvoiceFees.php

示例3: addInvoice

 /**
  * Add Invoice
  */
 public function addInvoice($customer_id)
 {
     // Validation Rules
     $validator = Validator::make(['customer_id' => $customer_id], ['customer_id' => 'integer']);
     // If Validation Fails
     if ($validator->fails()) {
         return redirect('/customers')->withErrors($validator->messages()->toArray());
     }
     // Start a new invoice model
     $invoice = new invoice();
     // Edit Properties
     $invoice->customer_id = $customer_id;
     $invoice_id = $invoice->save();
     // Redirect to the invoice profile
     return redirect('/invoice/' . $invoice_id);
 }
开发者ID:GobleB,项目名称:POS-CRUD,代码行数:19,代码来源:InvoiceController.php

示例4: submit_paypal_post

    function submit_paypal_post()
    {
        global $dbh, $postvar, $getvar, $instance;
        echo "<form action=" . $this->paypal_url . " method='post' name='frm'>";
        foreach ($this->fields as $a => $b) {
            if ($a == "amount") {
                if ($b == "0") {
                    $user_data = $dbh->select("users", array("id", "=", $_SESSION['cuser']));
                    $signup_date = date("m-d-Y", $user_data['signup']);
                    if ($signup_date == date("m-d-Y")) {
                        $noemail = "1";
                    }
                    invoice::set_paid($getvar['iid'], $noemail);
                    main::redirect("../client/?page=invoices");
                    exit;
                }
            }
            echo "<input type='hidden' name='" . $a . "' value='" . $b . "'>";
        }
        echo '</form>
		<script language="JavaScript">
		document.frm.submit();
		</script>';
        exit;
    }
开发者ID:cozylife,项目名称:tht-reworked,代码行数:25,代码来源:paypal.class.php

示例5: save

 function save()
 {
     if (!imp($this->get_value("iiAmount"))) {
         $this->set_value("iiAmount", $this->get_value("iiQuantity") * $this->get_value("iiUnitPrice"));
     }
     $status = parent::save();
     $status2 = invoice::update_invoice_dates($this->get_value("invoiceID"));
     return $status && $status2;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:9,代码来源:invoiceItem.inc.php

示例6: save_invoice_timeSheet

 function save_invoice_timeSheet($invoiceID, $timeSheetID)
 {
     global $TPL;
     $invoice = new invoice($invoiceID);
     if ($invoice->get_value("invoiceStatus") != "finished") {
         $timeSheet = new timeSheet();
         $timeSheet->set_id($timeSheetID);
         $timeSheet->select();
         $timeSheet->load_pay_info();
         $project = $timeSheet->get_foreign_object("project");
         $date = $timeSheet->get_value("dateFrom") or $date = date("Y-m-d");
         // customerBilledDollars will not be set if the actual field is blank,
         // and thus there won't be a usable total_customerBilledDollars.
         if (isset($timeSheet->pay_info["customerBilledDollars"])) {
             $amount = $timeSheet->pay_info["total_customerBilledDollars"];
             $iiUnitPrice = $timeSheet->pay_info["customerBilledDollars"];
             $iiQuantity = $timeSheet->pay_info["total_duration"];
         } else {
             $amount = $timeSheet->pay_info["total_dollars"];
             $iiUnitPrice = $amount;
             $iiQuantity = 1;
         }
         $q = prepare("SELECT * FROM invoiceItem WHERE invoiceID = %d AND timeSheetID = %d AND timeSheetItemID IS NULL\n                   ", $invoiceID, $timeSheetID);
         $db = new db_alloc();
         $db->query($q);
         $row = $db->row();
         $ii = new invoiceItem();
         if ($row) {
             $ii->set_id($row["invoiceItemID"]);
         }
         $ii->set_value("invoiceID", $invoiceID);
         $ii->set_value("timeSheetID", $timeSheet->get_id());
         $ii->set_value("iiMemo", "Time Sheet #" . $timeSheet->get_id() . " for " . person::get_fullname($timeSheet->get_value("personID")) . ", Project: " . $project->get_value("projectName"));
         $ii->set_value("iiQuantity", $iiQuantity);
         $ii->set_value("iiUnitPrice", $iiUnitPrice);
         $ii->set_value("iiAmount", $amount);
         $ii->set_value("iiDate", $date);
         $ii->set_value("iiTax", config::get_config_item("taxPercent"));
         $ii->currency = $timeSheet->get_value("currencyTypeID");
         $ii->save();
     } else {
         alloc_error("Unable to update related Invoice (ID:" . $invoiceID . ").");
     }
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:44,代码来源:invoiceEntity.inc.php

示例7: detail

 public function detail()
 {
     //get expenseaccount
     $expenseaccountobj = new expenseaccount();
     $detail['expense_account_all'] = $expenseaccountobj->get_all();
     //get customers with domain_id from session by constructor
     $customerobj = new customer();
     $detail['customer'] = $customerobj->get();
     $detail['customer_all'] = $customerobj->get_all();
     //get billers with domain_id from session by constructor
     $billerobj = new biller();
     $detail['biller_all'] = $billerobj->get_all();
     //get invoices
     $invoiceobj = new invoice();
     $detail['invoice_all'] = $invoiceobj->get_all();
     //get products
     $productobj = new product();
     $detail['product_all'] = $productobj->get_all();
     return $detail;
 }
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:20,代码来源:expense.php

示例8: newItem

 public function newItem($id, $requestData)
 {
     $invoice = invoice::findOrFail($id);
     $tasktimeId = $invoice->tasktime()->first()->fk_task_id;
     $clientid = $invoice->clients()->first()->id;
     $input = array_replace($requestData->all(), ['fk_task_id' => "{$tasktimeId}"]);
     $tasktime = TaskTime::create($input);
     $insertedId = $tasktime->id;
     $invoice->tasktime()->attach($insertedId);
     $invoice->clients()->attach($clientid);
 }
开发者ID:Bottelet,项目名称:Flarepoint-crm,代码行数:11,代码来源:InvoiceRepository.php

示例9: show_filter

function show_filter()
{
    global $TPL;
    global $defaults;
    $_FORM = invoice::load_form_data($defaults);
    $arr = invoice::load_invoice_filter($_FORM);
    is_array($arr) and $TPL = array_merge($TPL, $arr);
    $payment_statii = invoice::get_invoice_statii_payment();
    foreach ($payment_statii as $payment_status => $label) {
        $summary .= "\n" . $nbsp . invoice::get_invoice_statii_payment_image($payment_status) . " " . $label;
        $nbsp = "&nbsp;&nbsp;";
    }
    $TPL["status_legend"] = $summary;
    include_template("templates/invoiceListFilterS.tpl");
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:15,代码来源:invoiceList.php

示例10: detail

 public static function detail()
 {
     //get customers
     $detail['expense_account_all'] = expenseaccount::get_all();
     //get customers
     $detail['customer'] = customer::get();
     $detail['customer_all'] = customer::get_all();
     //get billers
     $detail['biller_all'] = biller::get_all();
     //get invoices
     $detail['invoice_all'] = invoice::get_all();
     //get products
     $detail['product_all'] = product::get_all();
     return $detail;
 }
开发者ID:alachaum,项目名称:simpleinvoices,代码行数:15,代码来源:expense.php

示例11: get_all_parties

 function get_all_parties($invoiceID)
 {
     if ($invoiceID) {
         $invoice = new invoice();
         $invoice->set_id($invoiceID);
         $invoice->select();
         $interestedPartyOptions = $invoice->get_all_partieS($invoice->get_value("projectID"), $invoice->get_value("clientID"));
     }
     if (is_object($this) && $this->get_id()) {
         $interestedPartyOptions = interestedParty::get_interested_parties("invoiceRepeat", $this->get_id(), $interestedPartyOptions);
     }
     return $interestedPartyOptions;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:13,代码来源:invoiceRepeat.inc.php

示例12: show_invoices

function show_invoices()
{
    $current_user =& singleton("current_user");
    global $project;
    $clientID = $project->get_value("clientID");
    $projectID = $project->get_id();
    $_FORM["showHeader"] = true;
    $_FORM["showInvoiceNumber"] = true;
    $_FORM["showInvoiceClient"] = true;
    $_FORM["showInvoiceName"] = true;
    $_FORM["showInvoiceAmount"] = true;
    $_FORM["showInvoiceAmountPaid"] = true;
    $_FORM["showInvoiceDate"] = true;
    $_FORM["showInvoiceStatus"] = true;
    $_FORM["clientID"] = $clientID;
    $_FORM["projectID"] = $projectID;
    // Restrict non-admin users records
    if (!$current_user->have_role("admin")) {
        $_FORM["personID"] = $current_user->get_id();
    }
    $rows = invoice::get_list($_FORM);
    echo invoice::get_list_html($rows, $_FORM);
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:23,代码来源:project.php

示例13: define

*/

define("BROWSE","browse");
//if this page has error with auth remove the above line and figure out how to do it right

$SI_INVOICE_TYPE = new SimpleInvoices_Db_Table_InvoiceType();

$domain_id = domain_id::get();

#$sql = "SELECT * FROM ".TB_PREFIX."invoices where domain_id = ".$domain_id;

#global $dbh;
#$sth = dbQuery($sql) or die(htmlsafe(end($dbh->errorInfo())));

//$sql = "SELECT * FROM ".TB_PREFIX."invoices LIMIT $start, $limit";
$invoice = new invoice();
$sth = $invoice->select_all();

$q = strtolower($_GET["q"]);
if (!$q) return;

while ($invoice = getInvoices($sth)) {

	$invoiceType = $SI_INVOICE_TYPE->getInvoiceType($invoice['type_id']);

	if (strpos(strtolower($invoice['index_id']), $q) !== false) {
		$invoice['id'] = htmlsafe($invoice['id']);
		$invoice['total'] = htmlsafe(number_format($invoice['total'],2));
		$invoice['paid'] = htmlsafe(number_format($invoice['paid'],2));
		$invoice['owing'] = htmlsafe(number_format($invoice['owing'],2));
		echo "$invoice[id]|<table><tr><td class='details_screen'>$invoice[preference]:</td><td>$invoice[index_id]</td><td  class='details_screen'>Total: </td><td>$invoice[total] </td></tr><tr><td class='details_screen'>Biller: </td><td>$invoice[biller] </td><td class='details_screen'>Paid: </td><td>$invoice[paid] </td></tr><tr><td class='details_screen'>Customer: </td><td>$invoice[customer] </td><td class='details_screen'>Owing: </td><td><u>$invoice[owing]</u></td></tr></table>\n";
开发者ID:CalhounGaming,项目名称:simpleinvoices,代码行数:31,代码来源:process_ajax.php

示例14: header

<?php

header("Content-type: text/xml");
//$start = (isset($_POST['start'])) ? $_POST['start'] : "0" ;
$dir = isset($_POST['sortorder']) ? $_POST['sortorder'] : "DESC";
$sort = isset($_POST['sortname']) ? $_POST['sortname'] : "id";
$rp = isset($_POST['rp']) ? $_POST['rp'] : "25";
$having = isset($_GET['having']) ? $_GET['having'] : "";
$page = isset($_POST['page']) ? $_POST['page'] : "1";
//$sql = "SELECT * FROM ".TB_PREFIX."invoices LIMIT $start, $limit";
$invoice = new invoice();
$invoice->sort = $sort;
if ($auth_session->role_name == 'customer') {
    $invoice->customer = $auth_session->user_id;
} elseif ($auth_session->role_name == 'biller') {
    $invoice->biller = $auth_session->user_id;
}
$invoice->query = isset($_REQUEST['query']) ? $_REQUEST['query'] : null;
$invoice->qtype = isset($_REQUEST['qtype']) ? $_REQUEST['qtype'] : null;
$large_dataset = getDefaultLargeDataset();
if ($large_dataset == $LANG['enabled']) {
    $sth = $invoice->select_all('large', $dir, $rp, $page, $having);
    $sth_count_rows = $invoice->count();
    $invoice_count = $sth_count_rows->fetch(PDO::FETCH_ASSOC);
    $invoice_count = $invoice_count['count'];
} else {
    $sth = $invoice->select_all('', $dir, $rp, $page, $having);
    $sth_count_rows = $invoice->select_all('count', $dir, $rp, $page, $having);
    $invoice_count = $sth_count_rows->rowCount();
}
$invoices = $sth->fetchAll(PDO::FETCH_ASSOC);
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:31,代码来源:xml.php

示例15: header

<?php

header("Content-type: text/xml");

//$start = (isset($_POST['start'])) ? $_POST['start'] : "0" ;
$dir = (isset($_POST['sortorder'])) ? $_POST['sortorder'] : "DESC" ;
$sort = (isset($_POST['sortname'])) ? $_POST['sortname'] : "id" ;
$rp = (isset($_POST['rp'])) ? $_POST['rp'] : "25" ;
$having = (isset($_GET['having'])) ? $_GET['having'] : "" ;
$page = (isset($_POST['page'])) ? $_POST['page'] : "1" ;
$baseUrl = Zend_Registry::get('baseUrl');

//$sql = "SELECT * FROM ".TB_PREFIX."invoices LIMIT $start, $limit";
$invoice = new invoice();
$invoice->sort=$sort;
$invoice->query=$_REQUEST['query'];
$invoice->qtype=$_REQUEST['qtype'];
$invoice->sort=$sort;

// if role is customer then select only on customer!!!
if ($auth_session -> role_name == "customer") {
   // find 'id' from customer table, based upon the email
   $id = $invoice->select_customer_id($auth_session->email);
   $invoice->customer = $id;
}

$sth = $invoice->select_all('', $dir, $rp, $page, $having);
$sth_count_rows = $invoice->select_all('count',$dir, $rp, $page, $having);

$invoices = $sth->fetchAll(PDO::FETCH_ASSOC);
开发者ID:CalhounGaming,项目名称:simpleinvoices,代码行数:30,代码来源:xml.php


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