* This file is part of the allocPSA application <*****@*****.**>. * * allocPSA is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. * * allocPSA is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public * License for more details. * * You should have received a copy of the GNU Affero General Public License * along with allocPSA. If not, see <http://www.gnu.org/licenses/>. */ define("NO_REDIRECT", 1); require_once "../alloc.php"; $db = new db_alloc(); $product = $_GET["product"]; $quantity = $_GET["quantity"]; $p = new product(); $p->set_id($product); $p->select(); $p->set_tpl_values(); // Probably not valid XML, but jQuery will parse it. echo "<data>\n"; echo "<price>" . page::money($TPL["sellPriceCurrencyTypeID"], $TPL["sellPrice"] * $quantity, "%m") . "</price>\n"; echo "<priceCurrency>" . $TPL["sellPriceCurrencyTypeID"] . "</priceCurrency>\n"; echo "<priceTax>" . ($TPL["sellPriceIncTax"] ? "1" : "") . "</priceTax>\n"; echo "<description>" . $TPL["description"] . "</description>\n"; echo "</data>\n";
public function TraerModelos() { $products = product::select('id', 'modelo')->where('modelo', '<>', 'null')->groupBy('modelo')->get(); return $products; }
} function tf_list($selected = "", $remove_these = array()) { global $tflist; $temp = $tflist; foreach ($remove_these as $dud) { unset($temp[$dud]); } echo page::select_options($temp, $selected); return; } $productID = $_GET["productID"] or $productID = $_POST["productID"]; $product = new product(); if ($productID) { $product->set_id($productID); $product->select(); } $tf = new tf(); $tflist = $tf->get_assoc_array("tfID", "tfName"); $extra_options = array("-1" => "META: Project TF", "-2" => "META: Salesperson TF", config::get_config_item("mainTfID") => "Main Finance TF (" . tf::get_name(config::get_config_item("mainTfID")) . ")", config::get_config_item("outTfID") => "Outgoing Funds TF (" . tf::get_name(config::get_config_item("outTfID")) . ")", config::get_config_item("inTfID") => "Incoming Funds TF (" . tf::get_name(config::get_config_item("inTfID")) . ")"); // Prepend the META options to the tflist. $tflist = $extra_options + $tflist; $TPL["companyTF"] = $tflist[config::get_config_item("mainTfID")]; $TPL["taxTF"] = $tflist[config::get_config_item("taxTfID")]; $taxRate = config::get_config_item("taxPercent") / 100.0; $TPL["taxRate"] = $taxRate; if ($_POST["save"]) { $product->read_globals(); $product->set_value("productActive", isset($_POST["productActive"]) ? 1 : 0); !$product->get_value("productName") and alloc_error("Please enter a Product Name."); !$product->get_value("sellPrice") and alloc_error("Please enter a Sell Price.");