本文整理汇总了PHP中format_money函数的典型用法代码示例。如果您正苦于以下问题:PHP format_money函数的具体用法?PHP format_money怎么用?PHP format_money使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了format_money函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getDiscountAmount
/**
* Get the amount incurred after a discount
*
* @param bool $format
*
* @return mixed
*/
public function getDiscountAmount($format = true)
{
if ($format) {
return format_money($this->discount->product($this));
}
return $this->discount->product($this)->getAmount();
}
开发者ID:muhamadsyahril,项目名称:ecommerce-1,代码行数:14,代码来源:DiscountsTrait.php
示例2: quotes_render_summarybox
function quotes_render_summarybox($id)
{
log_debug("inc_quotes", "quotes_render_summarybox({$id})");
// fetch quote information
$sql_obj = new sql_query();
$sql_obj->string = "SELECT code_quote, amount_total, date_validtill, date_sent, sentmethod FROM account_quotes WHERE id='{$id}' LIMIT 1";
$sql_obj->execute();
if ($sql_obj->num_rows()) {
$sql_obj->fetch_array();
if ($sql_obj->data[0]["amount_total"] == 0) {
print "<table width=\"100%\" class=\"table_highlight_important\">";
print "<tr>";
print "<td>";
print "<b>Quote " . $sql_obj->data[0]["code_quote"] . " has no items on it</b>";
print "<p>This quote needs to have some items added to it using the links in the nav menu above.</p>";
print "</td>";
print "</tr>";
print "</table>";
} else {
if (time_date_to_timestamp($sql_obj->data[0]["date_validtill"]) <= time()) {
print "<table width=\"100%\" class=\"table_highlight_important\">";
print "<tr>";
print "<td>";
print "<p><b>Quote " . $sql_obj->data[0]["code_quote"] . " has now expired and is no longer valid.</b></p>";
print "</td>";
print "</tr>";
print "</table>";
} else {
print "<table width=\"100%\" class=\"table_highlight_important\">";
print "<tr>";
print "<td>";
print "<b>Quote " . $sql_obj->data[0]["code_quote"] . " is currently valid.</b>";
print "<table cellpadding=\"4\">";
print "<tr>";
print "<td>Quote Total:</td>";
print "<td>" . format_money($sql_obj->data[0]["amount_total"]) . "</td>";
print "</tr>";
print "<tr>";
print "<td>Valid Until:</td>";
print "<td>" . $sql_obj->data[0]["date_validtill"] . "</td>";
print "</tr>";
print "<tr>";
print "<td>Date Sent:</td>";
if ($sql_obj->data[0]["sentmethod"] == "") {
print "<td><i>Has not been sent to customer</i></td>";
} else {
print "<td>" . $sql_obj->data[0]["date_sent"] . " (" . $sql_obj->data[0]["sentmethod"] . ")</td>";
}
print "</tr>";
print "</tr></table>";
print "</td>";
print "</tr>";
print "</table>";
}
}
print "<br>";
}
}
开发者ID:carriercomm,项目名称:amberdms-bs,代码行数:58,代码来源:inc_quotes.php
示例3: getDataTable
/**
* @return mixed
*/
public function getDataTable()
{
$products = $this->products->with(['category', 'subcategory', 'brand', 'reviews'])->select('*');
return Datatables::of($products)->addColumn('edit', function ($product) {
return link_to(route('backend.products.edit', ['id' => $product->id]), 'Edit', ['data-target-model' => $product->id, 'class' => 'btn btn-xs btn-primary']);
})->editColumn('price', function ($product) {
return format_money($product->price);
})->make(true);
}
开发者ID:muhamadsyahril,项目名称:ecommerce-1,代码行数:12,代码来源:ProductsController.php
示例4: service_render_summarybox
function service_render_summarybox($id_service)
{
log_debug("inc_service", "service_render_summarybox({$id_service})");
$sql_obj = new sql_query();
$sql_obj->string = "SELECT name_service,\n\t\t\t\t\t\tactive,\n\t\t\t\t\t\tservice_types.name as type_name,\n\t\t\t\t\t\tservice_groups.group_name as group_name,\n\t\t\t\t\t\tprice,\n\t\t\t\t\t\tdiscount\n\t\t\t\t\tFROM services\n\t\t\t\t\tLEFT JOIN service_types ON service_types.id = services.typeid\n\t\t\t\t\tLEFT JOIN service_groups ON service_groups.id = services.id_service_group\n\t\t\t\t\tWHERE services.id='{$id_service}' LIMIT 1";
$sql_obj->execute();
if ($sql_obj->num_rows()) {
$sql_obj->fetch_array();
if ($sql_obj->data[0]["active"]) {
// service is enabled
print "<table width=\"100%\" class=\"table_highlight_open\">";
print "<tr>";
print "<td>";
print "<b>Service " . $sql_obj->data[0]["name_service"] . " is enabled.</b>";
print "<table cellpadding=\"4\">";
print "<tr>";
print "<td>Service Type:</td>";
print "<td>" . $sql_obj->data[0]["type_name"] . "</td>";
print "</tr>";
print "<tr>";
print "<td>Service Group:</td>";
print "<td>" . $sql_obj->data[0]["group_name"] . "</td>";
print "</tr>";
if ($sql_obj->data[0]["discount"]) {
// work out the price after discount
$discount_calc = $sql_obj->data[0]["discount"] / 100;
$discount_calc = $sql_obj->data[0]["price"] * $discount_calc;
print "<tr>";
print "<td>Base Plan Price:</td>";
print "<td>" . format_money($sql_obj->data[0]["price"] - $discount_calc) . " (discount of " . format_money($discount_calc) . " included)</td>";
print "</tr>";
} else {
print "<tr>";
print "<td>Base Plan Price:</td>";
print "<td>" . format_money($sql_obj->data[0]["price"]) . "</td>";
print "</tr>";
}
print "</table>";
print "</td>";
print "</tr>";
print "</table>";
} else {
// service is not yet enabled
print "<table width=\"100%\" class=\"table_highlight_important\">";
print "<tr>";
print "<td>";
print "<b>Service " . $sql_obj->data[0]["name_service"] . " is inactive.</b>";
print "<p>This service is currently unconfigured, you need to setup the service plan before it will be activated.</p>";
print "</td>";
print "</tr>";
print "</table>";
}
print "<br>";
}
}
开发者ID:carriercomm,项目名称:amberdms-bs,代码行数:55,代码来源:inc_services_forms.php
示例5: popoverReceiptPreview
public function popoverReceiptPreview($receipt_id)
{
$r = Receipt::where('id', $receipt_id)->first();
$data['transaction'] = Receipt::buildReceipt($receipt_id);
$data['created_date'] = ng_date_format($r->created_at);
$data['created_time'] = ng_time_format($r->created_at);
$data['sales_person'] = istr::title(User::where('id', $r->user_id)->first()->name);
$data['total_amount_due'] = format_money($r->receipt_worth);
$data['total_amount_tendered'] = format_money($r->amount_tendered);
$data['change'] = format_money($r->change);
$s = Salelog::where('receipt_id', $receipt_id)->get()->toArray();
//$s = Salelog::where('receipt_id', $receipt_id)->get();
$data['items'] = $s;
//tt($data['items']->discount);
//$data['items']->unitprice = $data['items']->unitprice - (($data['items']->unitprice / 100) * (($data['items']->discount > 0) ? $data['items']->discount : 1 ));
//tt($data['items']);
return View::make('admin.quick_receipt_preview', $data);
}
开发者ID:sliekasirdis79,项目名称:POS,代码行数:18,代码来源:ReceiptController.php
示例6: printValue
function printValue($val, $h, $css)
{
$align = '';
// Maybe formalise 'time_length' filter, but check SQL pre-filter also
if ($h['filter_special'] == 'time_length') {
// $val = format_time_interval_prefs($val);
$val = format_time_interval($val, true, '%.2f');
if (!$val) {
$val = 0;
}
} elseif ($h['description'] == 'time_input_length') {
$val = format_time_interval($val, true, '%.2f');
if (!$val) {
$val = 0;
}
}
switch ($h['filter']) {
case 'date':
// we leave the date in 0000-000-00 00:00:00 format
break;
case 'currency':
if ($val) {
$val = format_money($val);
} else {
$val = 0;
}
break;
case 'number':
$align = 'align="right"';
if (!$val) {
$val = 0;
}
break;
}
if (is_numeric($val)) {
echo $val . ", ";
} else {
// escape " character (csv)
$val = str_replace('"', '""', $val);
echo '"' . $val . '" , ';
}
}
开发者ID:nyimbi,项目名称:legalcase,代码行数:42,代码来源:inc_obj_export_csv.php
示例7: printValue
function printValue($val, $h, $css)
{
$align = '';
// Maybe formalise 'time_length' filter, but check SQL pre-filter also
if ($h['filter_special'] == 'time_length') {
// $val = format_time_interval_prefs($val);
$val = format_time_interval($val, true, '%.2f');
if (!$val) {
$val = 0;
}
} elseif ($h['description'] == 'time_input_length') {
$val = format_time_interval($val, true, '%.2f');
if (!$val) {
$val = 0;
}
}
switch ($h['filter']) {
case 'date':
if ($val) {
$val = format_date($val, 'short');
}
break;
case 'currency':
if ($val) {
$val = format_money($val);
} else {
$val = 0;
}
break;
case 'number':
$align = 'align="right"';
if (!$val) {
$val = 0;
}
break;
}
echo '<td ' . $align . ' ' . $css . '>' . $val . "</td>\n";
}
开发者ID:nyimbi,项目名称:legalcase,代码行数:38,代码来源:inc_obj_export_html.php
示例8: foreach
<table cellspacing=0 cellpadding=5 id="currency_table">
<tr><th align=left>Currency</th><th align=right>Amount</th></tr>
<?php
foreach ($currencies as $code => $currency) {
$amount = currency_value($reserve, $code);
if (!ereg("[1-9]", $amount)) {
continue;
}
?>
<tr>
<td align=left><?php
echo $currency["name"];
?>
</td>
<td align=right><?php
echo format_money($amount . $code, $code);
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
}
?>
<hr size="1" />
<h2>Add Funds</h2>
<p>
Money in your reserve can be used to sponsor projects.
开发者ID:lobolabs,项目名称:fossfactory,代码行数:31,代码来源:reserve.php
示例9: site_url
" target="_blank"> <?php
echo $student->child_key;
?>
</a>
</td>
<td >
<a href="<?php
echo site_url("child/view/{$student->student_id}");
?>
" target="_blank"> <?php
echo get_display_name($student->name, $student->alias);
?>
</a>
</td>
<td ><?php
echo format_money($student->invoice_amount - $student->invoice_balance, $current_currency);
?>
</td>
<td >
<a href="<?php
echo site_url("payment/summary_of_account/{$student->student_id}");
?>
" getLink="<?php
echo site_url("payment/summary_of_account/{$student->student_id}");
?>
" class="backable_link da-button gray">Summary</a>
<a href="<?php
echo site_url("payment/create_receipt/{$student->student_id}");
?>
" getLink="<?php
echo site_url("payment/create_receipt/{$student->student_id}");
开发者ID:soarmorrow,项目名称:ci-kindergarden,代码行数:31,代码来源:billing_summary.php
示例10: format_money
<td id="sub_total" style="width:35%"><?php
echo format_money(isset($sub_total) ? $sub_total : 0, $current_currency);
?>
</td>
</tr>
<tr>
<td style="width:65%; font-weidht:bold;">TAX</td>
<td style="width:35%"><?php
echo format_money(isset($sub_total) ? $sub_total * $invoice->tax / 100 : '0', $current_currency);
?>
</td>
</tr>
<tr>
<td style="width:65%; font-weidht:bold;">Total</td>
<td style="width:35%"><?php
echo format_money(isset($sub_total) ? $sub_total * $invoice->tax / 100 + $sub_total : '0', $current_currency);
?>
</td>
</tr>
</table>
</div>
<div style="clear:both;"></div>
</div>
<div class="da-form-row">
<?php
echo $invoice_settings['invoice_footer'];
?>
</div>
</div>
开发者ID:soarmorrow,项目名称:ci-kindergarden,代码行数:31,代码来源:invoice_detail.php
示例11: execute
//.........这里部分代码省略.........
Define transaction form structure
*/
// unless there has been error data returned, fetch all the transactions
// from the DB, and work out the number of rows
if (!isset($_SESSION["error"]["form"][$this->obj_form->formname])) {
$sql_trans_obj = new sql_query();
$sql_trans_obj->string = "SELECT date_trans, amount_debit, amount_credit, chartid, source, memo FROM `account_trans` WHERE type='gl' AND customid='" . $this->id . "'";
$sql_trans_obj->execute();
if ($sql_trans_obj->num_rows()) {
$sql_trans_obj->fetch_array();
$this->num_trans = $sql_trans_obj->data_num_rows + 1;
}
} else {
$this->num_trans = @security_script_input('/^[0-9]*$/', $_SESSION["error"]["num_trans"]) + 1;
}
// ensure there are always 2 rows at least, additional rows are added if required (ie viewing
// an existing transaction) or on the fly when needed by javascript UI.
if ($this->num_trans < 2) {
$this->num_trans = 2;
}
// transaction rows
for ($i = 0; $i < $this->num_trans; $i++) {
// account
$structure = form_helper_prepare_dropdownfromdb("trans_" . $i . "_account", "SELECT id, code_chart as label, description as label1 FROM account_charts WHERE chart_type!='1' ORDER BY code_chart");
$structure["options"]["width"] = "200";
$this->obj_form->add_input($structure);
// debit field
$structure = NULL;
$structure["fieldname"] = "trans_" . $i . "_debit";
$structure["type"] = "input";
$structure["options"]["width"] = "80";
$this->obj_form->add_input($structure);
// credit field
$structure = NULL;
$structure["fieldname"] = "trans_" . $i . "_credit";
$structure["type"] = "input";
$structure["options"]["width"] = "80";
$this->obj_form->add_input($structure);
// source
$structure = NULL;
$structure["fieldname"] = "trans_" . $i . "_source";
$structure["type"] = "input";
$structure["options"]["width"] = "100";
$this->obj_form->add_input($structure);
// description
$structure = NULL;
$structure["fieldname"] = "trans_" . $i . "_description";
$structure["type"] = "textarea";
$this->obj_form->add_input($structure);
// if we have data from a sql query, load it in
if ($sql_trans_obj->data_num_rows) {
if (isset($sql_trans_obj->data[$i]["chartid"])) {
$this->obj_form->structure["trans_" . $i . "_debit"]["defaultvalue"] = $sql_trans_obj->data[$i]["amount_debit"];
$this->obj_form->structure["trans_" . $i . "_credit"]["defaultvalue"] = $sql_trans_obj->data[$i]["amount_credit"];
$this->obj_form->structure["trans_" . $i . "_account"]["defaultvalue"] = $sql_trans_obj->data[$i]["chartid"];
$this->obj_form->structure["trans_" . $i . "_source"]["defaultvalue"] = $sql_trans_obj->data[$i]["source"];
$this->obj_form->structure["trans_" . $i . "_description"]["defaultvalue"] = $sql_trans_obj->data[$i]["memo"];
}
}
}
// total fields
$structure = NULL;
$structure["fieldname"] = "total_debit";
$structure["type"] = "hidden";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "total_credit";
$structure["type"] = "hidden";
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "money_format";
$structure["type"] = "hidden";
$structure["defaultvalue"] = format_money(0);
$this->obj_form->add_input($structure);
// hidden
$structure = NULL;
$structure["fieldname"] = "id_transaction";
$structure["type"] = "hidden";
$structure["defaultvalue"] = $this->id;
$this->obj_form->add_input($structure);
$structure = NULL;
$structure["fieldname"] = "num_trans";
$structure["type"] = "hidden";
$structure["defaultvalue"] = "{$this->num_trans}";
$this->obj_form->add_input($structure);
// submit section
$structure = NULL;
$structure["fieldname"] = "submit";
$structure["type"] = "submit";
$structure["defaultvalue"] = "Save Changes";
$this->obj_form->add_input($structure);
// fetch the general form data
$this->obj_form->sql_query = "SELECT * FROM `account_gl` WHERE id='" . $this->id . "' LIMIT 1";
$this->obj_form->load_data();
// calculate totals
for ($i = 0; $i < $this->num_trans; $i++) {
@($this->obj_form->structure["total_debit"]["defaultvalue"] += $this->obj_form->structure["trans_" . $i . "_debit"]["defaultvalue"]);
@($this->obj_form->structure["total_credit"]["defaultvalue"] += $this->obj_form->structure["trans_" . $i . "_credit"]["defaultvalue"]);
}
}
开发者ID:carriercomm,项目名称:amberdms-bs,代码行数:101,代码来源:view.php
示例12: saveEdit
public function saveEdit()
{
$all = Input::all();
$id = $all['id'];
unset($all['id']);
//Lets update the table
Bankentry::find($id)->update($all);
//Lets fetch the updated data and return it through ajax
//$update = Bankentry::where('id', $id)->get()->toArray();
$all['id'] = $id;
if (isset($all['deposit_date'])) {
$all['deposit_date'] = custom_date_format('M j, Y', $all['deposit_date']);
}
if (isset($all['amount'])) {
$all['amount'] = format_money($all['amount']);
}
$data['status'] = 'success';
$data['message'] = $all;
return Response::json($data);
}
开发者ID:sliekasirdis79,项目名称:POS,代码行数:20,代码来源:AdminBankRecordController.php
示例13: format_money
</div>
<div class="col-xs-8">
<a class="goods-list-content" href="<?php
echo $goodsDetailUrl;
?>
?goodsId=<?php
echo $goods["id"];
?>
"><span class="name"><?php
echo $goods["name"];
?>
</span></a>
<div class="row row1">
<div class="col-xs-6 left1">
<span class="money"> ¥<?php
echo format_money($goods['purchasing_price']);
?>
</span>
</div>
<div class="col-xs-6 right1">
<img alt="140x140" width="20px" height="20px" src="<?php
echo $goods["source"]["icon_url"];
?>
" alt="" class="img-circle">
<?php
echo $goods["logistics_mode"]["name"];
?>
</div>
</div>
<?php
if ($customerType == "1") {
开发者ID:yunzhiclub,项目名称:wemall,代码行数:31,代码来源:a8ad52d2d878342407662eb11c92f4f2.php
示例14: render_pdf
function render_pdf()
{
// start the PDF object
$template_pdf = new template_engine_latex();
// load template
$template_pdf->prepare_load_template("templates/latex/report_balancesheet.tex");
/*
Fill in template fields
*/
// company logo
$template_pdf->prepare_add_file("company_logo", "png", "COMPANY_LOGO", 0);
// mode
$template_pdf->prepare_add_field("mode", $this->mode);
// dates
$template_pdf->prepare_add_field("date_end", time_format_humandate($this->date_end));
$template_pdf->prepare_add_field("date_created", time_format_humandate());
// totals
$template_pdf->prepare_add_field("amount_total_current_earnings", $this->data_totals["current_earnings"]);
$template_pdf->prepare_add_field("amount_total_assets", $this->data_totals["assets"]);
$template_pdf->prepare_add_field("amount_total_liabilities", $this->data_totals["liabilities"]);
$template_pdf->prepare_add_field("amount_total_equity", $this->data_totals["equity"]);
$template_pdf->prepare_add_field("amount_total_liabilities_and_equity", $this->data_totals["liabilities_and_equity"]);
// asset data
$structure_main = NULL;
foreach ($this->data_assets as $itemdata) {
$structure = array();
$structure["name_chart"] = $itemdata["code_chart"] . " -- " . $itemdata["description"];
$structure["amount"] = format_money($itemdata["amount"]);
$structure_main[] = $structure;
}
$template_pdf->prepare_add_array("table_assets", $structure_main);
// liabilities data
$structure_main = NULL;
foreach ($this->data_liabilities as $itemdata) {
$structure = array();
$structure["name_chart"] = $itemdata["code_chart"] . " -- " . $itemdata["description"];
$structure["amount"] = format_money($itemdata["amount"]);
$structure_main[] = $structure;
}
$template_pdf->prepare_add_array("table_liabilities", $structure_main);
// equity data
$structure_main = NULL;
foreach ($this->data_equity as $itemdata) {
$structure = array();
$structure["name_chart"] = $itemdata["code_chart"] . " -- " . $itemdata["description"];
$structure["amount"] = format_money($itemdata["amount"]);
$structure_main[] = $structure;
}
$template_pdf->prepare_add_array("table_equity", $structure_main);
/*
Output PDF
*/
// perform string escaping for latex
$template_pdf->prepare_escape_fields();
// fill template
$template_pdf->prepare_filltemplate();
// generate PDF output
$template_pdf->generate_pdf();
// display PDF
print $template_pdf->output;
// foreach ($template_pdf->processed as $line)
// {
// print $line;
// }
}
开发者ID:carriercomm,项目名称:amberdms-bs,代码行数:65,代码来源:balancesheet.php
示例15: format_dollars
function format_dollars($str)
{
return format_money($str, false);
}
开发者ID:JoshuaGrams,项目名称:wfpl,代码行数:4,代码来源:format.php
示例16: format_money
<div class="checkbox list-group-item">
<label>
<input type="checkbox" id="coupon<?php
echo $value["id"];
?>
" class="coupon" type="checkbox" data-id="<?php
echo $value["id"];
?>
" data-value="<?php
echo $value["cover"];
?>
" data-show-value="<?php
echo format_money($value['cover']);
?>
"> 面额:<?php
echo format_money($value['cover']);
?>
使用期限:<?php
echo date("Y-m-d H:i", $value['end_time']);
?>
</label>
</div><?php
}
}
?>
</div>
</div>
<div class="border" bgcolor="#ffffff">本次最多可使用<font id="totalCount" data-value="<?php
echo $i;
?>
"><?php
开发者ID:yunzhiclub,项目名称:wemall,代码行数:31,代码来源:1d3f8d58cd3408d3b2f110d8d992b8a7.php
示例17: customer_orders
}
// do we need to generate a setup fee?
if ($data["price_setup"] != "0.00" && $data["active"] == 1) {
$obj_customer_order = new customer_orders();
$obj_customer_order->id = $obj_customer->id;
$obj_customer_order->load_data();
$obj_customer_order->data_orders["date_ordered"] = date("Y-m-d");
$obj_customer_order->data_orders["type"] = "service";
$obj_customer_order->data_orders["customid"] = $obj_customer->obj_service->id;
$obj_customer_order->data_orders["quantity"] = "1";
$obj_customer_order->data_orders["price"] = $data["price_setup"];
$obj_customer_order->data_orders["discount"] = $data["discount_setup"];
$obj_customer_order->data_orders["description"] = "Setup Fee: " . $data["name_service"] . "";
if (!$obj_customer_order->action_update_orders()) {
log_write("error", "process", "An unexpected error occured whilst attempting to add an order item to the customer");
} else {
log_write("notification", "process", "Added setup fee of " . format_money($obj_customer_order->data_orders["amount"]) . " to customer orders, this will then be billed automatically.");
}
}
}
// return to services page
header("Location: ../index.php?page=customers/service-edit.php&id_customer=" . $obj_customer->id . "&id_service_customer=" . $obj_customer->id_service_customer . "");
exit(0);
}
/////////////////////////
} else {
// user does not have perms to view this page/isn't logged on
error_render_noperms();
header("Location: ../index.php?page=message.php");
exit(0);
}
开发者ID:carriercomm,项目名称:amberdms-bs,代码行数:31,代码来源:service-edit-process.php
示例18: generate_pdf
function generate_pdf()
{
log_debug("inc_credits", "Executing generate_pdf()");
// load data if required
if (!is_array($this->credit_fields)) {
$this->load_data();
$this->load_data_export();
}
// start the PDF object
//
// note: the & allows decontructors to operate
// Unfortunatly this trick is now deprecated with PHP 5.3.x and creates unsilencable errors ~JC 20100110
//
// get template filename based on currently selected options
$template_data = sql_get_singlerow("SELECT `template_type`, `template_file` FROM templates WHERE template_type IN('" . $this->type . "_tex', '" . $this->type . "_htmltopdf') AND active='1' LIMIT 1");
//exit("<pre>".print_r($template_data, true)."</pre>");
switch ($template_data['template_type']) {
case $this->type . '_htmltopdf':
$this->obj_pdf =& new template_engine_htmltopdf();
$template_file = $template_data['template_file'] . "/index.html";
if (is_dir("../../{$template_data['template_file']}")) {
$this->obj_pdf->set_template_directory("../../{$template_data['template_file']}");
} else {
$this->obj_pdf->set_template_directory("../{$template_data['template_file']}");
}
break;
case $this->type . '_tex':
default:
$this->obj_pdf =& new template_engine_latex();
$template_file = $template_data['template_file'] . ".tex";
break;
}
if (!$template_file) {
// fall back to old version
//
// TODO: we can remove this fallback code once the new templating system is fully implemented, this is to
// just make everything work whilst stuff like quote templates are being added.
//
$template_file = "templates/latex/" . $this->type . "";
}
// load template
if (file_exists("../../{$template_file}")) {
$this->obj_pdf->prepare_load_template("../../{$template_file}");
} elseif (file_exists("../{$template_file}")) {
$this->obj_pdf->prepare_load_template("../{$template_file}");
} else {
// if we can't find the template file, then something is rather wrong.
log_write("error", "inc_credits", "Unable to find template file {$template_file}, currently running in directory " . getcwd() . ", fatal error.");
return 0;
}
/*
Company Data
*/
// company logo
$this->obj_pdf->prepare_add_file("company_logo", "png", "COMPANY_LOGO", 0);
// convert the credit_fields array into
foreach ($this->credit_fields as $credit_field_key => $credit_field_value) {
$this->obj_pdf->prepare_add_field($credit_field_key, $credit_field_value);
}
/*
Fetch credit items (all credit items other than tax, are type == 'credit')
*/
// fetch invoice items
$sql_items_obj = new sql_query();
$sql_items_obj->string = "SELECT " . "id, type, chartid, customid, quantity, units, amount, price, description " . "FROM account_items " . "WHERE invoiceid='" . $this->id . "' " . "AND invoicetype='" . $this->type . "' " . "AND type='credit' " . "ORDER BY customid, chartid, description";
$sql_items_obj->execute();
$sql_items_obj->fetch_array();
$structure_credititems = array();
foreach ($sql_items_obj->data as $itemdata) {
$structure = array();
$structure["info"] = "CREDIT";
$structure["quantity"] = " ";
$structure["group"] = lang_trans("group_other");
$structure["price"] = "";
$structure["description"] = trim($itemdata["description"]);
$structure["units"] = $itemdata["units"];
$structure["amount"] = format_money($itemdata["amount"], 1);
$structure_credititems[] = $structure;
}
//exit("<pre>".print_r($structure_credititems,true)."</pre>");
$this->obj_pdf->prepare_add_array("credit_items", $structure_credititems);
unset($sql_items_obj);
/*
Tax Items
*/
// fetch tax items
$sql_tax_obj = new sql_query();
$sql_tax_obj->string = "SELECT " . "account_items.amount, " . "account_taxes.name_tax, " . "account_taxes.taxnumber " . "FROM " . "account_items " . "LEFT JOIN account_taxes ON account_taxes.id = account_items.customid " . "WHERE " . "invoiceid='" . $this->id . "' " . "AND invoicetype='" . $this->type . "' " . "AND type='tax'";
$sql_tax_obj->execute();
if ($sql_tax_obj->num_rows()) {
$sql_tax_obj->fetch_array();
$structure_taxitems = array();
foreach ($sql_tax_obj->data as $taxdata) {
$structure = array();
$structure["name_tax"] = $taxdata["name_tax"];
$structure["taxnumber"] = $taxdata["taxnumber"];
$structure["amount"] = format_money($taxdata["amount"]);
$structure_taxitems[] = $structure;
}
}
//.........这里部分代码省略.........
开发者ID:carriercomm,项目名称:amberdms-bs,代码行数:101,代码来源:inc_credits.php
示例19: foreach
?>
<?php
if (is_array($MenuList)) {
foreach ($MenuList as $key => $value) {
?>
<tr>
<td class="a"><?php
echo $value["id"];
?>
</td>
<td class="a"><?php
echo $value["name"];
?>
</td>
<td style='text-align: right' class="a"><?php
echo format_money($value['purchasing_price']);
?>
</td>
<td><?php
echo $value["sales_volume"];
?>
</td>
<td><?php
echo $value["reorder"];
?>
</td>
<td>
<a href="<?php
echo $value["actionUrl"]["onSheleves"];
?>
">
开发者ID:yunzhiclub,项目名称:wemall,代码行数:31,代码来源:9185f9b8c88eba027e808b1fcfd3e1f1.php
示例20: htmlentities
echo htmlentities($project['name']);
|
请发表评论