本文整理匯總了PHP中invoice::multiple_invoice_total方法的典型用法代碼示例。如果您正苦於以下問題:PHP invoice::multiple_invoice_total方法的具體用法?PHP invoice::multiple_invoice_total怎麽用?PHP invoice::multiple_invoice_total使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類invoice
的用法示例。
在下文中一共展示了invoice::multiple_invoice_total方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DB
/**
* Manage postback for multiple invoices
*/
function postback_multiple($arr)
{
$db =& DB();
include_once PATH_MODULES . 'invoice/invoice.inc.php';
$invoice = new invoice();
// get multi-invoice details
$total = $invoice->multiple_invoice_total($arr['invoice_id']);
if (!$total) {
return false;
}
$amt = $arr['amount'];
foreach ($invoice->invoice_id as $id) {
if ($amt > 0) {
// get total due for this invoice:
$rs = sqlSelect($db, "invoice", "SUM(total_amt-billed_amt) as total", "id={$id}");
if ($rs && $rs->RecordCount()) {
$thisamt = $rs->fields["total"];
if ($thisamt > $amt) {
$arr['amount'] = $amt;
} else {
$arr['amount'] = $thisamt;
}
$arr["invoice_id"] = $id;
$this->postback($arr);
$amt -= $thisamt;
}
}
}
}