本文整理汇总了PHP中price2num函数的典型用法代码示例。如果您正苦于以下问题:PHP price2num函数的具体用法?PHP price2num怎么用?PHP price2num使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了price2num函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllProjectByStatus
/**
* Return all leads grouped by status
*
* @param int $limit Limit results
* @return array|int Array with value or -1 if error
* @throws Exception
*/
function getAllProjectByStatus($limit = 5)
{
global $conf, $user, $langs;
$datay = array ();
$sql = "SELECT";
$sql .= " SUM(t.opp_amount), t.fk_opp_status, cls.code, cls.label";
$sql .= " FROM " . MAIN_DB_PREFIX . "projet as t, ".MAIN_DB_PREFIX."c_lead_status as cls";
$sql .= $this->buildWhere();
$sql .= " AND t.fk_opp_status = cls.rowid";
$sql .= " AND t.fk_statut <> 0"; // We want historic also, so all projects
$sql .= " GROUP BY t.fk_opp_status, cls.code, cls.label";
$result = array ();
$res = array ();
dol_syslog(get_class($this) . '::' . __METHOD__ . "", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
$other = 0;
while ( $i < $num ) {
$row = $this->db->fetch_row($resql);
if ($i < $limit || $num == $limit)
{
$label = (($langs->trans("OppStatus".$row[2]) != "OppStatus".$row[2]) ? $langs->trans("OppStatus".$row[2]) : $row[2]);
$result[$i] = array(
$label. ' (' . price(price2num($row[0], 'MT'), 1, $langs, 1, -1, -1, $conf->currency) . ')',
$row[0]
);
}
else
$other += $row[1];
$i++;
}
if ($num > $limit)
$result[$i] = array (
$langs->transnoentitiesnoconv("Other"),
$other
);
$this->db->free($resql);
} else {
$this->error = "Error " . $this->db->lasterror();
dol_syslog(get_class($this) . '::' . __METHOD__ . ' ' . $this->error, LOG_ERR);
return -1;
}
return $result;
}
示例2: _updateLine
function _updateLine($objectid, $objectelement, $lineid, $column, $value)
{
global $db, $conf, $langs;
${$column} = price2num($value);
$Tab = array();
$o = new $objectelement($db);
$o->fetch($objectid);
$find = false;
foreach ($o->lines as &$line) {
if ($line->id == $lineid || $line->rowid == $lineid) {
$find = true;
break;
}
}
if ($find) {
if (is_null($qty)) {
$qty = $line->qty;
}
if (is_null($price)) {
$price = $line->subprice;
}
if (is_null($remise_percent)) {
$remise_percent = $line->remise_percent;
}
if ($objectelement == 'facture') {
$res = $o->updateline($lineid, $line->desc, $price, $qty, $remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
$total_ht = $o->line->total_ht;
$uttc = $o->line->subprice + $o->line->subprice * $o->line->tva_tx / 100;
} else {
if ($objectelement == 'commande') {
$res = $o->updateline($lineid, $line->desc, $price, $qty, $remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->date_start, $line->date_end, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->fk_unit);
$total_ht = $o->line->total_ht;
$uttc = $o->line->subprice + $o->line->subprice * $o->line->tva_tx / 100;
} else {
$res = $o->updateline($lineid, $price, $qty, $remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit);
$total_ht = $o->line->total_ht;
$uttc = $o->line->subprice + $o->line->subprice * $o->line->tva_tx / 100;
}
}
if ($res > 0) {
$Tab = array('total_ht' => price($total_ht), 'qty' => $qty, 'price' => price($price), 'remise_percent' => $remise_percent, 'uttc' => $uttc);
} else {
$Tab = array('error' => 'updateFailed', 'msg' => $o->error);
}
} else {
$Tab = array('error' => 'noline');
}
return $Tab;
}
示例3: price
}
print '<td align="right">' . price(price2num($subtot_paye_total_ht, 'MT')) . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($subtot_paye_vat, 'MT')) . '</td>';
print '</tr>';
}
if (count($x_paye) == 0) {
print '<tr class="liste_total">';
print '<td> </td>';
print '<td align="right">' . $langs->trans("Total") . ':</td>';
if ($modetax == 0) {
print '<td class="nowrap" align="right"> </td>';
print '<td align="right"> </td>';
}
print '<td align="right">' . price(price2num(0, 'MT')) . '</td>';
print '<td class="nowrap" align="right">' . price(price2num(0, 'MT')) . '</td>';
print '</tr>';
}
print '</table>';
// Total to pay
print '<br><br>';
print '<table class="noborder" width="100%">';
$diff = $x_coll_sum - $x_paye_sum;
print '<tr class="liste_total">';
print '<td class="liste_total" colspan="' . $span . '">' . $langs->trans("TotalToPay") . ($q ? ', ' . $langs->trans("Quadri") . ' ' . $q : '') . '</td>';
print '<td class="liste_total nowrap" align="right"><b>' . price(price2num($diff, 'MT')) . "</b></td>\n";
print "</tr>\n";
$i++;
}
echo '</table>';
llxFooter();
$db->close();
示例4: krsort
print '<td>' . $langs->trans("Subscriptions") . '</td>';
print '<td align="right">' . $langs->trans("Number") . '</td>';
print '<td align="right">' . $langs->trans("AmountTotal") . '</td>';
print '<td align="right">' . $langs->trans("AmountAverage") . '</td>';
print "</tr>\n";
$var = true;
krsort($Total);
foreach ($Total as $key => $value) {
$var = !$var;
print "<tr {$bc[$var]}>";
print "<td><a href=\"adherent/cotisations.php?date_select={$key}\">{$key}</a></td>";
print "<td align=\"right\">" . $Number[$key] . "</td>";
print "<td align=\"right\">" . price($value) . "</td>";
print "<td align=\"right\">" . price(price2num($value / $Number[$key], 'MT')) . "</td>";
$numb += $Number[$key];
$tot += $value;
print "</tr>\n";
}
// Total
print '<tr class="liste_total">';
print '<td>' . $langs->trans("Total") . '</td>';
print "<td align=\"right\">" . $numb . "</td>";
print '<td align="right">' . price($tot) . "</td>";
print "<td align=\"right\">" . price(price2num($numb > 0 ? $tot / $numb : 0, 'MT')) . "</td>";
print "</tr>\n";
print "</table><br>\n";
print '</td></tr>';
print '</table>';
print dol_fiche_end();
llxFooter();
$db->close();
示例5: GETPOST
// Delete price by customer
$prodcustprice->id = GETPOST('lineid');
$result = $prodcustprice->delete($user);
if ($result < 0) {
setEventMessage($prodcustprice->error, 'mesgs');
} else {
setEventMessage($langs->trans('Delete'), 'errors');
}
$action = '';
}
if ($action == 'update_customer_price_confirm' && !$_POST["cancel"] && ($user->rights->produit->creer || $user->rights->service->creer)) {
$prodcustprice->fetch(GETPOST('lineid', 'int'));
$update_child_soc = GETPOST('updatechildprice');
// update price by customer
$prodcustprice->price = price2num(GETPOST("price"), 'MU');
$prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU');
$prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha');
$prodcustprice->tva_tx = str_replace('*', '', GETPOST("tva_tx"));
$prodcustprice->recuperableonly = preg_match('/\\*/', GETPOST("tva_tx")) ? 1 : 0;
$result = $prodcustprice->update($user, 0, $update_child_soc);
if ($result < 0) {
setEventMessage($prodcustprice->error, 'errors');
} else {
setEventMessage($langs->trans('Save'), 'mesgs');
}
$action = '';
}
/*
* View
*/
$form = new Form($db);
示例6: update
/**
* Update object into database
*
* @param User $user that modifies
* @param int $notrigger triggers after, 1=disable triggers
* @param int $forceupdateaffiliate update price on each soc child
* @return int <0 if KO, >0 if OK
*/
function update($user = 0, $notrigger = 0, $forceupdateaffiliate = 0)
{
global $conf, $langs;
$error = 0;
// Clean parameters
if (isset($this->entity)) {
$this->entity = trim($this->entity);
}
if (isset($this->fk_product)) {
$this->fk_product = trim($this->fk_product);
}
if (isset($this->fk_soc)) {
$this->fk_soc = trim($this->fk_soc);
}
if (isset($this->price)) {
$this->price = trim($this->price);
}
if (isset($this->price_ttc)) {
$this->price_ttc = trim($this->price_ttc);
}
if (isset($this->price_min)) {
$this->price_min = trim($this->price_min);
}
if (isset($this->price_min_ttc)) {
$this->price_min_ttc = trim($this->price_min_ttc);
}
if (isset($this->price_base_type)) {
$this->price_base_type = trim($this->price_base_type);
}
if (isset($this->tva_tx)) {
$this->tva_tx = trim($this->tva_tx);
}
if (isset($this->recuperableonly)) {
$this->recuperableonly = trim($this->recuperableonly);
}
if (isset($this->localtax1_tx)) {
$this->localtax1_tx = trim($this->localtax1_tx);
}
if (isset($this->localtax2_tx)) {
$this->localtax2_tx = trim($this->localtax2_tx);
}
if (isset($this->fk_user)) {
$this->fk_user = trim($this->fk_user);
}
if (isset($this->import_key)) {
$this->import_key = trim($this->import_key);
}
// Check parameters
// Put here code to add a control on parameters values
if ($this->price != '' || $this->price == 0) {
if ($this->price_base_type == 'TTC') {
$this->price_ttc = price2num($this->price, 'MU');
$this->price = price2num($this->price) / (1 + $this->tva_tx / 100);
$this->price = price2num($this->price, 'MU');
if ($this->price_min != '' || $this->price_min == 0) {
$this->price_min_ttc = price2num($this->price_min, 'MU');
$this->price_min = price2num($this->price_min) / (1 + $this->tva_tx / 100);
$this->price_min = price2num($this->price_min, 'MU');
} else {
$this->price_min = 0;
$this->price_min_ttc = 0;
}
} else {
$this->price = price2num($this->price, 'MU');
$this->price_ttc = $this->recuperableonly != 1 ? price2num($this->price) * (1 + $this->tva_tx / 100) : $this->price;
$this->price_ttc = price2num($this->price_ttc, 'MU');
if ($this->price_min != '' || $this->price_min == 0) {
$this->price_min = price2num($this->price_min, 'MU');
$this->price_min_ttc = price2num($this->price_min) * (1 + $this->tva_tx / 100);
$this->price_min_ttc = price2num($this->price_min_ttc, 'MU');
// print 'X'.$newminprice.'-'.$price_min;
} else {
$this->price_min = 0;
$this->price_min_ttc = 0;
}
}
}
// Do a copy of current record into log table
// Insert request
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_customer_price_log(";
$sql .= "entity,";
$sql .= "datec,";
$sql .= "fk_product,";
$sql .= "fk_soc,";
$sql .= "price,";
$sql .= "price_ttc,";
$sql .= "price_min,";
$sql .= "price_min_ttc,";
$sql .= "price_base_type,";
$sql .= "tva_tx,";
$sql .= "recuperableonly,";
$sql .= "localtax1_tx,";
//.........这里部分代码省略.........
示例7: while
$resql = $db->query($sql);
if ($resql) {
print '<table class="noborder" width="100%">';
$tag = !$tag;
print '<tr class="liste_titre">';
print '<td width="160">' . $langs->trans("Date") . '</td>';
print '<td width="160" align="center">' . $langs->trans("CustomerRelativeDiscountShort") . '</td>';
print '<td align="left">' . $langs->trans("NoteReason") . '</td>';
print '<td align="center">' . $langs->trans("User") . '</td>';
print '</tr>';
$i = 0;
$num = $db->num_rows($resql);
while ($i < $num) {
$obj = $db->fetch_object($resql);
$tag = !$tag;
print '<tr ' . $bc[$tag] . '>';
print '<td>' . dol_print_date($db->jdate($obj->dc), "dayhour") . '</td>';
print '<td align="center">' . price2num($obj->remise_percent) . '%</td>';
print '<td align="left">' . $obj->note . '</td>';
print '<td align="center"><a href="' . DOL_URL_ROOT . '/user/card.php?id=' . $obj->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $obj->login . '</a></td>';
print '</tr>';
$i++;
}
$db->free($resql);
print "</table>";
} else {
dol_print_error($db);
}
}
$db->close();
llxFooter();
示例8: dol_now
$result = $db->query($sql);
if ($result) {
$now = dol_now();
$nows = dol_print_date($now, '%Y%m%d');
//$form->load_cache_types_paiements();
//$form->cache_types_paiements
$var = true;
$num = $db->num_rows($result);
$i = 0;
$total = 0;
$sep = -1;
$total_deb = 0;
$total_cred = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
$total = price2num($total + $objp->amount, 'MT');
if ($i >= $viewline * ($totalPages - $page - 1)) {
$var = !$var;
// Is it a transaction in future ?
$dos = dol_print_date($db->jdate($objp->do), '%Y%m%d');
//print "dos=".$dos." nows=".$nows;
if ($dos < $nows) {
$sep = 0;
}
// 0 means there was at least one line before current date
if ($dos > $nows && !$sep) {
$sep = 1;
print '<tr class="liste_total"><td colspan="8">';
print $langs->trans("CurrentBalance");
print '</td>';
print '<td align="right" class="nowrap"><b>' . price($total - $objp->amount) . '</b></td>';
示例9: while
$year = $val['year'];
while ($year && $oldyear > $year + 1) {
// If we have empty year
$oldyear--;
print '<tr height="24">';
print '<td align="center"><a href="' . $_SERVER["PHP_SELF"] . '?year=' . $oldyear . '&mode=' . $mode . '">' . $oldyear . '</a></td>';
print '<td align="right">0</td>';
print '<td align="right">0</td>';
print '<td align="right">0</td>';
print '</tr>';
}
print '<tr height="24">';
print '<td align="center"><a href="' . $_SERVER["PHP_SELF"] . '?year=' . $year . '&mode=' . $mode . '">' . $year . '</a></td>';
print '<td align="right">' . $val['nb'] . '</td>';
print '<td align="right">' . price(price2num($val['total'], 'MT'), 1) . '</td>';
print '<td align="right">' . price(price2num($val['avg'], 'MT'), 1) . '</td>';
print '</tr>';
$oldyear = $year;
}
print '</table>';
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
// Show graphs
print '<table class="border" width="100%"><tr valign="top"><td align="center">';
if ($mesg) {
print $mesg;
} else {
print $px1->show();
print "<br>\n";
print $px2->show();
print "<br>\n";
print $px3->show();
示例10: dol_mktime
exit;
}
if ($action == 'add' && $_POST["cancel"] != $langs->trans("Cancel")) {
$error = 0;
$datep = dol_mktime(12, 0, 0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
$datev = dol_mktime(12, 0, 0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
$datesp = dol_mktime(12, 0, 0, $_POST["datespmonth"], $_POST["datespday"], $_POST["datespyear"]);
$dateep = dol_mktime(12, 0, 0, $_POST["dateepmonth"], $_POST["dateepday"], $_POST["dateepyear"]);
if (empty($datev)) {
$datev = $datep;
}
$object->accountid = GETPOST("accountid", "int");
$object->fk_user = GETPOST("fk_user", "int");
$object->datev = $datev;
$object->datep = $datep;
$object->amount = price2num(GETPOST("amount"));
$object->label = GETPOST("label");
$object->datesp = $datesp;
$object->dateep = $dateep;
$object->note = GETPOST("note");
$object->type_payment = GETPOST("paymenttype");
$object->num_payment = GETPOST("num_payment");
$object->fk_user_creat = $user->id;
// Set user current salary as ref salaray for the payment
$fuser = new User($db);
$fuser->fetch(GETPOST("fk_user", "int"));
$object->salary = $fuser->salary;
if (empty($datep) || empty($datev) || empty($datesp) || empty($dateep)) {
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors');
$error++;
}
示例11: set_remise_except
/**
* Add a discount for third party
* @param remise Montant de la remise
* @param user Utilisateur qui accorde la remise
* @param desc Motif de l'avoir
* @param tva_tx VAT rate
* @return int <0 if KO, id or record if OK
*/
function set_remise_except($remise, $user, $desc, $tva_tx=0)
{
global $langs;
// Nettoyage des parametres
$remise = price2num($remise);
$desc = trim($desc);
// Check parameters
if (! $remise > 0)
{
$this->error=$langs->trans("ErrorWrongValueForParameter","1");
return -1;
}
if (! $desc)
{
$this->error=$langs->trans("ErrorWrongValueForParameter","3");
return -2;
}
if ($this->id)
{
require_once(DOL_DOCUMENT_ROOT.'/core/class/discount.class.php');
$discount = new DiscountAbsolute($this->db);
$discount->fk_soc=$this->id;
$discount->amount_ht=price2num($remise,'MT');
$discount->amount_tva=price2num($remise*$tva_tx/100,'MT');
$discount->amount_ttc=price2num($discount->amount_ht+$discount->amount_tva,'MT');
$discount->tva_tx=price2num($tva_tx,'MT');
$discount->description=$desc;
$result=$discount->create($user);
if ($result > 0)
{
return $result;
}
else
{
$this->error=$discount->error;
return -3;
}
}
else return 0;
}
示例12: update
/**
* Update object into database
*
* @param User $user that modifies
* @param int $notrigger triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
function update($user = null, $notrigger = 0)
{
global $conf, $langs;
$error = 0;
// Clean parameters
if (isset($this->ref)) {
$this->ref = trim($this->ref);
}
if (isset($this->ref_ext)) {
$this->ref_ext = trim($this->ref_ext);
}
if (isset($this->ref_int)) {
$this->ref_int = trim($this->ref_int);
}
if (isset($this->fk_c_status)) {
$this->fk_c_status = trim($this->fk_c_status);
}
if (isset($this->fk_c_type)) {
$this->fk_c_type = trim($this->fk_c_type);
}
if (isset($this->amount_prosp)) {
$this->amount_prosp = trim($this->amount_prosp);
}
if (isset($this->fk_user_resp)) {
$this->fk_user_resp = trim($this->fk_user_resp);
}
if (isset($this->description)) {
$this->description = trim($this->description);
}
if (isset($this->fk_user_author)) {
$this->fk_user_author = trim($this->fk_user_author);
}
if (isset($this->fk_user_mod)) {
$this->fk_user_mod = trim($this->fk_user_mod);
}
if (isset($this->fk_soc)) {
$this->fk_soc = trim($this->fk_soc);
}
if (isset($this->note_private)) {
$this->note_private = trim($this->note_private);
}
if (isset($this->note_public)) {
$this->note_public = trim($this->note_public);
}
// Check parameters
// Put here code to add a control on parameters values
if (!empty($conf->global->LEAD_FORCE_USE_THIRDPARTY)) {
if (empty($this->fk_soc)) {
$error++;
$this->errors[] = $langs->trans('ErrorFieldRequired', $langs->transnoentities('Customer'));
}
}
if (empty($this->ref_int)) {
$error++;
$this->errors[] = $langs->trans('ErrorFieldRequired', $langs->transnoentities('LeadRefInt'));
}
if (empty($this->fk_user_resp)) {
$error++;
$this->errors[] = $langs->trans('ErrorFieldRequired', $langs->transnoentities('LeadCommercial'));
}
if (empty($this->fk_c_status)) {
$error++;
$this->errors[] = $langs->trans('ErrorFieldRequired', $langs->transnoentities('LeadStatus'));
}
if (empty($this->fk_c_type)) {
$error++;
$this->errors[] = $langs->trans('ErrorFieldRequired', $langs->transnoentities('LeadType'));
}
if (!isset($this->amount_prosp)) {
$error++;
$this->errors[] = $langs->trans('ErrorFieldRequired', $langs->transnoentities('LeadAmountGuess'));
}
if (dol_strlen($this->date_closure) == 0) {
$error++;
$this->errors[] = $langs->trans('ErrorFieldRequired', $langs->transnoentities('LeadDeadLine'));
}
if (!$error) {
// Update request
$sql = "UPDATE " . MAIN_DB_PREFIX . "lead SET";
$sql .= " ref=" . (isset($this->ref) ? "'" . $this->db->escape($this->ref) . "'" : "null") . ",";
$sql .= " ref_ext=" . (isset($this->ref_ext) ? "'" . $this->db->escape($this->ref_ext) . "'" : "null") . ",";
$sql .= " ref_int=" . (isset($this->ref_int) ? "'" . $this->db->escape($this->ref_int) . "'" : "null") . ",";
$sql .= " fk_c_status=" . (isset($this->fk_c_status) ? $this->fk_c_status : "null") . ",";
$sql .= " fk_c_type=" . (isset($this->fk_c_type) ? $this->fk_c_type : "null") . ",";
$sql .= " fk_soc=" . (isset($this->fk_soc) ? $this->fk_soc : "null") . ",";
$sql .= " date_closure=" . (dol_strlen($this->date_closure) != 0 ? "'" . $this->db->idate($this->date_closure) . "'" : 'null') . ",";
$sql .= " amount_prosp=" . (isset($this->amount_prosp) ? "'" . price2num($this->amount_prosp) . "'" : "null") . ",";
$sql .= " fk_user_resp=" . (isset($this->fk_user_resp) ? $this->fk_user_resp : "null") . ",";
$sql .= " description=" . (!empty($this->description) ? "'" . $this->db->escape($this->description) . "'" : "null") . ",";
$sql .= " note_private=" . (!empty($this->note_private) ? "'" . $this->db->escape($this->note_private) . "'" : "null") . ",";
$sql .= " note_public=" . (!empty($this->note_public) ? "'" . $this->db->escape($this->note_public) . "'" : "null") . ",";
$sql .= " fk_user_mod=" . $user->id . ",";
$sql .= " tms='" . $this->db->idate(dol_now()) . "'";
//.........这里部分代码省略.........
示例13: while
$sql .= " ORDER BY c.label";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$i = 0;
$total = 0;
$totalnb = 0;
$var = true;
while ($i < $num) {
$objp = $db->fetch_object($result);
$var = !$var;
print "<tr " . $bc[$var] . ">";
print "<td><a href=\"" . DOL_URL_ROOT . "/compta/bank/search.php?bid={$objp->rowid}\">{$objp->label}</a></td>";
print '<td align="right">' . $objp->nombre . '</td>';
print '<td align="right">' . price(abs($objp->somme)) . "</td>";
print '<td align="right">' . price(abs(price2num($objp->somme / $objp->nombre, 'MT'))) . "</td>";
print "</tr>";
$i++;
$total += abs($objp->somme);
$totalnb += $objp->nombre;
}
$db->free($result);
print '<tr class="liste_total"><td colspan="2">' . $langs->trans("Total") . '</td>';
print '<td align="right" class="liste_total">' . price($total) . '</td>';
print '<td align="right" colspan="2" class="liste_total">' . price($totalnb ? price2num($total / $totalnb, 'MT') : 0) . '</td></tr>';
} else {
dol_print_error($db);
}
print "</table>";
$db->close();
llxFooter();
示例14: dol_clone
$object->oldcopy = dol_clone($object);
$old_start_date = $object->date_start;
$object->ref = GETPOST('ref', 'alpha');
$object->title = GETPOST('title');
// Do not use 'alpha' here, we want field as it is
$object->socid = GETPOST('socid', 'int');
$object->description = GETPOST('description');
// Do not use 'alpha' here, we want field as it is
$object->public = GETPOST('public', 'alpha');
$object->date_start = empty($_POST["projectstart"]) ? '' : $date_start;
$object->date_end = empty($_POST["projectend"]) ? '' : $date_end;
if (isset($_POST['opp_amount'])) {
$object->opp_amount = price2num(GETPOST('opp_amount'));
}
if (isset($_POST['budget_amount'])) {
$object->budget_amount = price2num(GETPOST('budget_amount'));
}
if (isset($_POST['opp_status'])) {
$object->opp_status = $opp_status;
}
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) {
$error++;
}
}
if ($object->opp_amount && $object->opp_status <= 0) {
$error++;
setEventMessage($langs->trans("ErrorOppStatusRequiredIfAmount"), 'errors');
}
if (!$error) {
示例15: price2num
if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($objp->sellvalue,'MT'));
else print $langs->trans("Variable");
print '</td>';
// Status
print '<td align="right">'.$entrepot->LibStatut($objp->statut,5).'</td>';
print "</tr>\n";
$total += price2num($objp->estimatedvalue,'MU');
$totalsell += price2num($objp->sellvalue,'MU');
$var=!$var;
$i++;
}
print '<tr class="liste_total">';
print '<td colspan="2" align="right">'.$langs->trans("Total").'</td>';
print '<td align="right">'.price(price2num($total,'MT')).' '.$langs->trans('Currency'.$conf->currency).'</td>';
print '<td align="right">'.price(price2num($totalsell,'MT')).' '.$langs->trans('Currency'.$conf->currency).'</td>';
print '<td align="right"> </td>';
print "</tr>\n";
}
$db->free($result);
print "</table>";
print '<br>';
$file='entrepot-'.$year.'.png';
if (file_exists(DOL_DATA_ROOT.'/entrepot/temp/'.$file))
{
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_stock&file='.$file;
print '<img src="'.$url.'">';
}