當前位置: 首頁>>代碼示例>>PHP>>正文


PHP invoice::set_value方法代碼示例

本文整理匯總了PHP中invoice::set_value方法的典型用法代碼示例。如果您正苦於以下問題:PHP invoice::set_value方法的具體用法?PHP invoice::set_value怎麽用?PHP invoice::set_value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在invoice的用法示例。


在下文中一共展示了invoice::set_value方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: invoice

$db = new db_alloc();
$invoice = new invoice();
if ($invoiceID) {
    $invoice->set_id($invoiceID);
    $invoice->select();
    $invoice->set_values();
    $invoiceItemIDs = invoice::get_invoiceItems($invoiceID);
}
// If creating a new invoice
if ($_POST["save"] || $_POST["save_and_MoveForward"] || $_POST["save_and_MoveBack"]) {
    $invoice->read_globals();
    // Validation
    if ($invoice->get_value("projectID")) {
        $project = $invoice->get_foreign_object("project");
        $currency = $project->get_value("currencyTypeID");
        $invoice->set_value("clientID", $project->get_value("clientID"));
    }
    if (!$invoice->get_value("clientID")) {
        alloc_error("Please select a Client.");
    }
    $currency or $currency = config::get_config_item("currency");
    $invoice->set_value("currencyTypeID", $currency);
    if (!$invoice->get_value("invoiceNum") || !is_numeric($invoice->get_value("invoiceNum"))) {
        #alloc_error("Please enter a unique Invoice Number.");
        $invoice->set_value("invoiceNum", invoice::get_next_invoiceNum());
    } else {
        $invoiceID and $invoiceID_sql = prepare(" AND invoiceID != %d", $invoiceID);
        $q = prepare("SELECT * FROM invoice WHERE invoiceNum = '%s' " . $invoiceID_sql, $invoice->get_value("invoiceNum"));
        $db->query($q);
        if ($db->row()) {
            alloc_error("Please enter a unique Invoice Number (that number is already taken).");
開發者ID:cjbayliss,項目名稱:alloc,代碼行數:31,代碼來源:invoice.php

示例2: prepare

 function save_to_invoice($invoiceID = false)
 {
     if ($this->get_value("clientID")) {
         $invoiceID and $extra = prepare(" AND invoiceID = %d", $invoiceID);
         $client = $this->get_foreign_object("client");
         $db = new db_alloc();
         $q = prepare("SELECT * FROM invoice WHERE clientID = %d AND invoiceStatus = 'edit' " . $extra, $this->get_value("clientID"));
         $db->query($q);
         // Create invoice
         if (!$db->next_record()) {
             $invoice = new invoice();
             $invoice->set_value("clientID", $this->get_value("clientID"));
             $invoice->set_value("invoiceDateFrom", $this->get_min_date());
             $invoice->set_value("invoiceDateTo", $this->get_max_date());
             $invoice->set_value("invoiceNum", invoice::get_next_invoiceNum());
             $invoice->set_value("invoiceName", $client->get_value("clientName"));
             $invoice->set_value("invoiceStatus", "edit");
             $invoice->save();
             $invoiceID = $invoice->get_id();
             // Use existing invoice
         } else {
             $invoiceID = $db->f("invoiceID");
         }
         // Add invoiceItem and add expense form transactions to invoiceItem
         if ($_POST["split_invoice"]) {
             invoiceEntity::save_invoice_expenseFormItems($invoiceID, $this->get_id());
         } else {
             invoiceEntity::save_invoice_expenseForm($invoiceID, $this->get_id());
         }
     }
 }
開發者ID:cjbayliss,項目名稱:alloc,代碼行數:31,代碼來源:expenseForm.inc.php

示例3: max

 function update_invoice_dates($invoiceID)
 {
     $db = new db_alloc();
     $db->query(prepare("SELECT max(iiDate) AS maxDate, min(iiDate) AS minDate\n                          FROM invoiceItem\n                         WHERE invoiceID=%d", $invoiceID));
     $db->next_record();
     $invoice = new invoice();
     $invoice->set_id($invoiceID);
     $invoice->select();
     $invoice->set_value("invoiceDateFrom", $db->f("minDate"));
     $invoice->set_value("invoiceDateTo", $db->f("maxDate"));
     return $invoice->save();
 }
開發者ID:cjbayliss,項目名稱:alloc,代碼行數:12,代碼來源:invoice.inc.php

示例4: prepare

$q = prepare("SELECT invoiceRepeatDate.invoiceRepeatID\n                   , invoiceRepeatDate.invoiceDate\n                   , invoiceRepeat.invoiceID AS templateInvoiceID\n                   , invoiceRepeat.personID AS currentUser\n                   , invoiceRepeat.message\n                   , invoice.invoiceID\n                FROM invoiceRepeatDate\n           LEFT JOIN invoiceRepeat ON invoiceRepeatDate.invoiceRepeatID = invoiceRepeat.invoiceRepeatID\n           LEFT JOIN invoice ON invoice.invoiceRepeatID = invoiceRepeatDate.invoiceRepeatID\n                 AND invoice.invoiceRepeatDate = invoiceRepeatDate.invoiceDate\n               WHERE invoice.invoiceID IS NULL\n                 AND invoiceRepeatDate.invoiceDate <= '%s'", $today);
$orig_current_user =& singleton("current_user");
$db = new db_alloc();
$id = $db->query($q);
while ($row = $db->row($id)) {
    if ($row["currentUser"]) {
        $current_user = new person();
        $current_user->load_current_user($row["currentUser"]);
        singleton("current_user", $current_user);
    }
    #echo "<br>Checking row: ".print_r($row,1);
    $invoice = new invoice();
    $invoice->set_id($row["templateInvoiceID"]);
    $invoice->select();
    $i = new invoice();
    $i->set_value("invoiceRepeatID", $row["invoiceRepeatID"]);
    $i->set_value("invoiceRepeatDate", $row["invoiceDate"]);
    $i->set_value("invoiceNum", invoice::get_next_invoiceNum());
    $i->set_value("clientID", $invoice->get_value("clientID"));
    $i->set_value("projectID", $invoice->get_value("projectID"));
    $i->set_value("invoiceName", $invoice->get_value("invoiceName"));
    $i->set_value("invoiceStatus", "edit");
    $i->set_value("invoiceDateTo", $row["invoiceDate"]);
    $i->set_value("currencyTypeID", $invoice->get_value("currencyTypeID"));
    $i->set_value("maxAmount", $invoice->get_value("maxAmount"));
    $i->save();
    #echo "<br>Created invoice: ".$i->get_id();
    $q = prepare("SELECT * FROM invoiceItem WHERE invoiceID = %d", $invoice->get_id());
    $id2 = $db->query($q);
    while ($item = $db->row($id2)) {
        $ii = new invoiceItem();
開發者ID:cjbayliss,項目名稱:alloc,代碼行數:31,代碼來源:checkRepeat.php


注:本文中的invoice::set_value方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。