当前位置: 首页>>代码示例>>PHP>>正文


PHP invoice::getInvoiceGross方法代码示例

本文整理汇总了PHP中invoice::getInvoiceGross方法的典型用法代码示例。如果您正苦于以下问题:PHP invoice::getInvoiceGross方法的具体用法?PHP invoice::getInvoiceGross怎么用?PHP invoice::getInvoiceGross使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在invoice的用法示例。


在下文中一共展示了invoice::getInvoiceGross方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: select

 public static function select($id)
 {
     global $logger;
     global $db;
     global $auth_session;
     $sql = "SELECT \n                    i.*,\n\t\t            i.date as date_original, \n                    (SELECT CONCAT(p.pref_inv_wording,' ',i.index_id)) as index_name,\n                    p.pref_inv_wording AS preference,\n                    p.status\n                FROM \n                    " . TB_PREFIX . "invoices i, \n                    " . TB_PREFIX . "preferences p \n                WHERE \n                    i.domain_id = :domain_id \n                    and\n                    i.preference_id = p.pref_id\n                    and \n                    i.id = :id";
     $sth = $db->query($sql, ':id', $id, ':domain_id', $auth_session->domain_id);
     $invoice = $sth->fetch();
     $invoice['calc_date'] = date('Y-m-d', strtotime($invoice['date']));
     $invoice['date'] = siLocal::date($invoice['date']);
     $invoice['total'] = getInvoiceTotal($invoice['id']);
     $invoice['gross'] = invoice::getInvoiceGross($invoice['id']);
     $invoice['paid'] = calc_invoice_paid($invoice['id']);
     $invoice['owing'] = $invoice['total'] - $invoice['paid'];
     $invoice['invoice_items'] = invoice::getInvoiceItems($id);
     #invoice total tax
     $sql2 = "SELECT SUM(tax_amount) AS total_tax, SUM(total) AS total FROM " . TB_PREFIX . "invoice_items WHERE invoice_id =  :id";
     $sth2 = dbQuery($sql2, ':id', $id) or die(htmlsafe(end($dbh->errorInfo())));
     $result2 = $sth2->fetch();
     //$invoice['total'] = number_format($result['total'],2);
     $invoice['total_tax'] = $result2['total_tax'];
     $invoice['tax_grouped'] = taxesGroupedForInvoice($id);
     return $invoice;
 }
开发者ID:alachaum,项目名称:simpleinvoices,代码行数:24,代码来源:invoice.php

示例2: getInvoice

function getInvoice($id, $domain_id = '')
{
    global $config;
    $domain_id = domain_id::get($domain_id);
    $sql = "SELECT * FROM " . TB_PREFIX . "invoices WHERE id =  :id AND domain_id =  :domain_id";
    $sth = dbQuery($sql, ':id', $id, ':domain_id', $domain_id);
    $invoice = $sth->fetch();
    $invoice['calc_date'] = date('Y-m-d', strtotime($invoice['date']));
    $invoice['date'] = siLocal::date($invoice['date']);
    $invoice['total'] = getInvoiceTotal($invoice['id']);
    $invoiceobj = new invoice();
    $invoiceobj->domain_id = $domain_id;
    $invoice['gross'] = $invoiceobj->getInvoiceGross($invoice['id']);
    $invoice['paid'] = calc_invoice_paid($invoice['id']);
    $invoice['owing'] = $invoice['total'] - $invoice['paid'];
    #invoice total tax
    $sql = "SELECT SUM(tax_amount) AS total_tax, SUM(total) AS total FROM " . TB_PREFIX . "invoice_items WHERE invoice_id =  :id AND domain_id =  :domain_id";
    $sth = dbQuery($sql, ':id', $id, ':domain_id', $domain_id);
    $result = $sth->fetch();
    //$invoice['total'] = number_format($result['total'],2);
    $invoice['total_tax'] = $result['total_tax'];
    $invoice['tax_grouped'] = taxesGroupedForInvoice($id);
    return $invoice;
}
开发者ID:simpleinvoices2,项目名称:simpleinvoices,代码行数:24,代码来源:sql_queries.php

示例3: getInvoice

function getInvoice($id)
{
    global $dbh;
    global $config;
    global $auth_session;
    $sql = "SELECT * FROM " . TB_PREFIX . "invoices WHERE id =  :id and domain_id =  :domain_id";
    //echo $sql;
    $sth = dbQuery($sql, ':id', $id, ':domain_id', $auth_session->domain_id) or die(htmlsafe(end($dbh->errorInfo())));
    //print_r($query);
    $invoice = $sth->fetch();
    //print_r($invoice);
    //exit();
    $invoice['calc_date'] = date('Y-m-d', strtotime($invoice['date']));
    $invoice['date'] = siLocal::date($invoice['date']);
    $invoice['total'] = getInvoiceTotal($invoice['id']);
    $invoice['gross'] = invoice::getInvoiceGross($invoice['id']);
    $invoice['paid'] = calc_invoice_paid($invoice['id']);
    $invoice['owing'] = $invoice['total'] - $invoice['paid'];
    #invoice total tax
    $sql = "SELECT SUM(tax_amount) AS total_tax, SUM(total) AS total FROM " . TB_PREFIX . "invoice_items WHERE invoice_id =  :id";
    $sth = dbQuery($sql, ':id', $id) or die(htmlsafe(end($dbh->errorInfo())));
    $result = $sth->fetch();
    //$invoice['total'] = number_format($result['total'],2);
    $invoice['total_tax'] = $result['total_tax'];
    $invoice['tax_grouped'] = taxesGroupedForInvoice($id);
    return $invoice;
}
开发者ID:alachaum,项目名称:simpleinvoices,代码行数:27,代码来源:sql_queries.php

示例4: getInvoice

function getInvoice($id) {
	global $dbh;
	global $config;
	global $auth_session;
    
    $SI_INVOICES = new SimpleInvoices_Db_Table_Invoices();
    $SI_INVOICE_ITEMS = new SimpleInvoices_Db_Table_InvoiceItems();
    
    $invoice = $SI_INVOICES->getInvoice($id);

	$invoice['calc_date'] = date('Y-m-d', strtotime( $invoice['date'] ) );
	$invoice['date'] = siLocal::date( $invoice['date'] );
	$invoice['total'] = $SI_INVOICE_ITEMS->getInvoiceTotal($invoice['id']);
	$invoice['gross'] = invoice::getInvoiceGross($invoice['id']);
	$invoice['paid'] = calc_invoice_paid($invoice['id']);
	$invoice['owing'] = $invoice['total'] - $invoice['paid'];
    if (isset($invoice['inv_status'])) {
		// This seems to be a thing of the past.
		// I think we could delete the whole "if".
		$invoice['status'] = $invoice['inv_status'];
	}
	else {
		$invoice['status'] = '';
	}


	#invoice total tax
    $result = $SI_INVOICE_ITEMS->getTotals($id);
	
	//$invoice['total'] = number_format($result['total'],2);
	$invoice['total_tax'] = $result['total_tax'];
	$invoice['tax_grouped'] = taxesGroupedForInvoice($id);

	return $invoice;
}
开发者ID:CalhounGaming,项目名称:simpleinvoices,代码行数:35,代码来源:sql_queries.php


注:本文中的invoice::getInvoiceGross方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。