本文整理汇总了PHP中HtmlInput::show_receipt_document方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlInput::show_receipt_document方法的具体用法?PHP HtmlInput::show_receipt_document怎么用?PHP HtmlInput::show_receipt_document使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlInput
的用法示例。
在下文中一共展示了HtmlInput::show_receipt_document方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_html
function display_html()
{
$r = "";
//---Html
$array = $this->load();
if (is_array($array) == false || empty($array)) {
return 0;
}
$r .= '<table class="result" style="width:100%">';
$ix = 0;
$prev = 'xx';
$idx = 0;
$tot_deb = $tot_cred = 0;
bcscale(2);
foreach ($array as $row) {
if ($prev != $row['po_name']) {
if ($ix > 0) {
$r .= '<tr>';
$tot_solde = bcsub($tot_cred, $tot_deb);
$sign = " " . ($tot_solde > 0) ? 'C' : 'D';
$r .= td('') . td('') . td('');
$r .= td('') . td('') . td('') . td('') . td('') . td(nbm($tot_deb), ' class="num"') . td(nbm($tot_cred), ' class="num"') . td(nbm($tot_solde) . $sign, ' class="num notice"');
}
$r .= '<tr>' . '<td colspan="7" style="width:auto">' . '<h2>' . h($row['po_name'] . ' ' . $row['po_description']) . '</td></tr>';
$r .= '<tr>' . '<th>' . '</th>' . '<th>' . _('Date') . '</th>' . '<th>' . _('Poste') . '</th>' . '<th>' . _('Quick_code') . '</th>' . '<th>' . _('Libellé') . '</th>' . '<th>' . '</th>' . '<th>' . _('Pièce') . '</th>' . '<th>' . _('Interne') . '</th>' . '<th style="text-align:right">' . _('Débit') . '</th>' . '<th style="text-align:right">' . _('Crédit') . '</th>' . '<th style="text-align:right">' . _('Prog.') . '</th>' . '</tr>';
$tot_deb = $tot_cred = 0;
$prev = $row['po_name'];
$ix++;
}
$class = $idx % 2 == 0 ? 'even' : 'odd';
$idx++;
$r .= '<tr class="' . $class . '">';
$detail = $row['jr_id'] != null ? HtmlInput::detail_op($row['jr_id'], $row['jr_internal']) : '';
$post_detail = $row['j_poste'] != null ? HtmlInput::history_account($row['j_poste'], $row['j_poste']) : '';
$card_detail = $row['f_id'] != null ? HtmlInput::history_card($row['f_id'], $row['qcode']) : '';
$amount_deb = $row['oa_debit'] == 't' ? $row['oa_amount'] : 0;
$amount_cred = $row['oa_debit'] == 'f' ? $row['oa_amount'] : 0;
$tot_deb = bcadd($tot_deb, $amount_deb);
$tot_cred = bcadd($tot_cred, $amount_cred);
$tot_solde = bcsub($tot_cred, $tot_deb);
/*
* Checked button
*/
$str_ck = "";
$str_document = "";
if ($row['jr_id'] != null) {
/*
* Get receipt info
*/
$str_document = HtmlInput::show_receipt_document($row['jr_id']);
if ($str_document != "") {
$ck = new ICheckBox('ck[]', $row['jr_id']);
$str_ck = $ck->input();
}
}
$r .= '<td>' . $str_ck . '</td>' . '<td>' . $row['oa_date'] . '</td>' . td($post_detail) . td($card_detail) . td($row['jr_comment']) . '<td>' . $str_document . '</td>' . td($row['jr_pj_number']) . '<td>' . $detail . '</td>' . '<td class="num">' . nbm($amount_deb) . '</td>' . '<td class="num">' . nbm($amount_cred) . '</td>' . '<td class="num">' . nbm($tot_solde) . '</td>';
$r .= '</tr>';
}
$r .= '<tr>';
$tot_solde = bcsub($tot_cred, $tot_deb);
$sign = $tot_solde > 0 ? 'C' : 'D';
$r .= td('') . td('') . td('');
$r .= td('') . td('') . td('') . td('') . td('') . td(nbm($tot_deb), ' class="num"') . td(nbm($tot_cred), ' class="num"') . td(nbm($tot_solde) . $sign, ' class="num notice"');
$r .= '</table>';
return $r;
}
示例2: list
//.........这里部分代码省略.........
$r .= "</TD>";
// Tiers
$other = $row['quick_code'] != '' ? '[' . $row['quick_code'] . '] ' . $row['name'] . ' ' . $row['first_name'] : '';
$r .= td($other);
// comment
$r .= "<TD>";
$tmp_jr_comment = h($row['jr_comment']);
$r .= $tmp_jr_comment;
$r .= "</TD>";
$r .= td(h($row['n_text']), ' style="font-size:0.87em%"');
// Amount
// If the ledger is financial :
// the credit must be negative and written in red
$positive = 0;
// Check ledger type :
if ($row['jrn_def_type'] == 'FIN') {
$positive = $this->db->get_value("select qf_amount from quant_fin where jr_id=\$1", array($row['jr_id']));
if ($this->db->count() != 0) {
$positive = $positive < 0 ? 1 : 0;
}
}
$r .= "<TD align=\"right\">";
$t_amount = $row['jr_montant'];
if ($row['total_invoice'] != null && $row['total_invoice'] != $row['jr_montant']) {
$t_amount = $row['total_invoice'];
}
$tot = $positive != 0 ? bcsub($tot, $t_amount) : bcadd($tot, $t_amount);
//STAN $positive always == 0
if ($row['jrn_def_type'] == 'FIN') {
$r .= $positive != 0 ? "<font color=\"red\"> - " . nbm($t_amount) . "</font>" : nbm($t_amount);
} else {
$r .= $t_amount < 0 ? "<font color=\"red\"> " . nbm($t_amount) . "</font>" : nbm($t_amount);
}
$r .= "</TD>";
// Show the paid column if p_paid is not null
if ($p_paid != 0) {
$w = new ICheckBox();
$w->name = "rd_paid" . $row['jr_id'];
$w->selected = $row['jr_rapt'] == 'paid' ? true : false;
// if p_paid == 2 then readonly
$w->readonly = $p_paid == 2 ? true : false;
$h = new IHidden();
$h->name = "set_jr_id" . $row['jr_id'];
$r .= '<TD>' . $w->input() . $h->input() . '</TD>';
if ($row['jr_rapt'] == 'paid') {
$amount_paid = bcadd($amount_paid, $t_amount);
} else {
$amount_unpaid = bcadd($amount_unpaid, $t_amount);
}
}
// Rapprochement
$rec = new Acc_Reconciliation($this->db);
$rec->set_jr_id($row['jr_id']);
$a = $rec->get();
$r .= "<TD>";
if ($a != null) {
foreach ($a as $key => $element) {
$operation = new Acc_Operation($this->db);
$operation->jr_id = $element;
$l_amount = $this->db->get_value("select jr_montant from jrn " . " where jr_id={$element}");
$r .= "<A class=\"detail\" HREF=\"javascript:modifyOperation('" . $element . "'," . $gDossier . ")\" > " . $operation->get_internal() . "[" . nbm($l_amount) . "]</A>";
}
//for
}
// if ( $a != null ) {
$r .= "</TD>";
if ($row['jr_valid'] == 'f') {
$r .= "<TD>" . _("Opération annulée") . "</TD>";
} else {
}
// else
//document
if ($row['jr_pj_name'] != "") {
$r .= '<td>' . HtmlInput::show_receipt_document($row['jr_id']) . '</td>';
} else {
$r .= "<TD></TD>";
}
// end row
$r .= "</tr>";
}
$amount_paid = round($amount_paid, 4);
$amount_unpaid = round($amount_unpaid, 4);
$tot = round($tot, 4);
$r .= "<TR>";
$r .= '<TD COLSPAN="5">Total</TD>';
$r .= '<TD ALIGN="RIGHT">' . nbm($tot) . "</TD>";
$r .= "</tr>";
if ($p_paid != 0) {
$r .= "<TR>";
$r .= '<TD COLSPAN="5">' . _("Payé") . '</TD>';
$r .= '<TD ALIGN="RIGHT">' . nbm($amount_paid) . "</TD>";
$r .= "</tr>";
$r .= "<TR>";
$r .= '<TD COLSPAN="5">' . _("Non payé") . '</TD>';
$r .= '<TD ALIGN="RIGHT">' . nbm($amount_unpaid) . "</TD>";
$r .= "</tr>";
}
$r .= "</table>";
return array($count, $r);
}