本文整理汇总了PHP中invoice::get_next_invoiceNum方法的典型用法代码示例。如果您正苦于以下问题:PHP invoice::get_next_invoiceNum方法的具体用法?PHP invoice::get_next_invoiceNum怎么用?PHP invoice::get_next_invoiceNum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类invoice
的用法示例。
在下文中一共展示了invoice::get_next_invoiceNum方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: alloc_error
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).");
}
}
if (!$invoice->get_value("invoiceName") && $invoice->get_value("clientID")) {
$client = new client();
$client->set_id($invoice->get_value("clientID"));
$client->select();
$invoice->set_value("invoiceName", $client->get_value("clientName"));
}
if ($_POST["save_and_MoveForward"]) {
示例2: save_to_invoice
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());
}
}
}